Single Form To Retain Previous Input Values

Single Form To Retain Previous Input Values After [New] (saving)

Say I have input fields A,B,C,D. After I [Save] my new records, I got blank for A,B,C,D for next entry. If I need to retain A,B previous values for new entry, how to achieve that?

Any help? TQ in advance.

Re: Single Form To Retain Previous Input Values

you can store in the session and atribute to the fields …

Re: Single Form To Retain Previous Input Values

Thks Diogo Toscano for the suggestion.

I did that and make A,B as GET,POST,SESSION in Application/Global setting.

It seems every time after I Save them into a new record, the new sccreen shows BLANK A,B.

Any advice or anything I might take notice?

Re: Single Form To Retain Previous Input Values

Can it be done dynamically- via Events and codes?
Any helpers?

Re: Single Form To Retain Previous Input Values

Do this way:

edit the field, and at the attribute"Initial Value (type)" to defined value and “Initial Value” set field a as [var_a] and in the others field.

onbeforeinsert attribute the value inserted to the variable.

onbeforeInsert:
[var_a] = {a};

When you open as a new record, if you are using variable as initial value, the field will be filled with the value of the variable.

open the Aplication -> Global Variable and edit the variables that you created to Settings -> check Optional
This will prevent the first time users will insert a new record, that the variables are empty.

Re: Single Form To Retain Previous Input Values

Thks Diogo Toscano. U lead the right ways to solve my problems.

I just need to do the reverse, ie {a}=[a]; during the onScriptinit.

I think most of us are so used to coding PHP ourself and mostly have no problem on it. We are coming to adopt SC as a productivity tool to look for automation in our works. Nevertheless, the learning curve is stiff. I just wish the SC team can give us sample examples based on working PHP scripts. We learn faster if we are shown how SC does the similar jobs,instead of coding using PHP. Well,this my personal opinion.

If anybody has got simple sample examples done by SC and willing to share, I would be thankful if U could send me for trying.

dbwing

Re: Single Form To Retain Previous Input Values

you can send the ideas directly to me, so we can test and create the samples to put inside the samples project that we distribute.

:slight_smile:

Re: Single Form To Retain Previous Input Values

I take note on this.

Hope I can contribute and learn better from experts in SC.