Macro rules

merav tg asked on April 11, 2016 10:17

Hey,

I'm new with Macro rules.

I want to create a condition in the Macro rules that ask if today's date equal to the last modified date of the order + 7 days Meaning is today's date is a week after the last modified date of the order..

How do i write the + 7 days in K#? {_is}CurrentDateTime = Contact.ContactGlobalContact.Orders.LastItem.OrderLastModified + 7 days

thank you

Recent Answers


Petar Kozjak answered on April 11, 2016 11:22 (last edited on March 24, 2018 12:15)

Hi,

this code will return you correct days + 7: {% OnlineMarketingContext.CurrentContact.Orders.LastItem.OrderLastModified.AddDays(7) |(user)zbynekh|(hash)45fbadcfca032579ba6e777ec176a2aec7f1f9c51a0a94093acf1aca840b1015%}

And this code will compare current date with last modified + 7: {% if( DateTime.Now.Date == OnlineMarketingContext.CurrentContact.Orders.LastItem.OrderLastModified.AddDays(7).Date) {"Date is equal"} else {"Date Is not equal"} |(user)zbynekh|(hash)5622cd4f145cfa45d9082cbf530caf994a4f7aeaed638b639cbb49a6842465e1%}

4 votesVote for this answer Mark as a Correct answer

merav tg answered on April 11, 2016 16:37

Thank you

0 votesVote for this answer Mark as a Correct answer

Petar Kozjak answered on April 12, 2016 09:16

No problem just mark answer as correct so it is easier for other... do that on other questions also.. :)

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.