Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Unanswered

Get the selected sales transaction from the GetReceiptEmailAddressClientRequestHandler from Show Journal

Posted on by 635

Is there a way to get the selected sales transaction from the GetReceiptEmailAddressClientRequestHandler. I have a requirement to save a property on the salestransaction.

Requirement: When in cart once the user a enters the email. Display a custom dialog for input. Save it on the sales transaction. This should also work from show journal > show receipt > send receipt - user enters email address, a custom dialog is displayed

 

If I go from the cart, I have access to the cart and I can add my commerce property on the cart entity and retrieve it in crt and save it on sales transaction.

But If I go from show journal I have no reference to the selected transaction. Any ideas around this. I have attached the code for going through the cart... how to achieve this from the show journal > show receipt > send receipt

2021_2D00_01_2D00_06_5F00_13_2D00_05_2D00_39.png

  • 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

  • ToddB Profile Picture
    ToddB on at
    RE: Get the selected sales transaction from the GetReceiptEmailAddressClientRequestHandler from Show Journal

    Hi Shahil,

    I am checking to see what I can find in regard to this.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans