Increment ID in invoice/contract

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • eymen-elkum
    replied
    Hello,

    Add new int field to the parent entity and set the value using this formula script:

    Code:
    $invoiceCount = record\count('Contract', 'contractId', contractId);
    
    ifThen(entity\isNew(), $invoiceCount = $invoiceCount + 1);
    
    record\update(
        'Contract', contractId,
        invoiceCount, $invoiceCount,
    );
    Last edited by eymen-elkum; 11-18-2021, 12:39 PM.

    Leave a comment:


  • timarebel
    started a topic Increment ID in invoice/contract

    Increment ID in invoice/contract

    Hello

    I want to make an ID number where which contract has invoices and this invoices have ID incemented by 1
    how can I know the previous of each record invoice which below to that one contract.
Working...