AnsweredAssumed Answered

Select a dropdown value using javascript

Question asked by Andrew Wong on Dec 19, 2016
Latest reply on Dec 28, 2016 by Andrew Wong

I am currently working on a task to set a default value for a dropdown when converting a lead to an account.

It seems to be no such option in studio, therefore I tried to select the value using javascript.

 

I tried to extend /custom/modules/Leads/clients/base/layouts/convert-main/convert-main.js and set the default value to the field. However, the value in model is changed but the dropdown is still unchanged. I had tried 2 days but still not able to change the value of the dropdown.

 

My code:

/custom/modules/Leads/clients/base/layouts/convert-main/convert-main.js

.....

initializePanels: function(modulesMetadata){

var accountView = this.convertPanels['Accounts'];

accountView.model.setDefault('target_field_c', "default_value");

}

......

 

Would you please suggest a proper way of doing it?

Outcomes