RE: Get the selected sales transaction from the GetReceiptEmailAddressClientRequestHandler from Show Journal
Hi Shahil,
Based on your code and your notes, I believe what you're trying to do is this:
- Allow the POS to prompt for the email address
- After user completes that prompt, open a new prompt to ask for another value
- Store that value to an Extension Property
- Have that value saved in the sales transaction
The problem when going through this process through Show Journal, there isn't a current Cart/Transaction in MPOS. In fact, if you have a current cart open in MPOS you can't even get to the screen to print or email a reprinted receipt.
Taking a look at the _sendReceiptEmailAsync in the POS code, the client queues up these requests:
- GetCustomerReceiptEmailAddressClientRequest
- SendReceiptServiceRequest
The second one is the actual call to the CRT. That code doesn't rely on a current Cart in the POS - all that gets sent to the Retail Server is a) an email address and b) a search criteria (basically the string of the requested Transaction ID).
Once Retail Server gets ahold of that request (/SalesOrders/SendReceipt) all it does is run through the receipt printing code to generate and send the email. Again, since there is no Cart / Transaction at this point, there is nothing that the Extension Property can tag along with to get to the CRT to do anything with. Even if there were, you wouldn't be able to save it to that Transaction ID because you can never go back and add information to existing transactions.
So I don't really see a way to do what you want from the Show Journal receipt emailer.
Let me know if I don't quite understand the process you're looking to accomplish.
Thanks,
Shane