1 2 3 Previous Next 34 Replies Latest reply on Jun 5, 2013 8:57 AM by philmodjunk

    multiple Portal records Set variable

    henryhu91

      Title

      multiple Portal records Set variable

      Post

           Hello FM users, 

           is there a way I can set variable multiple portal records if I have more than one record in the portal setup?

           Thanks

        • 1. Re: multiple Portal records Set variable
          AppGuy

               I'm not sure if this is what you are looking for but the portal is normally set to a certain amount of rows manually.

               You can tell it to resize based on some other objects..

               This is done in the inspector..

               See the attached screenshot.

               Is this what you are looking for?

          • 2. Re: multiple Portal records Set variable
            henryhu91

                 Thanks for the reply. Unfortunately, it's not what I'm looking for. 

                 For example, If I have 6 related portal records in the setup, I would like to set variable on particular fields, 

                 now I can set variable and only able to do it the very first record field. I would like to set variable all the related records in the portal. 

                  

            • 3. Re: multiple Portal records Set variable
              AppGuy

                   Sorry I misread your question..

                   Can you please expand on what you want this variable to do?

                   You can do this several different ways.. script triggers.. conditional formatting.. and in the database..

                   Any conditions you apply to the field in the portal will replicate to portal each record automatically..

                    

                   JP

              • 4. Re: multiple Portal records Set variable
                henryhu91

                     My understanding about set variable is copy and paste to different places. 

                     The reason I would like to set variable all of the portal records for specific selected item is I want to create new records for all those portal records in another table. Please guide me if you do know. :) thank you

                • 5. Re: multiple Portal records Set variable
                  AppGuy

                       Take a look at this..  I think this is what you are looking for..

                  http://fmforums.com/forum/topic/420-duplicate-a-record-with-portal-data/

                        

                  • 6. Re: multiple Portal records Set variable
                    henryhu91

                         I dont' think it is what I need. Thanks for your time and effort JL. 

                         Here is my test database https://www.dropbox.com/sh/le59ftht52uexa9/j2i7g4TCo_

                         For example, in my database, if I am on "Laptop" record, I will be able to see child prodouts of "Laptop" in the portal and how can I set variable it so that I can create new records with those Product IDs in another table. I would like to be able to set variable all of those child products ID of "Laptop" and create new records in different table or do whatever I need to. 

                         I would appreciate if you can take a look it. Thanks 

                         Henry

                    • 7. Re: multiple Portal records Set variable
                      philmodjunk

                           Henry, your desciption of this issue: "now I can set variable and only able to do it the very first record field. I would like to set variable all the related records in the portal."

                           Has me scratching my head in confusion. What exactly do you mean by that?

                           The value in a variable is completely independent of the specific record you are on so I don't understand what you mean by that.

                           And let us know if your portal is filtered or not as that could be a factor to keep in mind here.

                      • 8. Re: multiple Portal records Set variable
                        henryhu91

                             Hi Phil, what I meant by very first record field means. 

                             in that test database, if you're on "laptop" record, you will see the child products of "laptop" in the portal setup, I'm trying to copy all the child product IDs and create new records in different table with those IDs. 

                        This is the relationship where I get the record for the portal.

                              

                             At my first attempt,  I use this step in script

                             Set Variable[$ID_Product; Value:Product to Assembly by Child ID to Product::ID_Product]

                             This step only get ID_Product of the first portal record and doesn't get the variable for the rest of the portal records.

                             The portal is not filtered and it is on Product Layout (product table). 

                             Thanks for the reply :)

                        • 9. Re: multiple Portal records Set variable
                          philmodjunk

                               Well you can loop through the portal records to acquire the ID one row at a time or you can use:

                               List ( product to assembly by Child ID::ID Child )

                               to get a list of all Child ID's for your product record as a return separated list.

                               If you loop through the child records, it's best to bring up that set of records on a layout based on the portal table and loop through them. Looping through portal rows is also possible, but a more "fragile" undertaking as later changes to the layout design or more likely to affect that method than pulling up the found set.

                          • 10. Re: multiple Portal records Set variable
                            henryhu91

                                 Thanks I will try that. 

                            • 11. Re: multiple Portal records Set variable
                              henryhu91

                                   Hi Phil I got into a challenge now and I would desperately need your help if it makes sense or not. 

                                   I've the following layout of Product from Product table.

                                   The portal setup is my BOM of current product and this is the relationship I used. 

                                   What I'm trying to do here is to order the current product which is Test-20001-000.but when we order, we usually get all the assemblies of the product which is all the child products in the portal setup. I need to write a script to add those child ID products in Order Table(a table very similar to Invoice table in Invoice db in FM starter solution). Invoice table stores the Invoice # and Invoice data stores what items are in the Invoice #. I've  Order table stores Order # and Transaction table stores what products in the Order #. 

                                   sometimes, we don't need to order all of the child products. I would like to have flexibility here and this is my idea. I am planning to create a field with check box to determine whether this child product will be included or not to order. 

                                   and after I check and choose child items, I would like to have either add these items to new Order # or existing Order number. 

                                   Which script steps do I need to include in the script? is this apporach do-able? Please help me out. 

                                   Big thanks

                                   Hope I didn't confuse you this time.

                                   Henry

                              • 12. Re: multiple Portal records Set variable
                                philmodjunk

                                     Sounds like what I am discussing in this thread: Grouping Multiple Inventory Items as One into a Portal

                                     But if you read that and have questions, come back here and post them so we don't confuse that discussion.

                                • 13. Re: multiple Portal records Set variable
                                  henryhu91

                                       I get lost following that post. I think we've very similar structure. I guess my lack of understanding in English cause me a big time in learning FileMaker and developing it at the same time. 

                                       Phil, do you think it is a good idea to create a status field to determine whether the particular child portal records will be set variable or not?

                                       can you show you example script steps of looping multiple portal records?

                                       thank you

                                  • 14. Re: multiple Portal records Set variable
                                    henryhu91

                                    I've tried this step and doesn't work at all.

                                    It only get the very first portal record and not getting set variable for the rest of the child products.

                                    Loop
                                    Set variable[$ID_Product;Value:T15j1_Products to Assembly by Parent::ID_Product]
                                    Go to Portal Row[Select; Next; Exit after last]
                                    End Loop

                                    is that because my relationship is recursive many to many relationship?

                                    1 2 3 Previous Next