- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 09:41 AM
Hello Everyone
I wasn't able to accomplish a business rule to calculate 11 currency fields so I create to subtotals for each column. I was able to get this to work.
Now I am trying to create a BR to calculate the two subtotals and my Condition or Code is not working. Can someone please?
thanks
Denee
____________________________________________________
I have a form that has 11 currency fields, that I need to get the the total when saved/Updated or submitted.
I am struggling with the condition. My current Business Rule
Thanks for all your help. I will make sure i mark your advice as helpful or correct if you can help me solve this problem.
Denee
Message was edited by: Denee Harris
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2017 08:52 AM
Your script looks okay to me - are these all configured to run "before"? You could have an ordering problem where "Calculate Total TCO" is running before those other fields are themselves calculated.
There's an easy way to trace this down if you add some debug statements to your business rules. You should use gs.debug("Debug message here") in all 3 business rules to print the field values and the calculation result. Adding the debug logs makes it very easy to see what the business rule has actually done when you are debugging.
Add some debug statements to all of these business rules and enable the debug logging and business rule debugging tools via System Diagnostics > Session Debug > Debug Log, and System Diagnostics > Session Debug > Debug Business Rule.
After you do this, change some values on your form, save it, and look at the output at the bottom of the page. The debugging logs will stand out with [DEBUG]. You need to read these logs and see how these rules are flowing, and verify the order they are running in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 10:31 AM
Hi Denee,
In the beginning of your script, can you please put a gs.log('TEST CALCULATION') and check the logs if it prints normally?
Also, is there any error in the log?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 11:07 AM
Hello Rafael
It looks like the BR is not running in the logs.
I think its because of the condition. Any thoughts
thanks
Denee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 11:19 AM
Could you please post a print of your BR's "When to run" tab?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2017 07:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2017 04:56 AM
Denee,
Instead of "after" (when clause), please select "before". As your script does not have an current.update after its execution it will not update the value. Please let me know if your BR works now.
Thanks,