MOD Item Nbr to Quote Xref
8/16/13
As part of the RPC$MODITEM_CREATE program after a new quote is created, we need to add the following logic:
- For new MOD Items, assign a MOD Item Nbr and create the contact/item xref record. Link the Quote to the MOD Item Nbr.
- For existing MOD Items, link the newly created Quote Nbr to the MOD Item Nbr
The website will pass in STATUS one of the following:
1 = New Quote and New MOD Item (create a new quote and assign a new configuration# with revision nbr 0)
2 = New Quote and Existing MOD Item (create a new quote and use existing configuration# - increment revision nbr). Existing MOD Item# will be passed in the PART.NBR field from web
3 = Change to an Existing Quote *** not included in this design
#1 – Assign the new MOD Item Number (STATUS = 1):
After the quote has been created:
- Get the next sequential MOD Item Nbr from counter in SYSCTL for file CONTACT.ITEM.XRF.USR. Use the global program SYSS0008.1, which will get the next sequential number for file CONTACT.ITEM.XRF.USR. In order to do this, you will need to set this file up in SYSFILES (using SYS3002). Please define the 9 existing fields in this file, as well as the 2 new fields 10 and 11 detailed below. Before calling SYSS0008.1, set:
- SAVE.KEY=KEY
- KEY = 'NEW'
- PARAM=''
- PARAM<1> = 1
- PARAM<2> = 'CONTACT.ITEM.XRF.USR'
The next sequential number will be returned in KEY.
- Create the CONTACT.ITEM.XRF.USR record:
Key = COMPANY.ID:"":CONTACT.NBR:"":"MOD":KEY
<1> = Tag ID's (leave blank)
<2> = Tag ID's (leave blank)
<3> = DATE()
<4> = "M"
<5> = SHOP.WIDTH
<6> = SHOP.DEPTH
<7> = SHOP.LENGTH
<8> = SHOP.GAUGE
<9> = Shared ID (leave blank)
<10> = Customer Part Nbr – leave blank (this is a new single-valued field – define as 20 A/N)
<11> = Quote Nbr (this is a new multi-valued field – defined as 8N)
- Write MOD Item Nbr to a new field in QUHDR.USR<24>. Define this field in dictionary and SYS3002.
- Return the MOD Item Nbr to the web via PART.NBR variable
#2 – Link newly created quote to existing MOD item (STATUS = 2):
After the quote has been created:
- Using the existing MOD Item Nbr in PART.NBR variable, lock and read the CONTACT.ITEM.XRF.USR record Company*Contact*MOD Item Nbr
- Insert the new quote nbr in CONTACT.ITEM.XRF.USR<11> as the first multi-value
- Write the MOD Item Nbr to QUHDR.USR<24>