Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Use a single "+" in the header to create a new record dependant upon the 'TAB' currently open


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

Recommended Posts

Posted

I have one layout with 3 'Tabs' - Client, Contacts, Achievements. For context, a client can have many contacts (portals used here) and likewise with Achievements. Each of these 3 'Tabs' has a separate layout to create a new record. This is all to be used on an iPad so if anyone has any better ideas I'd be really interested to know your thoughts.

 

I would like to use one '+' button in the HEADER, as opposed to a button on each 'Tab', to add a new record which would go to a specific layout to create the new record. I can't seem to find a script that will give me the 'NAME' of the 'Tab' which I could then have a GoToLayout function.

 

So if I were viewing the Client 'Tab' by clicking the '+' button it would navigate to the layout to enter new 'Client' details and if I were viewing the Contacts 'Tab' by clicking the '+' button it would navigate to the layout to enter a new 'Contact' details.

 

Thanks

 

Zab

Posted

the functions you are looking for is called "LayoutObjectNames(fileName;layoutName)" and returns a list of the names of all named objects on layoutName in fileName, separated by carriage returns.

 

the script could look like this:

 

 

p.s. of course, you must name the tabs accordingly ;o)

Posted
So if I were viewing the Client 'Tab' by clicking the '+' button it would navigate to the layout to enter new 'Client' details and if I were viewing the Contacts 'Tab' by clicking the '+' button it would navigate to the layout to enter a new 'Contact' details.

 

You can use the GetLayoutObjectAttribute() function,  in conjunction with the isFrontPanel attribute, to determine which panel is currently the viewed one (you need to test the panels one by one).

 

Alternatively, you could store the viewed panel in a variable, using a script triggered OnTabSwitch and the Get(TriggerCurrentTabPanel) function. Then have the + script consult the variable before deciding on the target layout.

 

 

 

the functions you are looking for is called "LayoutObjectNames(fileName;layoutName)" and returns a list of the names of all named objects on layoutName in fileName, separated by carriage returns.

 

I think you are testing whether an object exists - not if it is currently the front tab panel.

Posted

I think you are testing whether an object exists - not if it is currently the front tab panel.

heck, you are right… sometimes i shouldn't answer topics in between (my work) ;-))

 

using "GetLayoutObjectAttribute" is the correct function to determine which tab is visible…

Posted

Hi Pixi!

 

Thanks for your help. I'm afraid I have a few very newbie questions. I don't understand 'oList', 'param' and can I add this script as a perform script under the button setup?

 

I've added a few screen shops to show what I've tried.

 

Thank you

 

Zab

 

 

post-109188-0-77243100-1390411941_thumb.

post-109188-0-55607600-1390411946_thumb.

Posted

forget the "oList" and "param" since they were just names for parameters i've choosen.

 

please check enclosed file and in there the "Add" script.

scoony.fmp12.zip

Posted

Hi Pixi!

 

Thank you very much for the file. I totally understand how you have put it together and the associated code.

 

Zab

This topic is 3968 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.