I ma trying to update a picklist value in my application object through a javascript code

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
I ma trying to update a picklist value in my application object through a javascript code .The code is working fine as the alert result shows but the value is not getting reflected in other tabs
Here is the code. 
var scModels = skuid.model.getModel('Application');
var scRow = scModels.data[0]; 
var stat=scRow.genesis__Status__c;
alert('stat   '+stat);
var result = sforce.apex.execute('genesis.SkuidPricingCtrl','generatePricing',
{   
        applicationId : scRow.Id
});
alert(result);
scRow.genesis__Status__c= "NEW - PRICING GENERATED";
alert('scRow.genesis__Status__c   '+scRow.genesis__Status__c);
scModels.updateData(); 
window.location.reload();

The picklist value in my application model is not getting updated 
Photo of Raya Banerjee

Raya Banerjee

  • 456 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Raya,

Try using the skuid API to update the model.
Instead of:
 scRow.genesis__Status__c= "NEW - PRICING GENERATED";

Use:
scModels.updateRow(scRow, {'genesis__Status__c' : "NEW - PRICING GENERATED"});
Photo of Raya Banerjee

Raya Banerjee

  • 456 Points 250 badge 2x thumb
Thanks Matt, I tried this but the updated field value is still not getting reflected.is their any other way?
(Edited)