Valid Time State Tables and Date Effective Data on custom table dynamics ax 2012.
Views (4064)
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;
}

Like
Report
*This post is locked for comments