SCRIPT SAMPLE: Making Quote Fields Mandatory
  • COBS Tech Support
    Posts: 678
    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
    aRequired := { "REFERENCE", "EMAIL", "ORDEREDBY", "QREF1", "PROMO", "ORIGIN", "CATEGORY", "PRIORITY" }
    aError    := { "Order Number", "Email Address", "Ordered By", "Area", "Promotional Code", "Origin Code", "Category", "Priority Level" }

    :Loop
       If nCount > Len(aRequired)
          Return TRUE
       Endif

       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
       Endif

       nCount := nCount + 1
       Goto Loop

Who is online

Users browsing this forum: No registered users and 1 guest