rallyappsdk2

PreliminaryEstimate's Value resets to old value on saving with new value


I am trying to edit and save the PreliminaryEstimate Value of a portfolio item through Estimation Board but it reset it back to the original value. I am using PreliminaryEstimateValue in the board but when the card is moved, i reset the PreliminaryEstimate to new column value.

var store = Ext.create('Rally.data.wsapi.Store', { model: 'PreliminaryEstimate', fetch: ['ObjectID','ObjectUUID','VersionId','Description','Name','Value','CreationDate','Subscription','Workspace','RevisionHistory'], autoLoad: false, limit: Infinity, disableMetaChangeEvent: true });

beforecarddroppedsave: function (scope, card, type, sourceColumn, eOpts) { card.record.data.PreliminaryEstimate = _.omit(_.filter(this.preliminaryEstimateStore.getRange(), function (pe) { return pe.data.Value === card.record.data.PreliminaryEstimateValue })[0] .data, ['Summary', 'creatable', 'deletable', 'updatable', '_CreatedAt', '_objectVersion', '_uuidRef']);

the options also has the new value. It saves succesfully but the old value does not change to new handleBeforeCardDroppedSave: function (options) { options.record.save({})
Thanks!


Solution

  • If you inspect the network traffic is it actually sending that value over the wire? I'd try using the setter method rather than directly manipulating the data object. My guess is that the record does not think it has any changes to save with the way your current code is written.

    card.record.set('PreliminaryEstimate', '/preliminaryestimatevalue/12345');