Jump to content

modal window for data entry


NewBee
 Share

This topic is 2592 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hello All,

 

This is my second post.

 

I'm currently playing with my sample file, which based on watching on youtube and reading forum posts. I have three text fields, and three global fields. I want to use a modal window for entering a new record. below are the scripts that I used based from what I read and watch.

 

Create Project script

 

Allow user abort [off]

New Window [Name: "New Project"; Height:1; Width:1; Style:Document]

Show/Hide Toolbars [Hide]

Go to Layout [New Project]

Adjust Window [Resize to Fit]

Perform Script ["Center Window"]

New record/Request

Pause/Resume Script[indefinitely]

Set Field [Modal window:: Project Name; Modal window::Project_Global]

Set Field [Modal window:: Project Contact; Modal window::Project Contact_Global]

Set Field [Modal window:: Project Notes; Modal window::Project Notes_Global]

If[$$delete=1]

Set Variable[$$delete; Value:""]

Delete Record/Request [No dialog]

End If

Close Window [Current Window]

 

Clean Global ( I used this for Script triggers OnLayoutExit for New Project Layout)

 

Set Field [Modal window::Project Name_Global; ""]

Set Field [Modal window::Project Contact_Global; ""]

Set Field [Modal window::Project Notes_Global; ""]

 

 

Cancel Project

 

Set Variable[$$delete; Value:1]

If[isEmpty(Modal window:: Project Name_Global) or (Modal window:: Project Name_Global) or (Modal window:: Project Contact _Global) or (Modal window:: Project Notes_Global)]

Show Custom Dialog [Get(ScriptName); "You are started entering data for new project cancel?"]

If[Get(LastMessageChoice)=2//No]

Exi Script[Result:False]

Else

Set Field [Modal window::Project Name_Global; ""]

Set Field [Modal window::Project Contact_Global; ""]

Set Field [Modal window::Project Notes_Global; ""]

End If

End If

 

Can you please help me to get the following

 

1. I want in my solution that if I Click the New Project Button my original layout will not not resize.

2. If I will Click my save button I want to see the record that I recently entered in browse mode.

3. If I click the cancel button and the custom dialog pop up, I want my new project window still open.

 

Please find attached sample file that Im working.

 

Any sample file  is highly appreciated.

 

Thank you so much,

Project.zip

Link to comment
Share on other sites

For #1: do you start with the window maximized?  Your profile says you are on Windows; if you start with the window maximized and then spawn a new window, the original window will de-maximize.  That's a long-standing annoyance.

 

#2: you will have to do an explicit find in the original window for that new record.  Separate windows function more or less like two different user sessions; the first window will not inherit a found set from another window

 

#3: when the user cancels  you have to make sure the $$delete variable is not set to 1, you also have to signal to the paused script that it should not close the window (you may need to use a different value for the $$delete variable for this.

 

However you can make your live a lot easier by using real modal windows and not put the original script in pause mode.

Link to comment
Share on other sites

  • Newbies

Hello,

 

this is the modification that I made for to partially solved # 1

 

Create Project script

 

Allow user abort [off]

Go to Layout [Modal window]

Set Zoom Level [Lock; 100%]

New Window [Name: "New Project"; Height:1; Width:1; Style:Document]

Show/Hide Toolbars [Hide]

Go to Layout [New Project]

Set Zoom Level [Lock; 100%]

Adjust Window [Resize to Fit]

Move/Resize Window [Current Window; Top (Get(ScreenHeight)/2) - (Get(WindowHeight)/2); Left (Get(ScreenHeight)/2) - (Get(WindowHeight)/2)

New record/Request

Pause/Resume Script[indefinitely]

Set Field [Modal window:: Project Name; Modal window::Project_Global]

Set Field [Modal window:: Project Contact; Modal window::Project Contact_Global]

Set Field [Modal window:: Project Notes; Modal window::Project Notes_Global]

If[$$delete=1]

Set Variable[$$delete; Value:""]

Delete Record/Request [No dialog]

End If

Close Window [Current Window]

 

If somebody has a better one, I will appreciate it. Please help me also to have a solution for my #2  & #3 request.

Thank you so much.

Link to comment
Share on other sites

This topic is 2592 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.