Jump to content

New record on Popover


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

Recommended Posts

Hi all,

I am sure this is a simple question for must of you, but for the life of me i have looked at different samples and cannot get it to work. I would like to create a new record from a popover. I started by creating a script with "New Record/Request" step. then i assigned the script to "OnObjectEnter" script trigger to the popover itself, the script does create the new record but the popover does not pop. What I am doing wrong.

Yes, once i get this part to work i plan to add over actions e.g. what happens is "cancel" is press, or is the users closes the popover.

Link to comment
Share on other sites

More details would be helpful, but why not just a card window?  You could put a clear button over the entire small card window layout to prevent a user from committing the record, then use 'Save' and 'Cancel' buttons respectively to save or cancel the new record creation.

Then, from your main layout a 'New Record' button could simply be 2 steps:

-New Layout, pick card layout 

-New Record Request

 

Then your buttons can have script parameters of 'Save' & 'Cancel'.  So:

If [Get(ScriptParameter)="Save"]

   Commit Record...

Else

   Revert Record...

End If

Close Window

You could even add steps for 'save' to grab the primary key, then close the card window, then go to that new record.

 

The 'Clear' button over the whole layout needs to be under all the other fields/objects on the layout, otherwise you'll never be able to click into any fields or close the layout.  The clear button can have a simple script step like 'Resume' on it.

If you want to go the popover route, you're probably better to use global fields for record creation, then script taking those values and putting them into variables, creating a new record, inserting those variables into the proper fields, committing record.

There are also a number of posts for making a popover modal in the forums

Link to comment
Share on other sites

Rudy, a key difference between popovers and card windows is context. If you want to creat a new record in a different table, this is much better achieved with a card window. 

As for supporting Save and Cancel, Steve gave you two options: enter in global (we create a utility table for this)  and then script the set fields on Save. Or. Block the commit and only allow the save button to do so. Here's my preferred way of achieving that. https://www.geistinteractive.com/2015/11/09/lock-filemaker-records-open/

also, if you want the new record to be related to the record you're viewing, then pass its key when you call the new record card window script. 

Link to comment
Share on other sites

This topic is 2069 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
×
×
  • Create New...

Important Information

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