Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4876 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Is there a way to have the starting value of the Replace field value - serial numbers be a variable that was declared via a custom dialogue box. I have a list of cheques that I need serialized. Between these sets say 50 cheques, other checks are used. Ie. Set 1 runs off at 1-50, 51, 52, 53 are given to three individual parties, then the next set is printed from 54-80. etc.

So i thought I would create the cheques then renumber them quickly via Replace with serials.

Here is what I have:

Go to Layout [ “Org. Cheque Listing” (SELECTDATES 2) ]

If [ Get ( FoundCount ) = 0 ]

New Record/Request

End If

Show Custom Dialog [ Title: "Check Number Input"; Message: "Enter first check number"; Buttons: “Cancel”, “OK”; Input #1: ORGCHEQUES 2::Chvariableflag, "First Cheque

Number" ]

If [ Get ( LastMessageChoice )=1 ]

Go to Layout [ “SESSION” (SESSION) ]

Exit Script [ ]

End If

Set Variable [ $c; Value:Get(FoundCount) ]

Set Variable [ $nser; Value:ORGCHEQUES 2::Chvariableflag ]

Set Next Serial Value [ ORGCHEQUES 2::ChequeNo; $nser ]

Go to Record/Request/Page

[ First ]

Loop

Set Variable [ $fid; Value:SELECTDATES 2::id_ORGANIZATION ]

Set Variable [ $Org; Value:ORGANIZATIONS 15::ORG_NAME ]

Set Variable [ $chqamt; Value:GetSummary (SELECTDATES 2::SUM_SHARECHOICE ;SELECTDATES 2::id_ORGANIZATION ) ]

Set Variable [ $csamt; Value:GetSummary (SELECTDATES 2::SUM_CASHSHORT ;SELECTDATES 2::id_ORGANIZATION ) ]

Set Variable [ $oopamt; Value:GetSummary (SELECTDATES 2::SUM_OOP ;SELECTDATES 2::id_ORGANIZATION ) ]

Set Variable [ $chqpay; Value:GetSummary (SELECTDATES 2::SUM_ORG_CHQ_PAYABLE ;SELECTDATES 2::id_ORGANIZATION ) ]

If [ $fid ≠ $ch_id ]

Go to Layout [ “ORGCHEQUES” (ORGCHEQUES 2) ]

New Record/Request

Set Field [ ORGCHEQUES 2::Amount; $chqamt ] Set Field [ ORGCHEQUES 2::Organization; $Org ] Set Field [ ORGCHEQUES 2::CashShort; $csamt ] Set Field [ ORGCHEQUES 2::OOP; $oopamt ]

Set Field [ ORGCHEQUES 2::ChqPayable; $chqpay ]

Go to Layout [ “Org. Cheque Listing” (SELECTDATES 2) ]

Go to Record/Request/Page

[ Next; Exit after last ]

End If

End Loop

Go to Layout [ “ORGCHEQUES” (ORGCHEQUES 2) ]

Go to Record/Request/Page

[ First ]

Set Variable [ $$ID; Value:ORGCHEQUES 2::Organization ]

Go to Record/Request/Page

[ Next ]

Loop

If [ ORGCHEQUES 2::Organization=$$ID ]

Delete Record/Request

[ No dialog ]

Else

Set Variable [ $$ID; Value:ORGCHEQUES 2::Organization ]

Go to Record/Request/Page

[ Next; Exit after last ]

End If

End Loop

Go to Layout [ original layout ]

Go to Record/Request/Page

[ First ]

Go to Field [ ORGCHEQUES 2::ChequeNo ]

Set Field [ ORGCHEQUES 2::ChequeNo; $ncn ]

Posted

I didn't put it directly into a variable. I put it in a variableflag (number field) then assigned it a variable:

Set Variable [ $nser; Value:ORGCHEQUES 2::Chvariableflag ]

All i need to do if it is possible. is Assign $nser to the starting value of replace field contents (reserialize) as that would be the starting cheque number

Dave

Posted

1. If you are using a global field, you don't need a variable.

2. You cannot use a field or a variable in the "Initial value" box of the Replace Field Contents dialog. You need to select "Replace with calculated result" and specify =

YourTable::gStartNumber - 1 + Get ( RecordNumber )

as the calculation.

This topic is 4876 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.