Important Update: Community URLs redirect issues are partially resolved. Learn More. .
2018-12-10 01:43 AM
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.
2018-12-11 06:14 AM
Yes i added it on layout and yes tried with edit only and as well as both but not working.
2018-12-11 06:16 AM
<script type="text/javascript">
Sys.Application.add_load(function() {
alert("test");
});
</script>
2018-12-11 06:19 AM
Thanks a ton Ileya..got it ..it was a typo
2018-12-11 06:21 AM
Welcome And it is Ilya, btw
2018-12-11 06:23 AM
Ok Ilya will take care next time
2018-12-13 12:35 AM
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.
2018-12-13 12:51 AM
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.
2018-12-13 12:59 AM
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>
2018-12-13 01:04 AM
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.
2018-12-13 04:13 AM
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.