Laddawn.com : Programming Spec - MOD Item To Cart Validation

This new program will be called directly from the UI whenever a MOD item is being added to a cart (results/order history).  Its purpose is to do the following validations and to tell the UI if the validations passed or failed:

  1. Validate that the Quote isn't already in a cart.  This validation will only occur if QUOTE.NBR # "".
  2. Validate that the MOD Item# that this quote is associated with isn't already in the cart that they are adding to (ie, there are 2 active quotes for the MOD Item, and one of the quotes is already in this cart).

You will have the following named params available:

  • QUOTE.NBR (Quote#)
  • PART.NBR (MOD Item#)
  • CART.NAME (Cart that they are trying to add this quote to)
  • CONTACT.NBR (contact number)
  • BILLTO.NBR (billto customer#)

 

New LDLIB RPC$MODITEM_VALIDATETOCART (timeline 26-1): 

  1. SELECT all SHOPPINGCART.USR records for the BILLTO.NBR
  2. If you find the QUOTE.NBR in field 6 of any of the shopping cart records:
    1. Set ERROR.CODE = 1
    2. ERROR.MSG = "This has already been added to Cart ":cart name from shoppingcart.usr key
  3. If you find the MOD Item# (PART.NBR) in field 1 of the cart that they are trying to add this quote to (CONTACT.NBR:"*":CART.NAME - disregard any ce initials at the end of the key):
    1. Set ERROR.CODE = 2
    2. ERROR.MSG = "Made on Demand Item " : PART.NBR "is already in this cart"
  4. If you don't find any errors:
    1. Set ERROR.CODE = 0
    2. ERROR.MSG = ''
  5. Return ERROR.CODE and ERROR.MSG to UI in RETURN.VALUE