Approval task is not working
Hi,
I'm new to BPM'Online. I've created a sample approval business process. But while running the process, it failed at Approval step with the below error. Can someone please help with this error?
Terrasoft.Common.DbOperationException: The INSERT statement conflicted with the FOREIGN KEY constraint "FKrsyYBKm1NBl8dx2I8gdwpDVlpuw". The conflict occurred in database "010244-studio", table "dbo.UsrApprovalRequests", column 'Id'.
The statement has been terminated. ---> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FKrsyYBKm1NBl8dx2I8gdwpDVlpuw". The conflict occurred in database "010244-studio", table "dbo.UsrApprovalRequests", column 'Id'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
Regards
Srihari
Like
Dear Srihari,
The error indicates that record for approval wasn't found in the Section "Approvals Requests". The record wasn't found because you have selected it incorrectly in the field "Record Id". You need to define the record ID there instead of the Task Id from the element Send email.
You need to enable approvals in your custom section and select a record from this section to the field 'Record Id". Approval for this record will be created.
But as far as I see you want this section to store your approvals from some other section. Unfortunately this is not default approval functionality works. If you want to display approvals of some section you need to find the table with these approvals (it is created automatically once approvals in section were enabled) and create a Lookup for this table. In any case you won't be able to work with this lookup.
F.e. You can use this element to create an approval for an Order after enabling approvals in this section. In this case you would select Order in the field "Approval Section" and would select an order Id to the field "Record Id". After that you would see an approval in the "Approvals" tab in this specific Order. The approver would also see the approve in his notification center.
Double-check the academy articles describing the Approvals functionality in order to understand how exactly they work and how to use this functionality correctly.
Oleh