diff --git a/src/js/OptionSetHandler.js b/src/js/OptionSetHandler.js index b9577c1..1653fa3 100644 --- a/src/js/OptionSetHandler.js +++ b/src/js/OptionSetHandler.js @@ -74,6 +74,10 @@ var optionSetValue = parseInt(record.schemaName); var changes = record.w2ui.changes; + if (!optionSetValue) { + continue; + } + var labels = []; for (var change in changes) { @@ -175,6 +179,12 @@ var records = XrmTranslator.GetGrid().records; var updates = GetUpdates(records); + if (!updates || updates.length === 0) { + XrmTranslator.LockGrid("Reloading"); + + return OptionSetHandler.Load(); + } + Promise.resolve(updates) .each(function(payload) { return WebApiClient.SendRequest("POST", WebApiClient.GetApiUrl() + "UpdateOptionValue", payload);