0
我想将标准对象设置为自定义对象的字段。将标准对象设置为salesforce中的自定义对象字段
Account a = new Account();
Customer__c sss = new Customer__c();
sss.Ref_Account__c --> this is a field that takes an 'Account' object.
sss.Ref_Account__c = a; This gives me error.
这不起作用。有没有其他方法? –
不,没有其他办法。但是,您的帐户对象(a)上必须有Id。如果你只是实例化和对象 - 它不会有一个Id。您需要将其插入到数据库或从数据库读取。 –