Posts

Showing posts with the label index

Dynamics AX Data Upgrade : Valid Time State Key Error after Upgrading or Updating

Some times during Upgrades we face a compilation error  “Table does not contain a valid time state key. A unique index needs to be marked as a valid time state key.” Cause The index is disabled using  indexAllowDup  method, then properties  AlternateKey  and  ValidTimeStateKey  are reset to default value  No . ReleaseUpdateDB:: indexAllowDup ( new  DictIndex( tableNum (TableName), indexNum (TableName, DateEffectiveIndex))); The error starts to show up then indexes are not enabled correctly using method indexAllowNoDup : ReleaseUpdateDB:: indexAllowNoDup ( new  DictIndex( tableNum (TableName), indexNum (TableName, DateEffectiveIndex))); AlternateKey  and  ValidTimeStateKey  properties are not set using the code and then you start getting compilation error mentioned above. Solution You should use the method  indexAllowNoDupAndDateEffective  instead: ReleaseUpdateDB:: indexAllow...