The web service offering for Dynamics GP has a call to CreateSalesInvoice. The problem I'm running into is the call returns void so I don't actually get the sales invoice object after completing the call. I can see the invoice is created in the database and assigned an Id (Key).
From my application I am passing in the values to create the sales invoice and then I want to capture the Id so I can then process a payment against our payment gateway. I want this to all be handled in code. It doesn't seem reasonable to produce a list of invoices by customerId after the user just created the invoice and then have them select the newly created invoice and then process the payment.
Is there a way to get the id after the create method call?
To my knowledge the value is not returned via the web service in GP (it's really not a great web service). Since the SOPNUMBE column is the key, your best bet is to generate it in your source, then you know the value when you pass it to GP. You will need to talk to your GP team or review the settings in GP as SOPNUMBE has a 15 CHAR limit. They may want you to configure the number in a specific way like "INV000001".
There is an "ID" field in most GP tables called "DEX_ROW_ID", which is completely useless for 99% of applications as it relates to nothing. Keep in mind that value is not useful to you at all here. You want to use SOPNUMBE and SOPTYPE.
Victoria Yudin's site is extremely helpful in navigating the archaic GP architecture.