I need to Show Error Message for the user in the User interface when process on create record action fails. Currently it just says 'Action completed' whether the process is success or failure. User is unable to know if the record is successfully created or not.
Discussion posts and replies are publicly visible
If you are calling process from record action or related action.To show custom error messages when a record action fails, prevent the default "Action completed" message from appearing by ending your process with a chained User Input Task instead of an End node. After your Write Records node, add an XOR gateway to check success/failure and store the result in process variables. Enable activity chaining from Start through all critical nodes to the final User Input Task, which displays an interface showing either "Record created successfully!" or your specific error message based on the process variables. Since the process ends with a user interface rather than completing normally, the generic "Action completed" message won't appear, and users will see your meaningful feedback instead.If you are calling process from interface,When using a!startProcess() to call a process from an interface, you can directly handle success/failure using the onSuccess and onError parameters.
a!startProcess( processModel: cons!YOUR_PROCESS_MODEL, processParameters: {record: ri!record}, onSuccess: { a!save(local!message, "Record created successfully!") }, onError: { a!save(local!errorMessage, "Error: Failed to create record") } )
Thanks for the reply Shubham Aware But, when the Write Records node fails, the process aborts and doesn't proceed further right? How can we then call this UI for showing the error to the user?
You're right - when Write Records actually fails, the process pauses by exception and never reaches your XOR gateway or User Input Task, so custom error messages are impossible. The XOR approach only works when Write Records succeeds but returns something you want to check (like 0 rows affected). For true failures, users will see "An error occurred" (not "Action completed").Workaround: Use a subprocess to wrap your Write Records node. In the main process, call this subprocess with "Pause on Error" set to false. After the subprocess call, check if it completed successfully using process analytics or a flag variable. Based on this check, route to your custom error message UI. Alternatively, validate all data thoroughly before Write Records to prevent failures, and use Write Records outputs (like rows affected) to determine success rather than relying on exceptions.
Shubham Aware I created an exception with rule to see if there is error and then redirect it to a user interface. But his User Interface doesn't pop up, but when I see the instances, it has gone to the User Input Task and is waiting at that task.
Exception flows break activity chaining. When Write Records throws an exception and flows to your User Input Task, the record action loses its context and can't display the UI automatically. Instead, the task sits in the user's task queue.A better approach is the subprocess method mentioned earlier - wrap Write Records in a subprocess that catches errors and returns normally to the main process, maintaining the activity chain throughout.
How can I have "Pause on Error" set to false. I cant see an option to do this?
You will find ‘Pause on error’ in the write records node’s Data tab. This node is suggested to be in the sub process
Harsha Sharma Shubham Aware So we don't need the Sub Process right?
You're correct - if Write Records has "Pause on Error: false" in its Data tab, you don't need a subprocess. The process will continue even if Write Records fails, allowing you to check the error output in an XOR gateway and route to your custom error UI. This maintains activity chaining and solves your problem.