16 Apr 2013

How to limit inserting records in a table

Here is an example of a method in a form for limiting the number of records to 12 :

void Query_cntRecords()
{
Query query = new Query();
QueryRun queryRun;
QueryBuildDataSource qbd;
;

qbd = query.addDataSource(tablenum(Thy_InventSymbolsIcons));
queryRun = new QueryRun(query);

if (SysQuery::countTotal(queryRun) == 13)
{
info(strfmt("Only 13 records"));
}
}

No comments:

Create number sequence in D365 FO

Create the data type. Add code in the loadModule method of the appropriate NumberSeqModule subclass. Add a method to the module’s paramet...