Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics RMS (Archived)

Calculate Custom Date on Receipt

(0) ShareShare
ReportReport
Posted on by 85

I'm trying to calculate a custom date on the receipt for use with a coupon. ex: "Coupon valid until  MM/DD/YYYY".

Transaction.Date + 7 doesn't work.

Anyone know how to accomplish this in XML?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calculate Custom Date on Receipt

    were you able to get to the bottom of this ?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calculate Custom Date on Receipt

    try to wrap the date in CDate.  like so:   CDate(Transaction.Date + no of days).

    I havent tested this, but this is how vb and vba convert strings to dates.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calculate Custom Date on Receipt

    Hi Antonijo Todorovik Dimiskov,

    I have tried to simply do Transaction.Date + no of days and it half works but it isn't formatted as a date.

    E.g TodaysDate + 30 is displaying 42256 which if you do this in Excel and copy the date to a text field you get the same number, is there a way to format this back to a Date within the Receipt?

    Many Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calculate Custom Date on Receipt

    Hi Antonijo

    Yes this is exchange date calculated from the transaction date as mention on the first post.

    We need show the exchange date as 30 days from transaction date in the receipt.

  • Suggested answer
    Antonijo Todorovik Profile Picture
    Antonijo Todorovik 4,025 on at
    RE: Calculate Custom Date on Receipt

    Can you be more specific, please? Is this Exchange date an exact date caluclated from the transaction date?? Is it only descriptive information or something more?

    Regards, A.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calculate Custom Date on Receipt

    Hi ,

    Has anyone able to achieve this without creating a session variable?

    We have a requirement to add Exchange date in the receipt

    Thanks

  • Antonijo Todorovik Profile Picture
    Antonijo Todorovik 4,025 on at
    RE: Calculate Custom Date on Receipt

    Hi Sportsman,

    You can try two things:

    - first, try defining a varibale with the <SET> function, something like

    "<SET name="Var1" type="VbDateTime"></SET> Then when using the variable You can try what You say

    <SET name="Var1" type="VbDateTime"> Transaction.Date + 7 </SET> or

    <SET name="Var1" type="VbDateTime"> Transaction.Date & 7 </SET> or similar ... , but not sure if it will work...

    - second option, this I know it works, as I have done it before, is to use one of the 10 Session Variables. You need to develop a small DLL, that will be hooked up just before posting the transaction. The DLL could be developed in Visual Studio as a COM object, you can just add 7 days to a Transaction.Date into a new variable that You assign to the Session Variable that You print out on the receipt....

    Contact me if You need help, regards, A.

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans