≡ Menu

Valid Time State Tables and Date Effective Data on custom table dynamics ax 2012.

Hi all, today I have very small tip, I have inject some data on one of custom table written by some different team.  But update throw exception

 Update on a valid time state table is not allowed without specifying a ValidTimeStateUpdateMode

 

 

Table is custom I update the required filed by following code snippet.

Suppose table name is “Xyz”.

 

 

 

 

select forUpdate * from xyz where xyz.recid== _RecId ;

try {

ttsBegin;

_Value= “Abcd”;

xyz.Name = _Value;

xyz.validTimeStateUpdateMode(ValidTimeStateUpdate::Correction);

xyz.ValidFrom =today();

xyz.ValidTo=dateMax();

xyz.update();

ttsCommit;

}

catch

{

ttsAbort;

}

 

Reference https://community.dynamics.com/ax/b/axstart/archive/2014/03/02/valid-time-state-tables-and-date-effective-data-in-combination-with-dmf-and-wcf-aif

{ 0 comments… add one }

Leave a Comment