2016-02-14 101 views

回答

-1

你需要像这样的代码 sss.Ref_Account__c = a.Ref_Account__c;

0
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.Id; 
+0

这不起作用。有没有其他方法? –

+0

不,没有其他办法。但是,您的帐户对象(a)上必须有Id。如果你只是实例化和对象 - 它不会有一个Id。您需要将其插入到数据库或从数据库读取。 –

相关问题