dbTalk Databases Forums  

Script to Show - Hide a field in a portal

comp.databases.filemaker comp.databases.filemaker


Discuss Script to Show - Hide a field in a portal in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
senriz
 
Posts: n/a

Default Script to Show - Hide a field in a portal - 11-11-2009 , 03:23 PM






I'm a novice using FMP 9 Adv. I have a layout that shows a portal of
students with some related fields. Is there way to make the field
"Graduated" to Hide or Show by a click of a button?

Reply With Quote
  #2  
Old   
105
 
Posts: n/a

Default Re: Script to Show - Hide a field in a portal - 11-11-2009 , 04:38 PM






senriz wrote:
Quote:
I'm a novice using FMP 9 Adv. I have a layout that shows a portal of
students with some related fields. Is there way to make the field
"Graduated" to Hide or Show by a click of a button?
There are a few approaches.

One is to create a global in the child table, and have the script toggle
the global value 1/0

create a tunneled rel by adding an additional TOC: A::B::B_switched
where A is table A the parent TOC , your layout
B is the child rel showing your portal
B_switched is the toggled filtered TOC

A::B is your existing rel and portal
so the rel B to B_switched is b_id::b_id plus g_swicth::c1 ( a calc
value 1) ; so a multiparameter rel

replace the b_field in the portal to toggle with b_switched_field


alternatively you could create a calc field in B, that returned the same
result as the target field to toggle, conditionally on the toggle value,
and add that field to the portal; this would not allow editing the field
though.

Reply With Quote
  #3  
Old   
senriz
 
Posts: n/a

Default Re: Script to Show - Hide a field in a portal - 11-11-2009 , 11:21 PM



On Nov 11, 2:38*pm, 105 <corti... (AT) internode (DOT) on.net> wrote:
Quote:
senriz wrote:
I'm a novice using FMP 9 Adv. *I have a layout that shows a portal of
students with some related fields. *Is there way to make the field
"Graduated" to Hide or Show by a click of a button?

There are a few approaches.

One is to create a global in the child table, and have the script toggle
the global value 1/0

create a tunneled rel by adding an additional TOC: A::B::B_switched
where A is table A the parent TOC , your layout
B is the child rel showing your portal
B_switched is the toggled filtered TOC

A::B is your existing rel and portal
so the rel B to B_switched *is b_id::b_id *plus g_swicth::c1 ( a calc
value 1) *; so a multiparameter rel

replace the b_field in the portal to toggle *with b_switched_field

alternatively you could create a calc field in B, that returned the same
result as the target field to toggle, conditionally on the toggle value,
and add that field to the portal; this would not allow editing the field
though.
Thank you. I'll give this a try.

Reply With Quote
  #4  
Old   
Bill
 
Posts: n/a

Default Re: Script to Show - Hide a field in a portal - 11-12-2009 , 07:54 AM



In article
<cd997f50-4e03-4cb4-9a07-bf070561a816 (AT) w37g2000prg (DOT) googlegroups.com>,
senriz <dbsenriz (AT) gmail (DOT) com> wrote:

Quote:
On Nov 11, 2:38*pm, 105 <corti... (AT) internode (DOT) on.net> wrote:
senriz wrote:
I'm a novice using FMP 9 Adv. *I have a layout that shows a portal of
students with some related fields. *Is there way to make the field
"Graduated" to Hide or Show by a click of a button?

There are a few approaches.

One is to create a global in the child table, and have the script toggle
the global value 1/0

create a tunneled rel by adding an additional TOC: A::B::B_switched
where A is table A the parent TOC , your layout
B is the child rel showing your portal
B_switched is the toggled filtered TOC

A::B is your existing rel and portal
so the rel B to B_switched *is b_id::b_id *plus g_swicth::c1 ( a calc
value 1) *; so a multiparameter rel

replace the b_field in the portal to toggle *with b_switched_field

alternatively you could create a calc field in B, that returned the same
result as the target field to toggle, conditionally on the toggle value,
and add that field to the portal; this would not allow editing the field
though.

Thank you. I'll give this a try.
Another approach is to put a tab control in the layout. Put the portal
that shows the field "Graduated" on one of the tab controls, and a
portal that does not show that field on the other tab control.

But this raises a question: Do you want to limit which users can toggle
between the two? If so you ned to use a calculation or script and limit
access by privilege set.

Reply With Quote
  #5  
Old   
senriz
 
Posts: n/a

Default Re: Script to Show - Hide a field in a portal - 11-12-2009 , 10:04 AM



On Nov 12, 5:54*am, Bill <bbcoll... (AT) earthlink (DOT) net> wrote:
Quote:
In article
cd997f50-4e03-4cb4-9a07-bf070561a... (AT) w37g2000prg (DOT) googlegroups.com>,



*senriz <dbsen... (AT) gmail (DOT) com> wrote:
On Nov 11, 2:38*pm, 105 <corti... (AT) internode (DOT) on.net> wrote:
senriz wrote:
I'm a novice using FMP 9 Adv. *I have a layout that shows a portal of
students with some related fields. *Is there way to make the field
"Graduated" to Hide or Show by a click of a button?

There are a few approaches.

One is to create a global in the child table, and have the script toggle
the global value 1/0

create a tunneled rel by adding an additional TOC: A::B::B_switched
where A is table A the parent TOC , your layout
B is the child rel showing your portal
B_switched is the toggled filtered TOC

A::B is your existing rel and portal
so the rel B to B_switched *is b_id::b_id *plus g_swicth::c1 ( a calc
value 1) *; so a multiparameter rel

replace the b_field in the portal to toggle *with b_switched_field

alternatively you could create a calc field in B, that returned the same
result as the target field to toggle, conditionally on the toggle value,
and add that field to the portal; this would not allow editing the field
though.

Thank you. I'll give this a try.

Another approach is to put a tab control in the layout. Put the portal
that shows the field "Graduated" on one of the tab controls, and a
portal that does not show that field on the other tab control.

But this raises a question: Do you want to limit which users can toggle
between the two? If so you ned to use a calculation or script and limit
access by privilege set.
Thank you. This works great!!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.