Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to save a blank exemplar of the current form?

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

17-09-2018

Is it possible to have a button that performs a "save as" and "reset" without actually resetting the current state?
So literally a button that saves another blank exemplar of the form itself without deleting the current entries.

Thank you in advance

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

17-09-2018

One way to achieve this would be this. In the form's presave event, create variables for all your object values and then reset the form and in the postsave event, restore all the object values from the variables. Presave events take place before the save dialog, postsave event execute after the dialog closes. Note: it will trigger if the user cancels as well.

This will require the creation of global variables. I wrote a bit about global variables here: How to compare global variable value to TextField value

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

18-09-2018

Great stuff. Sometimes the simplest option is the best. All my code is very uncomplicated, it is larger, but it works which is my desired outcome.

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

18-09-2018

Great insight MinusZero!

Plus your write up on Global Variables help me piece together a working button.

I don't think my version is the most effective, but it seems to work.

For everyone else interested here's my proof of concept:

1Text Field Object: "Test1"

1 Button Object: "SaveBlank"

Insert a Script Object: "Memory"

Memory

var Test1X = Test1;

Test1

// initialize event //

this.rawValue = Memory.Test1X;

this.rawValue = "";

SaveBlank

// click event //

app.execMenuItem("SaveAs");

//preSave event //

Memory.Test1X.rawValue = Test1.rawValue;

//postSave event //

Test1.rawValue = Memory.Test1X.rawValue;

Soo, type some text in Test1 field. Click on the button. prompts a "save as" window. Save.

Your inputted text remains, but a blank form is saved. Yeah.

Some might be going "hey! you didn't reset the fields."

I say, "yeah... it seems I don't need to.. I don't know really why, but ehh..."

I'm thinking its because I threw in the this.rawValue=""; in the Text Field Object, the strange Test1X = Test1 loopy thing, and order of operations, all happening in a mishaps of desired outcome.

Good luck!