This topic contains 8 replies, has 0 voices, and was last updated by GAJ 8 years, 7 months ago.
-
AuthorPosts
-
April 4, 2016 at 9:59 pm #2831
GAJWe’ve the need to access the {total} field value from within the header of a Quote/Estimate form.
I’ve created a custom body field with Validation & Defaulting, Formula = Y.
I added the field to the form in the Main, Primary Information section.
Even with Validation & Defaulting set to just {total}, blank is returned.
Ultimately, we need to execute something like this:
(CODE)
CASE {total}
WHEN > 110000.00 THEN {total} * .02029
…
END
(/CODE)
What is the proper syntax to use to access the {total} field in the header of a Quote/Estimate form?
This is a cached copy. Click here to see the original post. -
April 4, 2016 at 11:07 pm #2832
k_duncHi GAJ, have you turned off (un-checked) the Store Value checkbox?
-
April 5, 2016 at 1:15 am #2833
GAJGood, i.e. I understand your question. Yes, it is off. Thanks.
-
April 5, 2016 at 3:14 am #2834
k_duncGreat. So did that fix your issue though?
-
April 5, 2016 at 8:21 am #2835
NelliottYou might be better off, since you want to apply logic to this, using a script, maybe a client post sourcing function or maybe a user event before submit / before load, depending on when you’re expecting the field to populate.
Maybe try:
Code:
CASE
WHEN {total}> 110000.00 THEN ({total} * .02029)
WHEN {total}< 110000.00 THEN ({total} * .02030)
ELSE 'some_other_catch_all' END
Though I don't write formula regularly your code looks like a mashup of sql / javascript to me -
April 5, 2016 at 5:47 pm #2836
GAJHi k_dunc, the Store Value was never turned on. I did have to go back and double check though.
Hi Nelliott, the syntax of the CASE statement works both ways, though you might have something there with the parentheses.
The CASE statement would be in the Validation & Defaulting Formula field in the Custom Body field.
Similar logic works just fine, so scripting
The problem is that even with a simple {total} entry there, ie. no CASE statement, a logic that works also when accessing many other native NS fields,
this one doesn’t.
This custom body field is placed right in the Primary Information section of the form… whose Total value is physically right next to it. Logically, it should be accessible as well. But it is not with the simple syntax {total}.
-
April 5, 2016 at 7:39 pm #2837
michoelWeird, this works fine when I try it..
What type of custom field are you using?
Also, I’ve had trouble with the CASE (expr) WHEN (comparison_expr).. syntax. I’ve found CASE WHEN (expr) works more consistently.
-
April 6, 2016 at 2:58 am #2838
NelliottYeah, I just tried the same thing, what are you defining the field as?
I used “Decimal Number”?
See the screens I attached
-
April 6, 2016 at 7:57 pm #2839
GAJMy BAD… I DID have Store Value checked! Argh! Unchecking, and following the advice herein, it works very nicely.
Client wants to calculate and display monthly costs in a custom field in the Main header in the form based on the Quote total. The solution CASE statement is:
CASE
WHEN {total} > 110000.00 THEN {total}*.05
WHEN {total} > 60000.00 THEN {total}*.06
WHEN {total} >= 30000.00 THEN {total}*.07
END
Many thanks to all of you for taking your valuable time to help here. I really must pay it forward.
michoel replied on 04/06/2016, 09:09 PM: Great to hear you worked it out. The syntax for code tags is [*CODE] [*/CODE] (without the *)
-
AuthorPosts
You must be logged in to reply to this topic.