- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 12:06 PM
I want to count number of characters entered in a string field.
Divide the total number of characters by 3.5 and store it in an Integer field.
I created a business rule in update/insert. I'm stuck on writing script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 02:11 PM
Hey Mate,
One minor observation, you have multiplied by 3.5 while the question asked for Division
So the script changes to
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var noChars = current.string_field_name.length;
var multipleVar = noChars / 3.5;
gs.info("myBusinessRule: multipeVar = " + multipleVar);
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 05:12 AM
Great Ram,
You should mark Bert's Reply as correct too, You can mark multiple replies as correct.
We both spent time in helping you.
Cheers