project BLF > class BNumber > method CommitNumber
Description
Commit a previously claimed number.
This method must be called inside the transaction that creates the object that is identified by this number.
Parameters
iiCompanyID | input | integer | Entity ID |
iiNumbrYear | input | integer | NumbrYear |
icNumbrType | input | character | NumbrType |
iiNumbr | input | integer | Numbr |
iiInstanceId | input | integer | |
icClassName | input | character | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program1/bnumber.p)
if oiReturnStatus = 0
then oiReturnStatus = -98.
assign vcWhere = "for each Numbr where Numbr.Company_ID = ":U + string(iiCompanyId)
+ " and Numbr.NumbrYear = ":U + string(iiNumbrYear)
+ " and Numbr.NumbrType = '":U + icNumbrType
+ "' and Numbr.Numbr = ":U + string(iiNumbr).
<M-1 run StartPersistence
(output vhFcComponent (ohPersistence),
output viFcReturnSuper (oiReturnStatus)) in BNumber>
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.
<M-4 run DeleteNumber
(input iiInstanceId (iiInstanceId),
input icClassName (icClassName),
input string(iiCompanyId) + ',' + string(iiNumbrYear) + ',' + icNumbrType + ',' + string(iiNumbr) (icNumberData)) in persistence>
<M-3 run WriteDirect
(input 'Numbr':U (icTableName),
input vcWhere (icPrepare),
input '' (icFieldList),
input '' (icFieldListDataTypes),
input '' (icAbsolute),
input '' (icIncremental),
input {&TARGETPROCEDURE} (ihClass),
input vcUserLogin (icUserLogin),
output viFcReturnSuper (oiReturnStatus)) in persistence>
/* allow multiple commit of the same number */
if viFcReturnSuper = -4
then viFcReturnSuper = 0.
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.
if oiReturnStatus = -98
then oiReturnStatus = 0.