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

Yes i added it on layout and yes tried with edit only and as well as both but not working.

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

Thanks a ton Ileya..got it ..it was a typo

Welcome  And it is Ilya, btw  

Ok Ilya  will take care next time

Hi Ilya,

 

When i add any script on first tab let s say overview, it works fine as that field placed here. But when i click on any other tab it stuck.

So how can we prevent the script to run when i click on some other tab.

Tabs are very interesting cases in Archer. They are loaded when you open them, and seized when you go away.

 

Thus, put your custom object to the section, which is always visible, not a tab.

What i mean to say is i put my code in custom object under section only.. now when i click on tab items closed it is again triggeering that script as page is reloading i guess..now it could not find that particular field in items closed, it went into hang state.

 

There is some way so that we can check if that field exists

<script type="text/javascript">
function setRecordPermission() {
var uid = parent.parent.ArcherApp.globals.userId;
var dm = parent.parent.ArcherApp.globals.displayName;
var textFieldAttributes = new Array();
textFieldAttributes.push({
enabled: true,
emptyMessage: '',
validationText: dm,
valueAsString: dm,
lastSetTextBoxValue: "val"});
var textFieldAttributesSerialised = Sys.Serialization.JavaScriptSerializer.serialize(textFieldAttributes[0]);
$('input[id$="'+ 16860 +'c"]').val(dm);
$('input[id$="'+ 16860 +'c_ClientState"]').val(textFieldAttributesSerialised);
ArcherTech.UI.GenericContent.GetInstance().setFieldValue(changeId, dm)

}
Sys.Application.add_load(function() {
if (getRecordId() == 0) {
setRecordPermission()
}
});
</script>

pastedImage_1.png

Yes, add_load is generating every time when page is reloaded, or tab initialized.

 

You have to make some sort of verification taking into account that field in tab 1 is not available.

You put your Custom Object to the Tabs still. You need to create sections which is ALWYAS open regardless of Tab, and put your custom object there.