RE: Trying to add SOP number to Customer Statement
Hi Len,
This is going to be a tough one. The RM Open is probably your best bet as there is a link to the Customer number, document number.
The Documents that POST in SOP are and Invoice and Return. Those values are as such in the SOP module/tables.
- 3 in SOP is an invoice
- 4 in SOP is a return.
IN RM they are as follows:
- 1 in RM is an invoice
- 8 in RM is a Return
However, as you know the SOP the Order is a 2 in the SOP tables and there is no equivalent to that in RM. That is because an Order is just a document that lists out what the customer is intending to purchase from your company. It's not posted. It is at some point transferred into an Invoice in SOP. It's the Invoice that is posted in SOP that goes over to RM and creates an RM Invoice. So, you are trying to get that Order number from that Invoice to print.
NOTE: Only Invoices and Returns in SOP post. So that is why there is both types in SOP and RM. They just have different values in their respective tables.
And the only thing that really provides the link in SOP between the SOP Order and the SOP invoice is the MASTER NUMBER which is in the SOP header table. (SOP10100/SOP30200). However, if there is one field that gets populated on the Invoice which tells you which order it came from. That is the Original number. It should be populated with the order number itself and you should be able to pull that field right out onto the report. So I did some testing and finally was able to get this to work. Give this a try.
1: Create a relationship that links the RM_Statements_TRX_TEMP file to the RM Open file
1.
|
Click on the Tables in the top menu-bar, and then click Tables .
Note Do not click Tables in the Report Definition window.
|
2.
|
In the Tables window, click RM_Statements_TRX_TEMP , and then click Open .
|
3.
|
In the Table Definition window, click Relationships . (The RM Open File is listed.)
|
4.
|
In the Table Relationship window, click New .
|
5.
|
In the Table Relationship Definition window, click the ellipsis button [...] next to the Secondary Table field.
|
6.
|
In the Relationship Table Lookup window, click RM Open File , and then click OK .
|
7.
|
In the Secondary Table Key list, click RM_OPEN_Key1 .
Note This value is the first value that appears in this list.
|
8.
|
Match the appropriate fields: •RM Statements Transactions Temp - Customer Number = RM Open File - Customer Number •RM Statements Transactions Temp - RM Document Type-All = RM Open File - RM Document Type-All •RM Statements Transactions Temp - Document Number = RM Open File - Document Number
|
9.
|
Click OK to close the Table Relationship Definition window.
|
10.
|
Exit out of the Table Relationship window. (The RM Open File is listed twice.)
|
11.
|
Click OK to close the Table Definition window.
|
12.
|
Leave the Tables window open.
|
Step 2: Create a relationship that links the RM Open file to the Sales Transaction History file
1.
|
In the Tables window, click RM_OPEN , and then click Open .
|
2.
|
In the Table Definition window, click Relationships .
|
3.
|
In the Table Relationship window, click New .
|
4.
|
In the Table Relationship Definition window, click the ellipsis button [...] next to the Secondary Table box.
|
5.
|
In the Relationship Table Lookup window, click Sales Transaction History , and then click OK .
|
6.
|
In the Secondary Table Key list, click SOP_HDR_HIST_Key1 .
|
7.
|
Match the appropriate fields: For the primary table, select Document Number , and the secondary table will display the SOP number. Do not match the SOP type to any primary table. The link should be as follows:
• RM Open File - Document Number = Sales Transaction History - SOP Number • <blank> = Sales Transaction History - SOP Type
Note The SOP type on the left-hand side should be left blank. This is key to getting this to work. If you fill this in it will not work.
|
8.
|
Click OK to close the Table Relationship Definition window.
|
9.
|
Exit the Table Relationship window.
|
10.
|
Click OK to close the Table Definition window.
|
Next go into the Layout and from the Sales Transaction History table pull out the Original Number field into the Body of the report and save the changes. Once you give the GP access to the modified report, the Order number linked to the Invoice should print. Hopefully it works for you.
Thank you for using Microsoft Dynamics Communities,
Angela Ebensteiner
Sr Technical Advisor
Microsoft Dynamics GP