function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nikhil M KumarNikhil M Kumar 

What does the lookup field in a Custom object expect as a parameter (i.e., what datatype and what kind of field that the Parent object (one that is looked up by the custom object) would expect?

Order__c od = new Order__c();
        
        for(Item__c it : addedItems){    //addedItems (type: List) already created and populated!
            it.Order__c = od.id;
        }

In the code, I'm trying to put the Items in 'addedItems' list, each, into the Order__c object.
Anthony McDougaldAnthony McDougald
Hello Nikhil,
Hope that your day is off to an amazing start. The field requires the Id datatype. According to your code, it looks like you're trying to use the Id of a record that isn't committed to the database yet. Please feel free to let us know if we can serve you any further. Hope this helps and may God bless you abundantly.
Best Regards,
Anthony McDougald