Lifecycle and Events

Hi everyone

I need for help in undestand about Lifecycle and Events

What are the difrence between then “camForm.on(‘variables-restored’” and “camForm.on('variables-fetched”?

When I have to use “camForm.on(‘variables-restored’” and when I have to use “camForm.on('variables-fetched”?

Thanks

@mrclalves, variables-restored gets called after variables-fetched.

  1. When a request is made to the server to gather the values of the variables declared in the variable manager.

    • variables-fetched is fired after the request returns and the values of the variables have been merged into the variableManager.
  2. If a saved state of the form exists, the variable values are replaced with the saved state.

    • variables-restored is fired after the saved values of the variables have been merged with the values in the variableManager.

Refer this post:

Hi @aravindhrs,

Thanks for help!

I read the documentations about lifecycle and events, but not understande becouse after saved using event ‘store’ saving my variables, the same way like is did in event ‘submit’ when load the task in an other moment the data are like not save, and I have use event ‘restored’.

Thanks for help

Hi @aravindhrs,

This situation occurs only to variables that not are directly referenced with tags ‘cam-variable-name’.