Last Order Number

Have you ever wanted to look at the last order a customer placed? When you’re placing a new order, or on the Business Partner screen, we can place a User Defined Field to hold the number. A simple script will update the number when we reference the document.

  1. Create a standard 10 character User Defined Field.
  2. Using the Query Generator, create a script:
    SELECT MAX(DocNum) FROM ORDR WHERE CardCode = $[$4.0.0] AND CANCELED = ‘N’
  3. Save the script and apply it to the UDF as a Formatted Search, updating when the BP Code is changed.