Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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

  • RE: Calculate Custom Date on Receipt

    were you able to get to the bottom of this ?

  • Suggested answer
    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.

  • 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

  • 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.

  • 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans