When you create a new company and copy the setup / parameter tables from another company, you'll want to reset the number sequences.
static void JLH_ResetNumberSequences(Args _args)
{
NumberSequenceTable numberSequenceTable;
NumberSequenceList numberSequenceList;
;
// We want to be very sure that we are in the correct company :-)
if (curExt() == '130')
{
ttsbegin;
// First reset all number sequences
while select forupdate numberSequenceTable
{
numberSequenceTable.NextRec = numberSequenceTable.Lowest;
numberSequenceTable.doUpdate();
}
// Then delete exiting records in the lists
delete_from numberSequenceList;
ttscommit;
info("Number sequences have been reset");
}
else
info(strfmt("Number sequence of company %1 should not be reset", curExt()));
}
No comments:
Post a Comment