You need to sign in to do that
Don't have an account?
Jerome Scola
Can I Insert a Object with Lookup field to Salesforce
I have a custom object named Event , the basic fields are EventId,EventName ect.
Another custom object named Product, it has a lookup field which has relationship with Event
Now, in my local web application, I want to insert a product to saleForce based on a existing event.
How can I create the relationship between the Event and Product by local code ?
in other words, what prameter for Product's lookup field should I pass ?
Another custom object named Product, it has a lookup field which has relationship with Event
Now, in my local web application, I want to insert a product to saleForce based on a existing event.
How can I create the relationship between the Event and Product by local code ?
in other words, what prameter for Product's lookup field should I pass ?
Id eventId= 'a01XXXXXXXXX' ; // Event Id which you want to related with Product.
Product2 prod = new Product2(Name ='Test product' , EventLookup__c = accId , and other mandatory fields )
insert prod ;
All Answers
Id eventId= 'a01XXXXXXXXX' ; // Event Id which you want to related with Product.
Product2 prod = new Product2(Name ='Test product' , EventLookup__c = accId , and other mandatory fields )
insert prod ;
My event Id is 10, the look up api name is GWCEventId__c
so Product2 prod = new Product2(Name ='Test product' , GWCEventId__c = 10 ,...) ?
I did like this,it told me the type is wrong. can you give me more detail? thanks.