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();

Friday, June 18, 2021

DELPHI - How to open file in Windows Explorer (default opening)

Shellapi unit.
ShellExecute( Handle,
              'OPEN',
              PChar('explorer.exe'),
              PChar('/select, "' + path + '"'),
              nil,
              SW_NORMAL
             ) ;