You need to sign in to do that
Don't have an account?
michael_mcmahon
if statement controller help, simple
A custom object, Data with three custom fields, Baseline, Change, and Proj
I'm trying to write: If (change = blank, proj = baseline , else proj = baseline + (baseline * change)
Here's my code but it's not working and I could use some help correcting it:
public class ROI_Calc{ public static Integer calculateROI (data__c.lifetime_orders_projected__c v) { if (lifetime_order_value_change_proj__c == '') { v = lifetime_order_value_baseline__c; } {v = lifetime_order_value_baseline__c * lifetime_order_value_change_proj__c + lifetime_order_value_baseline__c; } } }
Hi Michael,
Try the following:
Please note that, the parameter v is of type object Data__c. In addition, i have added the else as well.
All Answers
Hi Michael,
Try the following:
Please note that, the parameter v is of type object Data__c. In addition, i have added the else as well.
Ah, thank you very much.
I have to build at least ten of these, so it ocurred to me to make it simpler to change out the formulae I could use something like
but I can't figure out how to do this in Force.com. I swear I have looked for at least an hour, and have tried all kinds of variations including declaring an Integer which also didn't work. Any chance you could help me out with one more line of code?
thanks a lot, Michael