Copy Portal Contents 
Author Message
 Copy Portal Contents

Hey there,

I am not too much of a newbie with FMP, however I have never had a need for
portals until now, and so I am posed with a challenge I am hoping you can
help me out with.

I'm using Filemaker Pro 5.0v3 on a PC with Windows '98.

I have a portal which displays a list of email addresses (each on a
different line of the portal) from the related file "contacts".  What I need
to do is copy the contents of every line of the portal, and paste it into
one other field, with each address being separated with ";".

I'm sure it's fairly simple, but I just can't seem to wrap my head around
it.

If any of you are able to turn on the light for me, I'd really appreciate
it.

Thanks very much,
Tash



Tue, 11 Nov 2003 05:31:31 GMT
 Copy Portal Contents

Dear Tash,
Hmm - hope someone can offer a better solution as this is one Im doing a
lot.
I script a button that either uses a Found set or use the records in the
portal.
create a Global(text) <G_names>
create a global clounter field field <G_count> (number)

setfield(G_counter,1)
Goto portal row(first
loop
If(Gcounter=1)
setfield(G-names,"yourfield")
else
setfield(G-names,G-names&","&"yourfield")
endif
setfield(G-counter,"G-counter+1")
goto portalrow(next) exit after last
endloop
endscript

put in some error checks if you like.
The global will then have a set of concatenated names of your records. Now
you can deal with the list as you will
Keep well and happy
Greg Winn


Quote:
> Hey there,

> I am not too much of a newbie with FMP, however I have never had a need
for
> portals until now, and so I am posed with a challenge I am hoping you can
> help me out with.

> I'm using Filemaker Pro 5.0v3 on a PC with Windows '98.

> I have a portal which displays a list of email addresses (each on a
> different line of the portal) from the related file "contacts".  What I
need
> to do is copy the contents of every line of the portal, and paste it into
> one other field, with each address being separated with ";".

> I'm sure it's fairly simple, but I just can't seem to wrap my head around
> it.

> If any of you are able to turn on the light for me, I'd really appreciate
> it.

> Thanks very much,
> Tash



Tue, 11 Nov 2003 08:30:17 GMT
 Copy Portal Contents
The portal is just a graphic device, and what's needed is to loop through
the found set (of the related records) and simply add the field values, plus
a delimiter (";") to a global text field ("gText") which you can then use
however you like.

In the related file ("Contacts"), create the looping script:

Set Field[gText", """"] (!-->that clears the field of any previous junk-->)
Go to Record/Request/Page[First]
Set Field["gText", "eMail_Address" & ";""]
Loop
   Go to Record/Request/Page[Exit after last, Next]
   Set Field["gText", "gText & eMail_Address" & ";""]
End Loop

The loop will stop running when it reaches the end of the found set (because
of 'Exit after last, Next').

To initiate the script, back in the parent file, create a script with the
steps:

Go to related records(Show "Contacts")
Perform Script[Sub-scripts, External: Contacts.fp5"]

The GTRR (Go to related records, using 'Show...') creates a found set, in
Contacts, of only (because of the 'Show...') the related records. Thus, when
the subscript runs, it operates across only the correct found set.

After that, you can set whatever text field you like to gText.

--

John Weinshel
Datagrace
Associate Member, Filemaker Solutions Alliance
Vashon Island, WA
(206) 463-1634


Quote:
> Hey there,

> I am not too much of a newbie with FMP, however I have never had a need
for
> portals until now, and so I am posed with a challenge I am hoping you can
> help me out with.

> I'm using Filemaker Pro 5.0v3 on a PC with Windows '98.

> I have a portal which displays a list of email addresses (each on a
> different line of the portal) from the related file "contacts".  What I
need
> to do is copy the contents of every line of the portal, and paste it into
> one other field, with each address being separated with ";".

> I'm sure it's fairly simple, but I just can't seem to wrap my head around
> it.

> If any of you are able to turn on the light for me, I'd really appreciate
> it.

> Thanks very much,
> Tash



Tue, 11 Nov 2003 08:26:34 GMT
 Copy Portal Contents
Here is a wonderful kludge that I have been making much use of lately.

Use valuelists not scripts

The valuelistitems design function will return all items of a valuelist
in a return delimited string

Then you can use a substitute calculation to replace all returns with
semicolons.

Example:

First, make a relationship "email" that returns the records you wish to
process.

Second, Make a valuelist "EmailList" that based on the relationship
"email" -- and set the values to be drawn from email::emailaddress

Create a calculated field  c.emailList

=substitute(valuelistitems(status(currentfilename),"EmailList"),"?",";")
   [returns text]
   set unstore to on.

For debugging purposes, show the c.emailList field on the layout.

The c.emailList field should contain all the email addresses of the
portal separated by semicolons. (yippee!)

Another advantage of this is that you do not have to show a portal or
run a script.

Scott

this technique is also fabulous for setting portal viewing filters as
you can access lists of records that you wish to view and modify the
local keys with various calculation functions.


Quote:

> Hey there,

> I am not too much of a newbie with FMP, however I have never had a need for
> portals until now, and so I am posed with a challenge I am hoping you can
> help me out with.

> I'm using Filemaker Pro 5.0v3 on a PC with Windows '98.

> I have a portal which displays a list of email addresses (each on a
> different line of the portal) from the related file "contacts".  What I need
> to do is copy the contents of every line of the portal, and paste it into
> one other field, with each address being separated with ";".

> I'm sure it's fairly simple, but I just can't seem to wrap my head around
> it.

> If any of you are able to turn on the light for me, I'd really appreciate
> it.

> Thanks very much,
> Tash



Tue, 11 Nov 2003 11:04:05 GMT
 Copy Portal Contents
Dear Scott,
YUMMMM - now that lateral thinking -  like it - thanks this is something
that I can make use of in a specific problem I have.  Ta muchly.
Greg


Quote:
> Here is a wonderful kludge that I have been making much use of lately.

> Use valuelists not scripts

> The valuelistitems design function will return all items of a valuelist
> in a return delimited string

> Then you can use a substitute calculation to replace all returns with
> semicolons.

> Example:

> First, make a relationship "email" that returns the records you wish to
> process.

> Second, Make a valuelist "EmailList" that based on the relationship
> "email" -- and set the values to be drawn from email::emailaddress

> Create a calculated field  c.emailList

> =substitute(valuelistitems(status(currentfilename),"EmailList"),"?",";")
>    [returns text]
>    set unstore to on.

> For debugging purposes, show the c.emailList field on the layout.

> The c.emailList field should contain all the email addresses of the
> portal separated by semicolons. (yippee!)

> Another advantage of this is that you do not have to show a portal or
> run a script.

> Scott

> this technique is also fabulous for setting portal viewing filters as
> you can access lists of records that you wish to view and modify the
> local keys with various calculation functions.



> > Hey there,

> > I am not too much of a newbie with FMP, however I have never had a need
for
> > portals until now, and so I am posed with a challenge I am hoping you
can
> > help me out with.

> > I'm using Filemaker Pro 5.0v3 on a PC with Windows '98.

> > I have a portal which displays a list of email addresses (each on a
> > different line of the portal) from the related file "contacts".  What I
need
> > to do is copy the contents of every line of the portal, and paste it
into
> > one other field, with each address being separated with ";".

> > I'm sure it's fairly simple, but I just can't seem to wrap my head
around
> > it.

> > If any of you are able to turn on the light for me, I'd really
appreciate
> > it.

> > Thanks very much,
> > Tash



Tue, 11 Nov 2003 12:11:26 GMT
 Copy Portal Contents
That worked like a charm!!  Thank you ever so much John.

Cheers!
Tash


Quote:
> The portal is just a graphic device, and what's needed is to loop through
> the found set (of the related records) and simply add the field values,
plus
> a delimiter (";") to a global text field ("gText") which you can then use
> however you like.

> In the related file ("Contacts"), create the looping script:

> Set Field[gText", """"] (!-->that clears the field of any previous
junk-->)
> Go to Record/Request/Page[First]
> Set Field["gText", "eMail_Address" & ";""]
> Loop
>    Go to Record/Request/Page[Exit after last, Next]
>    Set Field["gText", "gText & eMail_Address" & ";""]
> End Loop

> The loop will stop running when it reaches the end of the found set
(because
> of 'Exit after last, Next').

> To initiate the script, back in the parent file, create a script with the
> steps:

> Go to related records(Show "Contacts")
> Perform Script[Sub-scripts, External: Contacts.fp5"]

> The GTRR (Go to related records, using 'Show...') creates a found set, in
> Contacts, of only (because of the 'Show...') the related records. Thus,
when
> the subscript runs, it operates across only the correct found set.

> After that, you can set whatever text field you like to gText.

> --

> John Weinshel
> Datagrace
> Associate Member, Filemaker Solutions Alliance
> Vashon Island, WA
> (206) 463-1634



> > Hey there,

> > I am not too much of a newbie with FMP, however I have never had a need
> for
> > portals until now, and so I am posed with a challenge I am hoping you
can
> > help me out with.

> > I'm using Filemaker Pro 5.0v3 on a PC with Windows '98.

> > I have a portal which displays a list of email addresses (each on a
> > different line of the portal) from the related file "contacts".  What I
> need
> > to do is copy the contents of every line of the portal, and paste it
into
> > one other field, with each address being separated with ";".

> > I'm sure it's fairly simple, but I just can't seem to wrap my head
around
> > it.

> > If any of you are able to turn on the light for me, I'd really
appreciate
> > it.

> > Thanks very much,
> > Tash



Sun, 16 Nov 2003 06:25:13 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. Copy Portal to Portal

2. Copying DBGrid contents to clipboard (Or copying a table from a Data component to clipboard)

3. How to get a fields content from the last portal row

4. Q: Calculation Using Concatenated Portal Contents

5. Copying DB Contents

6. Sql script to copy table and contents to new table

7. copy contents of table to another table in different DB. (Same Server)

8. Copy SQL Server ErrorLog Contents to NT ErrorLog

9. How to clear/copy the contents of a TreeView

10. Copying contents of a record

11. Copying ttable contents to the clipboard

12. Copy Quickreport contents to clipboard


 
Powered by phpBB® Forum Software