- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 12:03 PM
i have created a field (checkbox) on change form and its doing the following when is set to true is taking away the request apporval action both the one from the top of the form and the one at the bottom of the form using this code
client script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading|| newValue === '') {
return;
}
if (g_form.getValue('u_vendor_change') == 'true' ) {
document.querySelectorAll("#state_model_request_assess_approval")[0].hide();
document.querySelectorAll("#state_model_request_assess_approval")[1].hide();
}
else {
document.querySelectorAll("#state_model_request_assess_approval")[0].show();
document.querySelectorAll("#state_model_request_assess_approval")[1].show();
}
}
when is click save is saving the changes, however if i want to set to false again the checkbox is displaying an error message
does anyone know what i am doing wrong
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:07 PM
Here is a try/catch code with your script :
try{
if (g_form.getValue('u_vendor_change') == 'true' ) {
document.querySelectorAll("#state_model_request_assess_approval")[0].hide();
document.querySelectorAll("#state_model_request_assess_approval")[1].hide();
}
else {
document.querySelectorAll("#state_model_request_assess_approval")[0].show();
document.querySelectorAll("#state_model_request_assess_approval")[1].show();
}
}catch(error) {
console.log("Error on vendor change script "+error);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:07 PM
Here is a try/catch code with your script :
try{
if (g_form.getValue('u_vendor_change') == 'true' ) {
document.querySelectorAll("#state_model_request_assess_approval")[0].hide();
document.querySelectorAll("#state_model_request_assess_approval")[1].hide();
}
else {
document.querySelectorAll("#state_model_request_assess_approval")[0].show();
document.querySelectorAll("#state_model_request_assess_approval")[1].show();
}
}catch(error) {
console.log("Error on vendor change script "+error);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:17 PM
that seems to resolve the problem for the time being. can i ask you the last part of the requirement i want that once vendor change is checked also the schedule ui action is display on the form and once i click on it change the state to scheduled and the Reschedule option will be presented.
any idea on how can i achieve this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:29 PM
Goto your UI Action ("Schedule" UI action in your case) and based on your requirement write your script :
for example : for client side :
g_form.setValue('state',3);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:31 PM
Hi,
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
Also, I would say, please open new thread for any new question/query/suggestion.