Salesforce - 列表没有返回行

时间:2016-03-21 04:10:56

标签: salesforce apex

当我在数据库中检查相同的查询返回18行时,但在我的Apex类中它重新调整零行,如

 List<Account> accList=[SELECT Name,Id,ShippingStreet,ShippingState,ShippingCountry,ShippingCity,ShippingPostalCode
                           FROM Account];
 System.debug('accList size:'+accList.size());

请查看下面附带的快照enter image description here

enter image description here

请告诉我代码中发生的错误。

1 个答案:

答案 0 :(得分:0)

最后我解决了这个问题。我在apex Test类中运行这些语句,在将以下语句添加到我的代码后,我忘记包含相应记录的insert语句,

    Account acc=new Account(Name='test',ShippingStreet='Test address');
    insert acc;

解决了我的问题。