Hi,
please consider below data model.
Account–>Opportunity–> OpportunityLineItem
I am rendering opportunities into picklist with master model as account. on account level I have one field which will store opportunityID (just for filtering model data).
on selection change of picklist value of opportunity, I am updating account row with currently selected OpportunityId.
now, on OpportuniyLineItem Model, I have one filterable condition which matches the value of this account row’s opportunityId and all OpportunityLineItems Id.
I am trying to refresh data model of OpportuityLineItem by below code on selection change of Opportunity.
var OppLineItemModel= skuid.model.getModel(‘OpportunityLineItem’);
condition = OppLineItemModel.getConditionByName(‘OpportunityId’);
OppLineItemModel.emptyData();
OppLineItemModel.setCondition(condition, selectedOption,true);
OppLineItemModel.activateCondition(condition);
OppLineItemModel.updateData(function() {});
but it’s throwing error " Uncaught Model ‘OpportunityLineItem’ has unsaved changes. To update this model’s data, you must first save or cancel the changes."
I tried to use .save() method and in success callback of Save method, I am trying to execute .updateData() function, but I am getting same error.
any help in this would be highly appreciated.
Thanks in Advance !
Question
model.updatedata() is not working, throwing Uncaught Model has unsaved changes. To update this model
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.