Due Date BPM

Hello I am trying to make a BPM that when the PO suggestion is marked as buy it will change the due date to 14 days from today I know usually this uses conventional lead times however this is intercompany stock movement designed to suggest we order internally if there is sufficient stock in our european depot

What issue are you running into?

Hello just trying to work out what expression i need to use inside the set field condition for it to be today + 14 days

Try:

BpmFunc.AddInterval(BpmFunc.Now(),14,IntervalUnit.Days)

Some of the better programmers will probably suggest something like DateDiff() and GetDate() but I don’t get a syntax error on the above code so
Kristen Bell Idk GIF by Team Coco

1 Like

If you don’t get a syntax error, are you really programming?

3 Likes

I am not saying this is wrong. I get syntax error using this expression. Might be a version thing? Not sure.

But here is what it is working for me:

BpmFunc.AddInterval(BpmFunc.Today(), TimeSpan.FromDays(14))

Perfect it works thank you :smiley:

Sliding in with a suggestion…
There is an AddDays method in C#. Used with Epicor’s BpmFunc.Today():

BpmFunc.Today().AddDays(14)

I like to use human-readable code, when possible.

6 Likes