web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics RMS (Archived)

Urgent Help Please...!! Set discount reason code from add in

(0) ShareShare
ReportReport
Posted on by 106

Dear RMS Pros,

I got stuck while set discount reason code on currententry, I've tried the following

QSRules.Transaction.Entries(EntryKey).SetDiscountReasonCode = 63

QSRules.Transaction.Entries(EntryKey).DiscountReasonCode.ReasonCode = RC //RC is reasoncode object

QSRules.Transaction.Entries(EntryKey).DiscountReasonCode.ReasonCode.ID = RC.ID

but somehow it is not able to set discount reason code at EntryKey

Please help.

*This post is locked for comments

I have the same question (0)
  • Michael Marmah Profile Picture
    1,511 on at

    Hi Aedeel,

    Which version of RMS  are you working with

    I dont really get what you are trying to achieve but just looking at your code snippet you can try this

    
    
    QSRules.Transaction.Entries(EntryKey).DiscountReasonCode = 63
    
    QSRules.Transaction.Entries(EntryKey).DiscountReasonCode = RC //RC is reasoncode object
    
    QSRules.Transaction.Entries(EntryKey).DiscountReasonCode.ID = RC.ID
  • Aadeel S. Puri Profile Picture
    106 on at

    Dear i am using 2.0.2022,

    I am developing HTML Add-In that controls transaction grid at POS, I need to apply discount by percentage on single entry from add in which i have succeed but now i also need to set discount reason code from add in as well on that particular entry item.

    Above shared snippet is the variation in the code I've tried to set discount reason code as per customization guide. but still it is not able to set discount reason code.

  • Nishaan Profile Picture
    35 on at

    Hi Aadeel , 

    Did you come right with this?

    I am also having issues to get this right.

    Kind Regards

    Nishaan

  • Aadeel S. Puri Profile Picture
    106 on at

    Above snippet is for javascript code in HTML Addin. Are you making Add-In in VB?

  • Nishaan Profile Picture
    35 on at

    Hi Aadeel

    I am making a Add In with HTML and Javascript.  I have tried alot of combinations to get this to work. But still struggling.

    Will you be able to send me some snippets ?

    Kind Regards

    Nishaan

  • Verified answer
    Nishaan Profile Picture
    35 on at

    For anyone else having this issue , You need to run the below code then refreash the display

    QSRules.Transaction.Entries(1).DiscountReasonCode=QSRules.ReasonCodes(28);
    qsBridge.FireEvent("RefreshDisplay");

  • Aadeel S. Puri Profile Picture
    106 on at

    Yes i have a lot of snippets written on Javascript. Do you required something specific?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics RMS (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans