This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Process for ShoppingCartOrder won't fire up on UPDATE event

We want to fire up process on UPDATE ShoppingCartOrder. By default, there are no events on this table so we add UPDATE object event.

Problem is that when UPDATE appears the process won't fire up. We are updating ShoppingCartOrder from another process with "SQLComponent - Execute SQL":

Dim f As ISqlFormatter = Connection.SqlFormatter
Value = "UPDATE ShoppingCartOrder SET Description = CONCAT(ISNULL(Description, ''), 'COS') WHERE Description IS NULL AND " & f.Comparison("UID_ShoppingCartOrder", $UID_ShoppingCartOrder$, ValType.String,VI.DB.CompareOperator.Equal ,VI.DB.FormatterOptions.None)

PS 1) when UPDATE is generated from Object Browser process is fired up

PS 2) With INSERT object event there is no problem.

  • Hi P.Noga,

    It's not enough just to add the event to the process. If the underlying table does not implement that trigger at the database level then of course it will never happen.

    If you really need this ..... you will have to create a database trigger for UPDATE.

    HTH, Barry.
  • Also I've just noticed/realised that you are doing the update with an SQL statement. This updates the data directly in the database and bypasses the object layer. Assuming the UPDATE trigger is implemented - which as far as I can see, it isn't OOB ..... you would need to use HandleObjectComponent - Update to make the trigger fire.
  • Hi Barry,

    so why it works (process is fired up) when I generate UPDATE event from Object Browser?

  • Ok, You might be right. How to transfer "SQLComponent - Execute SQL" to HandleObjectComponent?

  • OK ... yes apologies ..... I was wrong about the need for a custom trigger .... ok you have your UPDATE event defined against the table ..... this works through OB because OB works at the ObjectLayer.

    You just need to change your "SQLComponent - Execute SQL" to "HandleObjectComponent - Update" ..... set the appropriate WhereClause and then change the val_Property<n> parameters to val_<The attribute you want to update> and set the value = appropriately.

    HTH, Barry.