2557 Views    -    16 Replies


Username Post: Portal to Portal        (Topic#211726)
Your continued generosity and support of FMForums is greatly appreciated.
Plucky 
enthusiast
Posts: 30

Post Rank (AVG):
            


FMP: 9 Advanced
OS: Mac OS X Tiger
Skill: Intermediate



Tweet This! Tweet This Post!
10-20-09 08:14 AM - Post#343103     - Post Rank:             


Hi

I have multiple portals on a layout and would like to have a
script that can copy all the rows from one portal to another.

Portal_1 is a Estimate portal.
Portal_2 is the one used for costing.
I have other portals on the layout which do not need changing.
There can be several rows in the Estimate Portal_1 so I need it to copy all rows and add these to Portal_2

any ideas.










efen 
master
Posts: 334

Loc: England
Post Rank (AVG):
            


FMP: 8.5
OS: Windows XP



Tweet This! Tweet This Post!
10-20-09 08:37 AM - Post#343105     - Post Rank:             
    In response to Plucky

There are a couple of files in this post

http://fmforums.com/forum/showtopic.php?tid/211044/post/340267/fromactivity...

that can be adapted to move all portal entries to another portal (they presently only move one row at a time)










Plucky 
enthusiast
Posts: 30

Post Rank (AVG):
            


FMP: 9 Advanced
OS: Mac OS X Tiger
Skill: Intermediate



Tweet This! Tweet This Post!
10-21-09 04:01 AM - Post#343155     - Post Rank:             
    In response to efen

Hi efen

I have it copying over individual records but cannot get it to loop all the records in the portal.












efen 
master
Posts: 334

Loc: England
Post Rank (AVG):
            


FMP: 8.5
OS: Windows XP



Tweet This! Tweet This Post!
10-21-09 11:32 AM - Post#343193     - Post Rank:             
    In response to Plucky

See if the attached helps

Attachment: move_all_portal.zip (64.13 KB) 143 View(s)












Plucky 
enthusiast
Posts: 30

Post Rank (AVG):
            


FMP: 9 Advanced
OS: Mac OS X Tiger
Skill: Intermediate



Tweet This! Tweet This Post!
10-22-09 02:13 AM - Post#343248     - Post Rank:             
    In response to efen

Hi efen

I have tried your example and it seems to keep looping on it self.

Can you try the attached example to see what i'm trying to do.
I understand the copying into variables it's just the looping bit and how it knows when to stop.



Attachment: Example.fp7.zip (8.79 KB) 123 View(s)












efen 
master
Posts: 334

Loc: England
Post Rank (AVG):
            


FMP: 8.5
OS: Windows XP



Tweet This! Tweet This Post!
10-22-09 08:01 AM - Post#343269     - Post Rank:             
    In response to Plucky

It is a never-ending loop in your file because you haven't specified when it is to stop - the Exit Loop If step is missing the "stop" - the number of rows in the portal.

You need an extra field (in my example file it is called "total")in your Orders table - an unstored calc field showing the number of related records in the portal you are transferring from (EstimateLine)

Define this total field as Count(EstimateLine::EstimateID)
Add the "stop" condition to the Exit Loop If as $counter=EstimateLine::total+1










efen 
master
Posts: 334

Loc: England
Post Rank (AVG):
            


FMP: 8.5
OS: Windows XP



Tweet This! Tweet This Post!
10-22-09 08:16 AM - Post#343271     - Post Rank:             
    In response to efen

Uh-oh
Just did this in your file, assuming it was set up like mine, but it doesn't work. Your relationships are different and you have allow creation/deletion of related records. I don't have time to look at/change this at the moment...


The "stop" should be
Exit Loop If $counter= total field +1

This works when there is more than one portal row. You need to add/amend the script to accommodate these.


Edited by efen on 10-22-09 11:23 AM. Reason for edit: change calc + text










lastpass 
novice
Posts: 23
lastpass

Post Rank (AVG):
            


FMP: 10 Advanced
OS: Windows Vista
Skill: Entry Level



Tweet This! Tweet This Post!
01-17-10 03:45 PM - Post#348555     - Post Rank:             
    In response to efen

Hi!

I have almost the same problem like Plucky had and I try efen advice but that didn't work. I set up the exit loop with 'Max ( EstimateLine::EstimateID )'.
It seems working but if I delete a portal row it can be made mistakes? Like if rows empty the loop will never ending... . And if you push copy button again the portal rows will duplicated.
Wich is the best solution for these problems? And how can I copy just the marked ones? (chekbox in the 'ordered' field).

Thank you in advance!

Attachment: Example_mod1.zip (9.33 KB) 89 View(s)



Edited by lastpass on 01-17-10 03:54 PM. Reason for edit: No reason given.










BruceR 
Pooh-Bah
Posts: 2031

Loc: Redmond WA
Post Rank (AVG):
            


FMP: 10 Advanced
OS: Mac OS X Leopard

Member: TechNet

Certified:
     

DBUG SIG

Tweet This! Tweet This Post!
01-18-10 12:12 AM - Post#348571     - Post Rank:             
    In response to lastpass

Try this. Uses auto-create relation and Resource table w/global fields.

Attachment: Example_mod1.fp7.zip (11.84 KB) 107 View(s)












RodSierra 
apprentice
Posts: 135

Post Rank (AVG):
            


FMP: 10 Advanced
OS: Cross Platform



Tweet This! Tweet This Post!
01-18-10 03:01 AM - Post#348575     - Post Rank:             
    In response to BruceR

Am I missing something here or can this be done much more simply by establishing a found set for the source of an import by using GTRR, then importing that found set in the destination table.

Other point if I need to loop thru a portal with a create option set, I test to exit the loop by checking if the key field to the relationship is empty, this will find the last portal row every time.

Don't want to derail the current discussion, sorry if I did.










lastpass 
novice
Posts: 23
lastpass

Post Rank (AVG):
            


FMP: 10 Advanced
OS: Windows Vista
Skill: Entry Level



Tweet This! Tweet This Post!
01-18-10 05:38 AM - Post#348581     - Post Rank:             
    In response to RodSierra

Thanks the answers and the file. I thought FM will be easier like it described in the homepage: "Award-winning, easy-to-use database software..." I don't understand your method (yet) but thank you very much!
I completed script with an 'If' and 'Set field' orders and I created a 'lock field' at 'orders' layout. These make it possible to pressing the button just one time. Next time will exit from script.
(attached if anyone needs and sorry for my language mistakes )

Attachment: Example_mod2.zip (12.11 KB) 104 View(s)












BruceR 
Pooh-Bah
Posts: 2031

Loc: Redmond WA
Post Rank (AVG):
            


FMP: 10 Advanced
OS: Mac OS X Leopard

Member: TechNet

Certified:
     

DBUG SIG

Tweet This! Tweet This Post!
01-18-10 09:36 PM - Post#348654     - Post Rank:             
    In response to RodSierra

  • RodSierra Said:
Am I missing something here or can this be done much more simply by establishing a found set for the source of an import by using GTRR, then importing that found set in the destination table.

Other point if I need to loop thru a portal with a create option set, I test to exit the loop by checking if the key field to the relationship is empty, this will find the last portal row every time.

Don't want to derail the current discussion, sorry if I did.


I never walk portals. And I hardly ever go to any other layout to create records - needless flashing. I consider walking portals a very bad and vulnerable idea. By using the technique illustrated in my example you have a way to select and operate on records for other purposes. By putting the globals in the Resource table the basic data tables remain uncluttered of additional global fields.

Yes, the import option would be valid also. The looping set field script allows you to have some control over what happens to each field if that is important.











lastpass 
novice
Posts: 23
lastpass

Post Rank (AVG):
            


FMP: 10 Advanced
OS: Windows Vista
Skill: Entry Level



Tweet This! Tweet This Post!
01-19-10 08:19 AM - Post#348672     - Post Rank:             
    In response to BruceR

I try to modify the example file to my own imagination but I met with some heavy difficulties and I can't figured out how can I make this:
I want to use second portal (polymer) to an other layout. And I want to polymer portal contained the estimate record ID and the new Polymer record ID.

I want to create an order database based on outgoing quotation. But some orders come directly from my partners without outgoing quotation. So I need to copy portal rows from quotations to orders and make orders independently.

Can you help me?










lastpass 
novice
Posts: 23
lastpass

Post Rank (AVG):
            


FMP: 10 Advanced
OS: Windows Vista
Skill: Entry Level



Tweet This! Tweet This Post!
02-01-10 02:08 PM - Post#349769     - Post Rank:             
    In response to lastpass

I tried many ways to copy portal rows into an other wich is in a different layer but I can not figured out how will it work. I attached a sample (based on previus files, FM10) wich has a problem: the portal rows displayed in an other record. If anyone could help me I will appreciate.



Attachment: Copy_portal_row_EN2.zip (12.62 KB) 74 View(s)












merkaba22 
master
Posts: 342

Loc: Hollywood, CA
Post Rank (AVG):
            


FMP: 10
OS: Mac OS X Snow Leopard
Skill: Advance



Tweet This! Tweet This Post!
03-01-10 06:51 PM - Post#351513     - Post Rank:             
    In response to lastpass

The example is not downloading -- is there a way to repost?
"We are the ones we have been waiting for!”

"We owe a lot to the Indians (from India), who taught us how to count, without which no worthwhile scientific discovery could have been made." - Albert Einstein.

Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do ... Explore. Dream. Discover'. Mark Twain

"Someday," Neil Young said, "the digital age will be seen as the Dark Ages of recorded sound."

"Like the Maya, we shall understand that the path to the stars is through the senses."

"Dream big -- because no matter how big that is, it's nothing compared to what you really can do".

"Using the most reliable approach for bending reality to your desires, imagination is always the key first ingredient, then by adding clear intention, expectation and action, results will be realized."














merkaba22 
master
Posts: 342

Loc: Hollywood, CA
Post Rank (AVG):
            


FMP: 10
OS: Mac OS X Snow Leopard
Skill: Advance



Tweet This! Tweet This Post!
03-01-10 09:51 PM - Post#351523     - Post Rank:             
    In response to lastpass

deleted by user

Attachment: Package1toEstimator.pdf (93.53 KB) 64 View(s)

"We are the ones we have been waiting for!”

"We owe a lot to the Indians (from India), who taught us how to count, without which no worthwhile scientific discovery could have been made." - Albert Einstein.

Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do ... Explore. Dream. Discover'. Mark Twain

"Someday," Neil Young said, "the digital age will be seen as the Dark Ages of recorded sound."

"Like the Maya, we shall understand that the path to the stars is through the senses."

"Dream big -- because no matter how big that is, it's nothing compared to what you really can do".

"Using the most reliable approach for bending reality to your desires, imagination is always the key first ingredient, then by adding clear intention, expectation and action, results will be realized."





Edited by merkaba22 on 03-02-10 11:59 AM. Reason for edit: No reason given.










Your continued generosity and support of FMForums is greatly appreciated.
merkaba22 
master
Posts: 342

Loc: Hollywood, CA
Post Rank (AVG):
            


FMP: 10
OS: Mac OS X Snow Leopard
Skill: Advance



Tweet This! Tweet This Post!
03-02-10 10:07 AM - Post#351555     - Post Rank:             
    In response to merkaba22

moved to another area
"We are the ones we have been waiting for!”

"We owe a lot to the Indians (from India), who taught us how to count, without which no worthwhile scientific discovery could have been made." - Albert Einstein.

Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do ... Explore. Dream. Discover'. Mark Twain

"Someday," Neil Young said, "the digital age will be seen as the Dark Ages of recorded sound."

"Like the Maya, we shall understand that the path to the stars is through the senses."

"Dream big -- because no matter how big that is, it's nothing compared to what you really can do".

"Using the most reliable approach for bending reality to your desires, imagination is always the key first ingredient, then by adding clear intention, expectation and action, results will be realized."





Edited by merkaba22 on 03-02-10 11:58 AM. Reason for edit: No reason given.










Icon Legend Permissions Topic Options
Print Topic

Email Topic

2557 Views
Welcome Guest...
Enter your username and password to login. If you do not have a username you can register one here

Username

Password

Remember me. Help



Forgot Password...


Quick Links
Recent Posts
Active Topics
No Replies
Recent Files
Functions & Scripts
FileMaker Pro Help
FileMaker on Twitter
FileMaker Marketplace

Custom Search

Find FileMaker Developers

Don't have time to wait,
hire a developer now!

Recent Members
Welcome them to our community!
Find FileMaker Jobs

Want a new career?
Find your new job now!

Joy of Tech
Latest Joy of Tech!

Recent Topics
Recent Hot Topics
Contribute
With your generosity we can make some real magic happen!. Support your favorite online FileMaker community...
FM Forums.com


Click here...


Or a Donation of any amount.


Thanks for your support!

Active Blogs
0 Recent blogs:
People to Post Lately in this Topic
Plucky
efen
lastpass
BruceR
RodSierra
merkaba22
FM Forums Advertisers


FusionBB™ Version 3.0 FINAL | ©2003-2010 InteractivePHP, Inc.
Execution time: 0.431 seconds.   Total Queries: 211   Zlib Compression is on.
All times are . Current time is 09:05 AM
Content ©1996-2008 Ocean West Consulting, Inc. All Rights Reserved
Ocean West Consulting, Inc. can not and will not be held responsible for any of the contents in this site.
FM Forums™ is a trademark of Ocean West Consulting, Inc an independent entity, not affiliated with FileMaker Inc.
FileMaker® is a registered trademark of FileMaker Inc.
Top