我想将标准对象设置为自定义对象的字段。
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.
答案 0 :(得分: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;
答案 1 :(得分:-1)
您需要像这样编码 sss.Ref_Account__c = a.Ref_Account__c;