I have created a quantity field for a sample quantity within an opportunity. I would like this field to be automatically filled with the word "standard" if no quantity is entered. How can I do that?
Thank you very much!!
Tim
I have created a quantity field for a sample quantity within an opportunity. I would like this field to be automatically filled with the word "standard" if no quantity is entered. How can I do that?
Thank you very much!!
Tim
You may have a problem with the data type, a quantity is a number, usually an integer, while the word "standard" is not a number at all.
I assume you want to use "standard" because it's not really a set number but rather it's dependent on the product or other parameter in your Opportunity
As always there are multiple ways you could address this, I can think of four:
Personally, I would go for #2 to have improved reporting and actual quantities assuming you have logic to decide what "standard" means. The before save will trigger regardless of the view, so you are covered wherever they can edit those values. I would even take it a step further adding a "standard sample quantity" to the product catalog (assuming it's product you are going by) so you can do a lookup to populate the standard quantity instead of hardcoding product in your controller logic.
FrancescaS
(apologies for the many edits on this post, ideas came as I re-read after posting...)
You may have a problem with the data type, a quantity is a number, usually an integer, while the word "standard" is not a number at all.
I assume you want to use "standard" because it's not really a set number but rather it's dependent on the product or other parameter in your Opportunity
As always there are multiple ways you could address this, I can think of four:
Personally, I would go for #2 to have improved reporting and actual quantities assuming you have logic to decide what "standard" means. The before save will trigger regardless of the view, so you are covered wherever they can edit those values. I would even take it a step further adding a "standard sample quantity" to the product catalog (assuming it's product you are going by) so you can do a lookup to populate the standard quantity instead of hardcoding product in your controller logic.
FrancescaS
(apologies for the many edits on this post, ideas came as I re-read after posting...)
Tim Hoffmann Francesca lays out a good set of suggestions on how to approach your problem. One additional option to consider is the following:
ifElse( equal( $quantity, "" ), "Standard", "Non-Standard" )
The benefits of this option include:
Chris