$("input[name=name]").val('test');
when applying the value using Jquery. then after clicking the save button value is automatically erased and throws the required error message.
$("input[name=name]").val('test');
when applying the value using Jquery. then after clicking the save button value is automatically erased and throws the required error message.
Hi Dinesh, you can simply put the data on the save button functionality without manually providing the name by console. And insert it into the database it will automatically save it.
Depending on your scenario, you could use the formula in Studio to set the name of the record.
For example, I set Opportunity Nmae as a concatenation of Account Name, Close Date and another custom field. The downside is that it makes the field read only so the user cannot override that value, which, depending on scenarios may not be what you want.
When I need to set a field in a controller, I use the Sidecar MVC framework and set the value for the field in the model in the module's custom extension of create.js, for example:
this.model.set('<field_name>', "<value>");
This will set the value for the field. Then when the user saves the record that field will also be saved.
I think the problem you are having is that you are basically setting what the person sees but not the value in the bean, the field in the model is not actually changed so the changedAttributes will not include the field you updated and it won't be saved.
FrancescaS