Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom object for setting value list of type people and group

SonamSingla
Contributor III

I am trying to set field A value which is of type value list and getting values fro User Group.

Field A = User A, User B, User C, User D from some GroupBasedOnRole

 

Now based on some condition need to set value of field A to 

if field B = ABC then field A should be set to User A

if field B = XYZ then field A should be set to User B

 

In case i use this code 

<script>
var integration = {
fieldID:"16179",
valueID:"240",
};
var valueArray = new Array(1);
valueArray[0] = integration.valueID;
ArcherTech.UI.GenericContent.GetInstance().setFieldValue(integration.fieldID, valueArray, '');
</script>

How can i get value ID for that particular user.

pastedImage_1.png

53 REPLIES 53

Ileya it is showing correctly now but not saving.

pastedImage_1.png

You probably have some restrictions defined for Incident Coordinator RP field. Like you allow only Coordinators. Try to make it temporary to be All Users.

Hi Ileya,

 

I made this change included everyone, it is saving blank still.

 

 

pastedImage_1.png

You may have some Rules defined. I recommend to create new RP and test it with it. Ofc you need to change fieldId in the script.

Did everything but no success..created new field from scratch added everyone..added value..it is displaying correctly again..but not saving on click of save button.

Well, I just tested the script in my own environment. It works fine. 

I recommend to initiate setRecordPermission NOT during the load, but per some button click. And test it. Otherwise, have no idea as user id is correct.

Hi Ileya ,

 

Thanks for your help..will see some other alternative..it is still not working.. Please let me know one more thing am using script in shift handover but it is not  working..is it something like that it works only in Security incidents application.

Script is not application specific. It will work in any application.

What could be the reason as i have just typed 

<script type="text/javascript">
Sys.Application.add_load(function() {
alert("test");
});
<script>

but it is not firing.

Do you put custom object on the layout?

Do you use Edit or View or Both modes in custom object?