How to update the list of items from the response in some fields ?

1. I am calling an API on click of button. I am able to get response.  

Response Sample :  

{

Item1,

Item2,

Item3,

Item4

}

2.Now I want to put these values in some field (dropDownlist) where user can select it and use it. 

3.I had no idea how to put the items from response into dropdownlist or any other view filed. 

Please help me with  some suggestions and advice.

Version used : Sugar 10.3 (enterprise)

record.js

({
/*Disabling button ,condition based or dynamically on RecordView.
*
* custom/modules/Accounts/clients/base/views/record/reord.js
*/
extendsFrom:'RecordView',
initialize:function(options){
this._super('initialize',[options]);
//add listener for custom button
this.context.on('button:activate_button:click', this.activate_button, this);
},
activate_button:function(){
var self = this;
app.api.call('read', app.api.buildURL('Accounts/CustomerActivationAPI/' + this.model.get('id')), null,{
success:function(fdata)
{
console.log("Response", fdata);
},
error: function(error){
},
});
}
})

Parents
  • I unknow your business rule, but my suggest you work with fields dependencies, where your API returns one value and you set this value any field inside model, with this, your dependencie code start works create a new value list for this field.

    support.sugarcrm.com/.../

    I hope help you, regards

Reply
  • I unknow your business rule, but my suggest you work with fields dependencies, where your API returns one value and you set this value any field inside model, with this, your dependencie code start works create a new value list for this field.

    support.sugarcrm.com/.../

    I hope help you, regards

Children
No Data