14 Replies Latest reply on Oct 24, 2010 2:07 AM by LaRetta_1

    unique value in portal



      unique value in portal


      How do I prevent having twice the same value in a portal? Can I write a script for that?



        • 1. Re: unique value in portal

          Hi willem


          I suppose that you want to prevent having the same value in a field ( named field ) that you see into a portal.

          ( like if you do not want to enter the same product into an invoice more than once )


          If so, you do not need a script ...


          1) create a new text field with auto-enter option of: IDfk & field

          2) set the validation option of this new field to be unique with custom message and validate always ( also unceck the box: Allow user to... )


          ( This new field can be omitted from the layout where there is the portal )

          • 2. Re: unique value in portal

            Hi Daniele,


            I am not sure if I understand your solution.


            I know how to prevent duplicate entries in normal fields by clicking in options: unique value required. That works well.


            When I work with portals however, I can click the same related record twice or even more times in the same portal. It is still the same unique record, but it shows more than once in the portal.....



            • 3. Re: unique value in portal

              willem67 wrote:


              It is still the same unique record, but it shows more than once in the portal.....


              A portal shows related records; if there is an unique related record the portal will show only that one ( only one row ).


              But maybe that you need to explain your problem better or that I didn't understand anything.

              • 4. Re: unique value in portal

                Thank you for taking time to understand my problem!


                I my portals I use validation-lists to select my related record. That works well.


                But, I can still select that related record again, even if it is already in my portal. Of course it is the same unique record, but it does not look good.....



                • 5. Re: unique value in portal
                     I think what you're looking for is a dwindling value list. Comment gave me a link for that. It's here somewhere in this forum. I just looked for it by searching my own name, but can't find it right now. 
                  • 6. Re: unique value in portal

                    Indeed that is what it is. I need a dwindling value list. I was not sure that it was possible, but I have seen examples now.


                    I am now studying how to make conditional value lists and dwindling value lists......

                    • 7. Re: unique value in portal

                      If you are looking for a dwindling value list from Comment, try http://fmforums.com/forum/showpost.php?post/274656/


                      • 8. Re: unique value in portal

                        another very good example that I founf




                        thank you all...





                        • 9. Re: unique value in portal

                          I tried to use the above linked examples in FileMaker Pro Advanced v11.  The LaRetta linked example is the easiest to understand but I could not get it to work.  I noted in the Contacts table the field to capture the links to the unaffiliated organization has a calculation for earlier Filemaker versions.  Is there an update to this calculation for Filemaker Pro Advanced v11?  Or is there another simple scripting solution to this problem?

                          • 10. Re: unique value in portal

                            It should work fine in vs. 11.  Can you post a link to your file?  What OS are you using and have you applied the updater to 11.0v2?

                            • 11. Re: unique value in portal

                              I think my problem is that I create my data tables as external FM tables.  I my case, I essentially have the three table you show in your example in a separate FM file.  Then I have other FM files with other tables.  Finally, I have a "master" FM file that I establish the relationships to all these files as necessary.  I think my problem is the calculation for the Contact field known as "cMyOrganizationsIDs". Is there a way to replicate the calculation that you use in the "cMyOrganizationsIDs" when relationships are established to external FM tables?

                              • 12. Re: unique value in portal

                                It would make no difference; it would work the same.

                                • 13. Re: unique value in portal

                                  LaRetta:  I can set up the external FM file with the same file structure in your DwindlingVL database along with the "cMyOrgnaizationIDs" calculated field in the contacts table.  I can create the separate "master" database I described previously, to be the "working" version of my database (where I establish links to the external database tables, design layouts, scripts, lists, etc.).  That way my data tables are separate from the operating component of my overall design.  To do this, I easily copied your existing DwindlingVL database as my external tables file (thus, my database already had your data in the tables).  The only problem I have is being able to add a dwindling Organization ID in the Affiliations portal on both the Contacts layout and in my Organizations layout in my separate "master" working design.  Everything else in my layouts appear to work as they should.  Interestingly, to the degree that organizations are already noted in the affiliations portals, if I want to edit an existing organization (on the Contacts layout) or name (on the Organizations layout), I show the proper eligible dwindling list.  But I cannot move down to the next line to add another organization or name from the dwindling list.  Why would it work for an all-in-one database design (tables, layouts, etc. in the same design) but not when I separate the tables from the operating component of design?

                                  • 14. Re: unique value in portal

                                    I don't have time right now.  I would suggest that you go to the link I provided (for the dwindling value list by comment), register on that forum (FMForums.com, which is free and the best forum for FileMaker on this planet), and post your question on that thread.  :^)