We’ve implemented a custom script to automate load release for multi-stop shipments in our transportation management module. The script should trigger when all stop-level validations pass, but it’s failing silently without releasing loads.
The conditional logic checks carrier assignment, delivery windows, and dock availability across multiple stops. When I test individual conditions manually through the UI, everything validates correctly. However, the automated release never fires.
if (shipment.stops.every(stop =>
stop.carrierAssigned && stop.withinWindow)) {
releaseLoad(shipment.id);
}
No errors appear in logs, which makes debugging difficult. The script runs but the release action doesn’t execute. Has anyone dealt with similar scripting issues where validation passes but the trigger action fails? I’m particularly concerned about the multi-stop data structure access.
For debugging script execution in transportation workflows, enable detailed logging by adding debug statements before and after your conditional checks. Use logger.info() to output the shipment ID and stop validation results. This helped me trace similar issues where the script ran but skipped the action. The logs revealed that one stop property was returning undefined even though the UI showed it as valid. Multi-stop data can have timing issues if accessed before full load.
Check if your script has the right execution permissions. Silent failures often mean the script context lacks authorization to trigger workflow actions. Go to Administration > Script Security and verify that your custom script role includes transportation.load.release permission. Also confirm the script is set to run server-side, not client-side, since load release requires server execution.
The every() method on stops is definitely problematic. Infor’s transportation objects use custom collections, not native JavaScript arrays. Try iterating with a traditional for loop and explicitly check each stop’s properties. Also, verify that carrierAssigned and withinWindow are actual boolean properties and not string values like “true”. Type coercion can cause silent logic failures where conditions appear to pass but don’t trigger actions.
I’ve seen this before with transportation scripting. The issue is likely that your conditional logic is evaluating correctly, but the releaseLoad function isn’t being called with proper context. In IS 2022.2, multi-stop shipment data structures require explicit iteration rather than array methods like every(). The shipment object doesn’t expose stops as a standard JavaScript array.
You mentioned no errors in logs, but have you checked the workflow execution history? Navigate to Transportation > Workflow Monitor and filter by your shipment ID. This shows each step’s status including script executions. I discovered that scripts can appear successful while the subsequent action fails due to state conflicts. If another process has a lock on the load record, the release will be skipped without throwing an error. The workflow history reveals these state issues that don’t appear in standard logs.