Hi all i have a workflow that is designed to look ...
# general
n
Hi all i have a workflow that is designed to look for sales order lines that meet specific criteria, one being that the expected ship date is the last day of the current month, I can get this criteria ok in a search. I am using a scheduled workflow with a sublist action group and i only want it to update lines where the expected ship date is the last day of the current month and push out by 1 month (so if there is a line that says 31/08/2024 this should go to 30/09/2024 and if a line says 31/10/2024 it should go to 31/11/2024 I need a formula to apply the logic but i cant quite work it out.
m
Use ADD_MONTHS({shipdate},1)
n
the issue is if there is a line that is not the last day of the month it picks it up and even though my search has these lines excluded i have to also exclude them int he criteria on the workflow or it picks them up.
m
CASE WHEN LAST_DAY({shipdate}) = {shipdate} THEN 1 ELSE 0 END = 1
Use this as a custom formula in your condition
n
i will try this shortly
thanks Alan
m
Also you may need to update the formula for your date calculation. I don't remember if ADD_MONTHS will just change the month to the next one, or if it will attempt to validate the new month comparison. (I'm not sure if adding 1 month to 3/31/2024, will try to set the date as 4/31/2024, which does not exist). If you get an error you can also try this LAST_DAY({shipdate} + 1)....essentially just add any number to the ship date to get it to roll into the next month (so 1 or 5 or 10 or something), then use the LAST_DAY funciton to get that last day of that new month. This should fix any errors and give you the last day of the next month
n
Thanks heaps Alan i will try this tomorrow as i am going to run out of time today i think
m
Np have a great night👍