Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Replace Field Contents (reserialize) with variable

Featured Replies

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 ]

a variable that was declared via a custom dialogue box.

Users cannot enter data into a variable directly. But you can use a global field instead.

  • Author

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

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.

  • Author

Yes indeed that makes sense. thanks i will try it an let you know.

Dave

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.