validateWrite method Ax 2012

Just for my documentation, below is sample script i wrote for client :

public boolean validateWrite()
{ 
 xxx_TaxTableCompany xxx_TaxTableCompany;
 xxxTaxNumberingTable xxxTaxNumberingTable;
 xxxTaxNumberingLine xxxTaxNumberingLine;
 RefRecId refRecId;
 RecId recId;
 SelectableDataArea datAreaId, lineDatAreaId;
 str valFieldGrid;
 boolean ret;
 ;
 
 xxxTaxNumberingLine = TaxNumberingLine_ds.cursor();
 lineDatAreaId = xxxTaxNumberingLine.DatAreaId;
 recID = xxxTaxNumberingTable::findRecID(xxxTaxNumberingLine.RefRecId).RecId;
 
 select RefRecId, DatAreaId from xxx_TaxTableCompany
 where xxx_TaxTableCompany.RefRecId == recId && xxx_TaxTableCompany.DatAreaId == lineDatAreaId; 
 
 if (xxx_TaxTableCompany) 
     ret = super(); 
 else 
    info('Invalid company');
 return ret;
}

		

About this entry