Skip 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.

Can't figure how to determine credit limit based on customer

Featured Replies

Hello,

I've been trying to figure out how to get my script (which determines whether a customer is within credit limit) to run based on the customer that is presently being selected for a new invoice. Even if it was a separate button that is selected to determine credit limit status, how can I get run determine a certain customer. Right now the way the script works is it always uses the first customer in the customer table, the script seems to work otherwise.

Code is below.

Any help would be GREATLY appreciated.

Thanks

Dave

Find [Over Credit Limit Invoices] Copy

Perform Script [ “Allow User Abort” ]

Perform Script [ “Set Error Capture” ]

Perform Script [ “Last Layout [store]” ]

Set Field [ QUOTES::KF_CUST_ID_q; QUOTES::KF_CUST_ID_q ]

Perform Find [ Specified Find Requests: Find Records; Criteria: INVOICES::Status: “Billed” ] [ Restore ]

Extend Found Set [ Specified Find Requests: Find Records; Criteria: INVOICES::Status: “Cancel” ] [ Restore ]

Set Variable [ $CreditLimit; Value:Sum(INVOICES::Price _Grand_Total) ]

Set Field [ QUOTES::testfield; $CreditLimit ]

#ABOVE FIELD IS JUST USED TO VIEW THE SUM OF THE INVOICES, USED FOR TESTING ONLY

Show All Records

If [ $CreditLimit ≥ CUSTOMERS::CreditLimit ]

Show Custom Dialog [ Title: "Account over Credit Limit"; Message: " ACCOUNT HAS REACHED IT'S CREDIT LIMIT!"; Buttons: “OK” ]

End If

Perform Script [ “Last Layout [Restore]” ]

Forgive me if this is not what you're looking for, but ...

I would set up a relationship in your Customer table showing all invoices (from Invoicing) with balance over 0 for that customer and a summary of those invoices. Then, when you go to make an invoice, test to see if that summary is over the CreditLimit.... if so, send back a dialog to halt or make the invoice anyway...or whatever... after the relationship, the script/coding is minimal...

Royce

  • Author

Royce,

I will take your advise and try that. Sounds like a good idea to me!

Thank you

Dave

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.