How to set lookup properly in javascript

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
Hi I'm creating a new data row in javascript.

   contactRatingsModel.createRow({
                   
                    additionalConditions:[
                       
                        {Item__c: row.Id},
                        {Contact__c: contactModel.data[0].Id}
                        ]
                   
                });

The contact__c and contact__r.Name are set properly I can see them in the developer console by displaying model.data. I think that's because the contactModel has the name information.

But Item__c is empty. I do have a model for Item__c. Can you please advise how to set this properly? row.Id has the right value in console.log.
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,032 Points 2k badge 2x thumb

Posted 2 years ago

  • 1
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,032 Points 2k badge 2x thumb
 Using  {field: 'Item__c', value: row.Id} worked!