We have a utility program that creates a Return using eConnect (GP 8, eConnect 8.05). A return can affect one, and only one, Invoice at a time The net effect is that the Invoice is always cancelled out.
Here is how the utility currently works:
- User selects a posted Invoice document (SOPTYPE =3)
- Header, Line Item, Lot, Distribution and Tax information are copied from the Invoice into a dataset
- A new Return Number ID is retrieved from Great Plains
- the data retrieved in step two is updated to use the new Return Number ID and type information. In addition, the CSTPONBR field in the Header will contain the original Invoice Number (this is how we tie a Return document back to its Invoice)
- eConnect is called to create a Return document using the copied/updated data
This works fine, except that the Return seems to need its own Master Number. In other words, I cannot set the MSTRNUMB field for the Return document to match the Invoice. My guess is that GP doesn't consider Returns to be specific to a particular Invoice (which is what we need). However, I would still expect a Return to be part of a Contract, and the only way to do this is by using the same Master Number.
Any ideas? I could always make a SQL call and immediately update the Master Number of the new Return document, but I'd like to set it through eConnect if possible.