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

When does value template get triggered?

Hi,

We are working with Value Templates and would like to know under what all conditions does a template get triggered and where can we change that, if possible?

For example, the template for Person.CentralAccount makes use of Person.FirstName and Person.LastName. If the value of LastName for an employee is changed, the value for CentralAccount changes. Which means that the template for Person.CentralAccount is executed if LastName or FirstName is changed. Can we prevent the CentralAccount template from executing on change of FirstName and LastName? How can we do this?

Thanks for your help in advance.

Parents
  • In short, you can't.

    The notifications to trigger the value template generation require that your tables are connected in a way that a $FK(...).$FK(...)... look-up would be able to find the value.

    In your case, when I am understanding it correctly, you need to change the value in your custom column for many objects when the value in the referring table has changed.

    For that use-case you have two options:

    • Asynchronous: Create a process chain that will be triggered by the UPDATE event of your referring table. In the process create a process step that uses the task ExecuteTemplates to re-executes the templates for the objects that are related to the changed value of your referring table. You can limit the template execution to your custom column by specifying the process step parameter Columns.
    • Synchronous: Re-execute the templates for the objects that are related to the changed value of your referring table in the OnSaved script of your referring table. Be aware that the save operation for your referring table could run for a long time if you have many object to execute the templates for.

    To prevent any long-running save operations for your referring table I would opt for the asynchronous method.

Reply
  • In short, you can't.

    The notifications to trigger the value template generation require that your tables are connected in a way that a $FK(...).$FK(...)... look-up would be able to find the value.

    In your case, when I am understanding it correctly, you need to change the value in your custom column for many objects when the value in the referring table has changed.

    For that use-case you have two options:

    • Asynchronous: Create a process chain that will be triggered by the UPDATE event of your referring table. In the process create a process step that uses the task ExecuteTemplates to re-executes the templates for the objects that are related to the changed value of your referring table. You can limit the template execution to your custom column by specifying the process step parameter Columns.
    • Synchronous: Re-execute the templates for the objects that are related to the changed value of your referring table in the OnSaved script of your referring table. Be aware that the save operation for your referring table could run for a long time if you have many object to execute the templates for.

    To prevent any long-running save operations for your referring table I would opt for the asynchronous method.

Children
No Data