Preparation will refresh suppose Book form submitted using submit method and end node in save action. Now the issue is, If BookId assign with null Identifier after saving the record then form should get blank again because preparation is again call.But this is not happen Form still hold the values that are previously entered. 

I am confused now, How preparation is behave in this case.


Hello Pritam,


I believe you should change end node in save action to destination (current screen).

From how I understand it Preparation only execute on first render of the page; this is no longer the case after a submit action occured.


Hope this helps!

- Emman

Hi :)

If you have an aggregate associated with the form. By running preparation again with null Identifier, your aggregate must be empty and the form as a result must be blank values.

Can you confirm this?

Hi, 

When a Form is rendered, it fetchs data from its source ONLY if you are loading the page (you navigate to it). 

During a submit, even if you are running the preparation again, and building the entire page again (and the form), as this is not a page loading, the form will use data already on it, not fetching again from the source. 

If wasn't like this, on a save where you validate the form and find errors, the form would be wiped out, something you don't want. 

So, it's not a matter of how the preparation runs (it is just an action), but how the form behavies when it is built, and it behavies differently if you are loading the page or submitting data. 

Hope this helps. 

Cheers 

P. S. If you need to change a form value on a submit, you need to do it explicitly using an assign to set the Form's record value. 

Pritam Avhad wrote:

Preparation will refresh suppose Book form submitted using submit method and end node in save action. Now the issue is, If BookId assign with null Identifier after saving the record then form should get blank again because preparation is again call.But this is not happen Form still hold the values that are previously entered. 

I am confused now, How preparation is behave in this case.


Hi Pritam,

When you submitting form with ajax submit part of screen are refresh but

When you  submitting form with submit method with screen action end with END NODE in that case preparation not call and not refresh screen  . Form only display entered data temporary .

Could you try one basic example . In form in expression widget set "Total =  Quantity * Price " from entity and after submit it always so old value of total not newly updated .

Thanks 

Nikhil 


Nikhil Gondane wrote:

When you submitting form with ajax submit part of screen are refresh but

This is not entirely true, Nikhil

When you  submitting form with submit method with screen action end with END NODE in that case preparation not call and not refresh screen  . Form only display entered data temporary .

...

Nikhil 


This is also not correct.

On Ajax Submit, You can use Data Refresh on the Form source or not, and Ajax Refresh on the Form to refresh it, or not. Doesn't matter, as the form will not fetch the data from the source again, the form itself will not change if you didn't make any explicit change on it.

On a Submit that ends with END node, the preparation will run AND the screen will be entirely rebuilt.
But again, the form will not fetch the data from its source.

Please, see by answer above.

Cheers

Eduardo Jauch wrote:

Nikhil Gondane wrote:

When you submitting form with ajax submit part of screen are refresh but

This is not entirely true, Nikhil

When you  submitting form with submit method with screen action end with END NODE in that case preparation not call and not refresh screen  . Form only display entered data temporary .

...

Nikhil 


This is also not correct.

On Ajax Submit, You can use Data Refresh on the Form source or not, and Ajax Refresh on the Form to refresh it, or not. Doesn't matter, as the form will not fetch the data from the source again, the form itself will not change if you didn't make any explicit change on it.

On a Submit that ends with END node, the preparation will run AND the screen will be entirely rebuilt.
But again, the form will not fetch the data from its source.

Please, see by answer above.

Cheers

Hi Eduardo , I mean to say preparation not call in ajax  we need to refresh part of screen manually .


Nélio Dionisio wrote:

Hi :)

If you have an aggregate associated with the form. By running preparation again with null Identifier, your aggregate must be empty and the form as a result must be blank values.

Can you confirm this?





Yes Aggregate gets empty but It is not assigned to the form.I have check in debugger.

Eduardo Jauch wrote:

Nikhil Gondane wrote:

When you submitting form with ajax submit part of screen are refresh but

This is not entirely true, Nikhil

When you  submitting form with submit method with screen action end with END NODE in that case preparation not call and not refresh screen  . Form only display entered data temporary .

...

Nikhil 


This is also not correct.

On Ajax Submit, You can use Data Refresh on the Form source or not, and Ajax Refresh on the Form to refresh it, or not. Doesn't matter, as the form will not fetch the data from the source again, the form itself will not change if you didn't make any explicit change on it.

On a Submit that ends with END node, the preparation will run AND the screen will be entirely rebuilt.
But again, the form will not fetch the data from its source.

Please, see by answer above.

Cheers


I believe this comment already explains the behavior we are looking at here.


Emman wrote:

I believe you should change end node in save action to destination (current screen).


Hello Pritam,

I would just like to confirm if you have tried to perform my suggestion here?

Hi, 

If you want to implement a "Save & New" functionality, where the user saves the form and the data is again blank so you can enter a new record, you have 2 options.

1. Like Emman said, add a Destination to Current screen passing NullIdentifier().

The problem here: you will rebuild the entire screen, without this being necessary.

2. Use Ajax Submit. In the Screen Action, add a local variable called Empty that has the same data type as the source of the form. After the Create/CreateOrUpdate, assign the variable to the form record and Ajax Refresh the Form.

Method 2 is the one used in training and is preferable most of the time.

Cheers.

P.S. A third option would be to assign, explicitly, the returned current of the aggregate to the form, in the preparation. Again, Method 2 should be prefered.