Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 05:24 AM
Hello
Please check with below script. YOu should not run the Client script when your form is loading. I believe running the onChange Client script when form is loading is creating issue. Can you please check once with below script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ga = new GlideAjax('UserCompany');
ga.addParam('sysparm_name', 'getUserCompany');
ga.addParam('sysparm_user_id', newValue);
ga.getXMLAnswer(function(answer){
alert("answer: " + answer);
g_form.setValue('company', answer);
g_form.setReadOnly('company', true);
});
}
If my answer helped you in any way then please do mark it as helpful. If it answered your question then please mark it correct and helpful. This will help others with similar issue to find the correct answer.
Thanks