Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Pop up window / new record request from a second database file


dodt
 Share

Recommended Posts

Hi,

 

How do I create a button which will open a layout in a different database [New Record Request]?

 

This topic is somewhat similar, but does not quite match...

 

http://www.maclane.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=16;t=000300#000000

 

So, I have a form which has a portal of contacts in my main database. Underneath the portal entries, I have a button called [add contact].

 

This button is to open a new window (like a GTRR window used in the portal) with the layout from the contacts database displaying a New Record Request.

 

I like this better then the add to portal ability which is easy in FM, as you can display the fields more user friendly then in a table row.

 

I appreciate any suggestions you can give me smile.gif

 

Regards,

dodt.

Link to comment
Share on other sites

Hi Steve,

 

Create a global text field in your Main db called gID. Then within Contacts, create a relationship from Contacts to Main on the MainID maybe call the relationship Main.

 

Your New Record script in Contacts:

Go To Layout [YourNewRecordLayout]

New Record Request

Set Field [MainID, Main:gID]

Go To Field [FirstField to data enter]

 

Have a 'Go Back' button that, when they are done, will have a script of: Go To Related Record [show, Main] and possibly Go To Layout [Layout with your portal]

 

Your script in Main that you attach to the New Contact Button would be:

Set Field [gID, MainID]

Perform Script [sub-script External, Contacts.fp5] and point to your new record script.

 

Also, in your Define Relationships, turn off 'Allow Creation of Related' and this way, Users won't be adding a new record via the portal. smile.gif

 

LaRetta

Link to comment
Share on other sites

Beautiful!!!

Works perfectly smile.gif

Thank you heaps.

 

As a side question, if I just want to open a new window with a particular database (default layout shown) how would I go about that from within my main database? confused.gif

 

Regards,

dodt.

Link to comment
Share on other sites

Hi Steve, Here is my understanding and I hope I'm corrected if wrong...

 

If you are on (or switch to) a layout in your Main which contains a field from a related db, that related db will open automatically but will remain in the background until called forward via script. A simple Go To Related [show] will bring it to the front. And it will place the User on the last related Layout used (I think). The reason I say 'I think' is because I've never left this to chance.

 

I've always scripted my various layout switches (which usually require more than just a layout switch). And then I attach that to my Main script (as we did above) using Perform Script [External, Related], right after a Go To Related [show] step.

 

If the Main script needs to go to the Related, perform work and then return without the User noticing it (smile), I usually Freeze Window first. I don't know if this is right or wrong but I don't like the idea of Users seeing flashes or any switches, but it has recently come to my attention that a Freeze Window[] might *slow* a process (like before a loop (?) but I haven't tested it yet. I think Freeze Window[] may be mis-used quite often and I might be an offender myself. frown.gif

 

Then I perform my External script in related, and then end my Main script with something - anything to bring it back. Usually a Refresh Window, but it appears that even an Enter Browse Mode would work. smile.gif

 

But here's the kicker, in my opinion ... if the related db has a startup script always switching to a specific default layout (through Preferences > Document) or any other script-step, that startup script will not run when your related db is opened in this way - ie, just because your Main layout has a related field on it. :eek: Because of this, I've always told it (by attaching the External related layout switch). smile.gif

 

You can also open another db (any db) by scripting Open. If another db is opened in this way, it's startup script will run and a default layout switch can be specified. I've seen so many variations that I'm unclear on describing the best way. I just try to think through the logic of my needs at the time. If, for instance, you open your Main on a layout without a related field, you may want to script an Open [Related, Minimize], which would force your related DBs Startup script to execute.

 

And then there are Toggle Windows things to consider! Whew! Did I help you or confuse you more? I guess every need should be addressed independently and if you have a specific situation, we could give you more detailed input. Overall, handling everything via script allows control ... and I love control. laugh.gif

 

LaRetta

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use