SCRIPT SAMPLE: Making Quote Fields Mandatory
  • COBS Tech Support
    Posts: 681
    Joined: Fri Sep 09, 2005 8:23 am

    SCRIPT SAMPLE: Making Quote Fields Mandatory

    by COBS Tech Support » Thu Sep 14, 2017 3:39 pm

    Here is a sample script that demonstrates how to make certain selected quote fields mandatory fields:

    Code: Select all

    * COBS, 14/09/2017
    * Specify Mandatory Fields when saving quotes
    Declare cField Type Character
    Declare aRequired Type Array
    Declare aError    Type Array
    Declare nCount Type Number

    nCount    := 1
    aError    := { "Order Number", "Email Address", "Ordered By", "Area", "Promotional Code", "Origin Code", "Category", "Priority Level" }

       If nCount > Len(aRequired)
          Return TRUE

       cField := ReadTranValue(aRequired[nCount])

       If IsEmpty(cField)
          EchoWarn("Sorry, the input field '" + aError[nCount] + "' cannot be left blank. Please assign it a value before proceeding.")
          Return FALSE

       nCount := nCount + 1
       Goto Loop

Who is online

Users browsing this forum: No registered users and 1 guest