Skip to main content
October 28, 2024
Solved

Trigger and Write to records smart service

  • October 28, 2024
  • 4 replies
  • 0 views

Hello Everyone,

I am trying to insert a record which would be using the Write to Records or Write to Data Store Entity smart service to a table that has a trigger at the backend DB.

The trigger is for checking for the existence of a particular value in another  table.

  • If the ID being inserted exists in the another table, the insertion will proceed without any issues.
  • If the ID does not exist in the another table, the trigger will prevent the insertion and typically raise an error.

So in the second scenario if  the ID is not found, will the write to records execute normally or would it give an error because of the trigger? 

    Best answer by karumurua531442

    hi [mention:04ccf59282b3437292bf0fc417dcebc4:e9ed411860ed4f2ba0265705b8793d05]  the Write to Records or Write to Data Store Entity smart service will give an error if the trigger prevents the insertion

    4 replies

    stefanhelzle0001
    October 28, 2024

    Did you already test that? I would expect to see that error coming up.

    karumurua531442
    October 28, 2024

    hi [mention:04ccf59282b3437292bf0fc417dcebc4:e9ed411860ed4f2ba0265705b8793d05]  the Write to Records or Write to Data Store Entity smart service will give an error if the trigger prevents the insertion

    shanmathip7466
    October 29, 2024

    Hi [mention:04ccf59282b3437292bf0fc417dcebc4:e9ed411860ed4f2ba0265705b8793d05] ,

    Yes the node will error out. It will throw the following error.

    somasundaram.d
    October 29, 2024

    Yes the node will error out because the SQL operation has not completed and returned an error. This will be passed back to process by the smart service