Hi all!
In a Danish database (3.70) I found an (AddOn?) module for Payments (Version List PM3.01.01.2.02).
In table 6016818 Payment Ledger Entry there is a field named UPR-No. which is filled OnInsert of a record by calling this function:
What is a UPR-No, what is it used for? Why is it created randomly? Could it be skipped/ignored?
Please enlighten me!
Kind regards,
In a Danish database (3.70) I found an (AddOn?) module for Payments (Version List PM3.01.01.2.02).
In table 6016818 Payment Ledger Entry there is a field named UPR-No. which is filled OnInsert of a record by calling this function:
AssignUPRNo() UPR : Integer
// AssignUPRNo
PmtSetup.GET;
PmtSetup.TESTFIELD("UPR-No. (Min.)");
PmtSetup.TESTFIELD("UPR-No. (Max.)");
RANDOMIZE;
UPR := RANDOM(PmtSetup."UPR-No. (Max.)"-PmtSetup."UPR-No. (Min.)"+1)+PmtSetup."UPR-No. (Min.)"-1;
PmtLedgEntry2.SETCURRENTKEY("UPR-No.");
PmtLedgEntry2.LOCKTABLE;
IF PmtLedgEntry2.FIND('-') THEN;
Attempt := 1;
REPEAT
PmtLedgEntry2.SETRANGE("UPR-No.",UPR);
Ok := NOT PmtLedgEntry2.FIND('+');
IF NOT Ok THEN BEGIN
UPR := RANDOM(PmtSetup."UPR-No. (Max.)"-PmtSetup."UPR-No. (Min.)"+1)+PmtSetup."UPR-No. (Min.)"-1;
Attempt := Attempt + 1;
END;
UNTIL Ok OR (Attempt = 100);
IF NOT Ok THEN
ERROR(
Text000,
PmtSetup."UPR-No. (Min.)",
PmtSetup."UPR-No. (Max.)",
PmtSetup.FIELDCAPTION("UPR-No. (Min.)"),
PmtSetup.FIELDCAPTION("UPR-No. (Max.)"),
PmtSetup.TABLECAPTION);
What is a UPR-No, what is it used for? Why is it created randomly? Could it be skipped/ignored?
Please enlighten me!
Kind regards,