You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Groovy Scripting : Set Attribute of Custom Field Based on the Value of Standard Field

edited Oct 10, 2024 10:56AM in Sales 8 comments

In relation to my previous inquiry Groovy Scripting: Split / Trim, I have made it work. However, since formula text field cannot be displayed to OTBI analysis report, I am finding another way to show it to the report. I have created another custom text field and created a field trigger, but it is not working.

Trigger: After Field Changed

Field Name: Email

Script:

def position = Email.indexOf("@")

def email = Email.substring(0,position)

def CustomField = CustomField_c

if (ResourceOrgRoleName.contains('<role>')) {

setAttribute(CustomField, email)}

else null

The field has still no value. What might be possibly wrong or missing with the script? Or should it be an object trigger?

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!