Merrick
11/28/2024, 11:26 AMCeligo AI
11/28/2024, 11:26 AMAI generated answer (using internal Slack threads):Based on the conversations, it seems that you can use a User Event script on the Vendor record to monitor the
XEDIT
event type during a beforeSubmit
entry point. This will allow you to control the behavior of the record when a user tries to save it.
Here's a rough idea of how you can implement this:
javascript
function beforeSubmit(context) {
if (context.type === context.UserEventType.XEDIT) {
var newRecord = context.newRecord;
var oldRecord = context.oldRecord;
// Check if the inactive field has been changed
if (newRecord.getValue('isinactive') !== oldRecord.getValue('isinactive')) {
// Prevent the change
throw new Error('You are not allowed to change the inactive status of this record.');
}
}
}
This script will throw an error and prevent the record from being saved if a user tries to change the inactive status of the record.
For the vendor approval workflow, you can use a workflow action script to make the vendor inactive and trigger another approval workflow when the bank details are changed. This will ensure that any changes to the bank details will need to be approved before the vendor can be reactivated.
For the issue with the Project object, you need to check when your workflow is making the record active and when the script is being triggered. If you are making it active before record load, it should work, otherwise, your script runs prior to the record becoming active. You need to check where your workflow action script is in the list of actions.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
11/28/2024, 11:26 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832616031
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830684781
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829807758
Celigo AI
11/28/2024, 11:26 AM