It's all about the answers!

Ask a question

Using script based attribute customization in RTC

Uma venkata Lekkala (52419) | asked May 07 '15, 7:44 p.m.
 What is the syntax for this scenario

IF RestrictedAccess field is "A-Department1" 
set Customer field value = "A" and Department field value = "Department1"

Or the following
IF Customer field value = "A" and Department field value = "Department1"
RestrictedAccess field drop down options are narrowed down to ...

Donald Nong commented May 08 '15, 12:06 a.m.

Do you want to achieve both at the same time? It appears that the operation is mirrored, I am afraid that it may cause an infinite loop in your code.

Uma venkata Lekkala commented May 08 '15, 1:31 a.m.

  No either the first three OR the last three lines in my post. 

2 answers

permanent link
Donald Nong (14.5k414) | answered May 08 '15, 2:40 a.m.
edited May 08 '15, 2:41 a.m.
For the first scenario, you will need to set "RestrictedAccess" as the dependency of both "Customer" and "Department", add a "Calculated Value" script to both "Customer" and "Department". In the script, you will read the value of "RestrictedAccess", and if it satisfies certain condition, set the value of  "Customer" or "Department" accordingly.

The second scenario is similar, you just swap the position of "RestrictedAccess" and ["Customer" and "Department"]. And you may need to use a "Value Sets" script instead as you talked about a "drop down".

Uma venkata Lekkala commented May 08 '15, 12:10 p.m.

 Yeah, but I need the syntax. I coded in VB and pearl a lotin CQ hook customizations. I am at ground zero in RTC coding though I know the logical conditions.

Get value from Restrictedacces field and if it "A-Electrical" then set Customer = "A" and Engineering Dept="Electrical" but is there a code example for the above scenario to work?

Donald Nong commented May 11 '15, 2:45 a.m.

The client side attribute customization is done in JavaScript. You can find plenty of samples on

permanent link
Ralph Schoon (62.3k33643) | answered May 11 '15, 2:58 a.m.

Your answer

Register or to post your answer.