You need to sign in to do that
Don't have an account?
Jacqueline Doan
Strange formula issue in flow: if statement returning null values
I'm working in Visual Workflow. I'm trying to generate a date via formula using an if function. My 'then' and 'else' statements are virtually the same, varying only by adding one month to a calculated date.
However, when my formula returns true on my 'if' statement, the 'then' statement gives me the correct date. When my formula fails my 'if' statement, the 'else' statement is blank.
Here is my formula:
IF(
{!NextPaymentDue}-{!SelectedCharge}<=0,
DATE(YEAR({!NextDueDate}),MONTH({!NextDueDate})+({!Days}/30)+1,DAY({!NextDueDate})+MOD({!Days},30)),
DATE(YEAR({!NextDueDate}),MONTH({!NextDueDate})+({!Days}/30),DAY({!NextDueDate})+MOD({!Days},30))
)
Successfully generates a date of 11/1/2014 when:
nextPaymentDue= 100
SelectedCharge = 150
Days=30
Next Due Date = 9/1/2014
Returns null when:
nextPaymentDue= 300
SelectedCharge = 150
Days=30
Next Due Date = 9/1/2014
Any ideas?
However, when my formula returns true on my 'if' statement, the 'then' statement gives me the correct date. When my formula fails my 'if' statement, the 'else' statement is blank.
Here is my formula:
IF(
{!NextPaymentDue}-{!SelectedCharge}<=0,
DATE(YEAR({!NextDueDate}),MONTH({!NextDueDate})+({!Days}/30)+1,DAY({!NextDueDate})+MOD({!Days},30)),
DATE(YEAR({!NextDueDate}),MONTH({!NextDueDate})+({!Days}/30),DAY({!NextDueDate})+MOD({!Days},30))
)
Successfully generates a date of 11/1/2014 when:
nextPaymentDue= 100
SelectedCharge = 150
Days=30
Next Due Date = 9/1/2014
Returns null when:
nextPaymentDue= 300
SelectedCharge = 150
Days=30
Next Due Date = 9/1/2014
Any ideas?
I have gone through your code and it appears strange to me as well.
what you could do is try
IF(
{!NextPaymentDue}-{!SelectedCharge}<=0,
DATE(YEAR({!NextDueDate}),MONTH({!NextDueDate})+({!Days}/30)+1,DAY({!NextDueDate})+MOD({!Days},30)),
DATE(YEAR({!NextDueDate}),MONTH({!NextDueDate})+({!Days}/30)+0,DAY({!NextDueDate})+MOD({!Days},30))
)
I have just added +0 in else clause.
Thanks!