ChristofK Posted December 17, 2018 Report Share Posted December 17, 2018 Hi all, I cannot seem to overcome an issue with the use of Javascript on a bulk edit screen. There is a basic little script I wrote to control when users should be notified about changes done in bulk. It should simply prevent notifications from being sent if the user did not alter the initial delivery status of a product. While the script itself executes just fine upon each change to the delivery status field, the value that gets inserted into the text field which toggles the actual notifications isn't being saved when I hit "Update". It works if I manually type in Yes or No, but not if it's done via the script. I suspect this has to do with Ajax in one way or another, about which I lack the necessary knowledge to troubleshoot, unfortunately. var pSDeliveryOld = document.getElementById("BulkEditParticipation_List_2016_Delivery_status").value; var dStatusChangeNotification = document.getElementById("BulkEditParticipation_List_2016_Notification_DStatusChange"); function statusCheck() { var pSDeliveryNew = document.getElementById("BulkEditParticipation_List_2016_Delivery_status").value; if(pSDeliveryOld !== pSDeliveryNew) { dStatusChangeNotification.value = "Yes"; } else { dStatusChangeNotification.value = "No"; } console.log("System to send notification: " + dStatusChangeNotification.value); } document.getElementById("BulkEditParticipation_List_2016_Delivery_status").onchange = statusCheck; Could one of you experts out there help me get the Yes/No value saved in the table? Many thanks in advance! Best, Kristof Quote Link to comment Share on other sites More sharing options...
ChristofK Posted January 7, 2019 Author Report Share Posted January 7, 2019 Any ideas on how to solve this issue? Quote Link to comment Share on other sites More sharing options...
Kurumi Posted January 7, 2019 Report Share Posted January 7, 2019 Have you tried to check this link: https://howto.caspio.com/release-notes/caspio-bridge-13-0/13-0-impacted-areas/ or try to disable the AJAX of your DataPage? Quote Link to comment Share on other sites More sharing options...
ChristofK Posted January 8, 2019 Author Report Share Posted January 8, 2019 Hi Meekee, Thanks for your input. While it was certainly a good place to start, the modifications described on the impacted areas page are of no help since the script does actually run. It's not an issue with how it's triggered as it executes flawlessly upon hitting update. As for disabling Ajax altogether, the system won't allow me. I suspect that if you want to have the bulk edit feature enabled, AJAX is a must, so Caspio Bridge won't let me untick the box while having that on. Any other suggestions that come to mind? Thanks & best Kristof Quote Link to comment Share on other sites More sharing options...
Vitalikssssss Posted January 8, 2019 Report Share Posted January 8, 2019 Hi @ChristofK, Did you consider creating a validation with a Triggered Action feature? https://howto.caspio.com/tables-and-views/triggered-actions/ This type of validation will require relatively simple Trigger on record update. Here is an example: Hope this helps. regards, vitalikssssss Quote Link to comment Share on other sites More sharing options...
ChristofK Posted January 8, 2019 Author Report Share Posted January 8, 2019 31 minutes ago, Vitalikssssss said: Hi @ChristofK, Did you consider creating a validation with a Triggered Action feature? https://howto.caspio.com/tables-and-views/triggered-actions/ This type of validation will require relatively simple Trigger on record update. Here is an example: Hope this helps. regards, vitalikssssss Haven't thought about this, as I wasn't sure I could do validations on the same field (compare onload and onsubmit states). Will look into it, though, seems like a viable alternative! Thanks for sharing this! Quote Link to comment Share on other sites More sharing options...
ChristofK Posted January 17, 2019 Author Report Share Posted January 17, 2019 Hi @Vitalikssssss, Thanks so much, your suggestion worked like a charm! Best, ChristofK Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.