AnsweredAssumed Answered

Set relationship dropdown via javascript controller

Question asked by Robin Thomas on May 2, 2017
Latest reply on Dec 22, 2017 by Kenneth Brill

Hi everyone,


I'm trying to set a relationship dropdown on the "One" side (One-To-Many relationship) in the create javascript controller.

With relate fields I'm able to simply do this:

this.model.set('account_c', accountName);

this.model.set('account_id_c', accountId);

and the dropdown updates to show the account name.


When using a proper relationship however this doesn't work. I can still set account_id_c, which will be saved, but setting account_c or account_name_c does not update the dropdown to reflect the change (keeps saying "Select account"). None of those appear in the model.attributes object anyway.


Is there another way to do this? I'm on Sugar btw.


Best Regards,