Monday, June 21, 2021

AX - How to disable AOS validation for table update

ValidateWrite() causes in this case dialog, this is how to disable its calling.
AssetTable assetTable;
    
new SkipAOSValidationPermission().assert();
    
ttsBegin;
       
while
  select forUpdate * from assetTable
  where
  ( assetTable.AssetId == "13487" ) || (  assetTable.AssetId == "13488" )
  {        
         
    assetTable.AcquisitionDate_W = str2Date( "1/6/2021", 123 );
    assetTable.update();        
            
  }

ttsCommit;
  
CodeAccessPermission::revertAssert();

No comments:

Post a Comment