Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Update or not Time() in a PDF FormCalc?

Avatar

Level 1

I would like to use Time() in an object (Invoice Number) to generate a number, but every time I open a "saved" pdf, the Invoice number changes or Updates because the Time(). This is normal. I have been trying to insert an if statement to test the object and insert Time() if the object is empty (new Invoice) or not (not empty) as when the invoice is stored to record a sale.

This is my guess but does not work!

 

<script>if (txtInvoiceNum eq Null) then (txtInvoiceNum = Time()) end if

Please help!

1 Reply

Avatar

Level 7

you do not need the brackets after the 'then' and also 'endif' is one word in formcalc.

if (txtInvoiceNum.isNull) then

txtInvoiceNum = Time()

endif

should work.