3 Replies Latest reply on Jul 28, 2014 6:27 AM by philmodjunk

    Swap Record-ID X with Record-ID Y



      Swap Record-ID X with Record-ID Y


           Hello everyone

           I have this Database with a lot of companies my fellow colleagues work in, each company represented with an unique record, each company/record-ID holds a lot of employees.

           Now, lets say we have Company A represented with Record-ID 1 and Company B represented with Record-ID 2.

           Under Company A, works John Doe and he is therefore created as a record under Company A.

           As time goes by, John Doe might change place of work or position, so I have to locate the Record-ID which John Doe is working and simultaneously locate the Record-ID of his new place of work or position.

           - In this case, Company A Record-ID 1 to Company B Record-ID 2, by going to layout mode, inserting field, then chage the record-ID etc. etc.


           So to my question, is it possible to place a button which is set to 'Swap' John Doe from his current Company A, to the new Company B, presuming the Record-ID of the companies are provided?

           - Without going to Layout Mode etc. etc.?


           Best regards, CR

        • 1. Re: Swap Record-ID X with Record-ID Y

               None of what you describe should be necessary nor require using layout mode.

               Your data model should be one of the two:


               Companies::__pkCompanyID = Contacts::_fkCompanyID

               In which case, moving a contact from being associated with company A to being associated with company B is a matter of assigning company B's ID (value of __pkCompanyID) to the contact's _fkCompanyID field. This would be a data entry task done in Browse mode.

               or you might have:


               To enable one company to have multiple contacts but still be able to link a contact to more than one company. In that case, the same kind of data entry update is made, but to a record in Company_Contact rather than Contacts.

          • 2. Re: Swap Record-ID X with Record-ID Y

                 Hi Phil

                 Always appreciate your fast and useful answers.

                 You're right and I might explained it, a bit too fast.

                 My data model is looking like the first you describe; Companies-----<Contacts.

            Although your right, this should be entered in Browse mode, I don't want my colleaguesto change it 'that way', since they're not familiar with FileMaker, Relationships and therefore might use it in a wrong way. 

            Therefore I would like a button, if possible, which just pops up and ask the user "Change ID to ID"  

            • 3. Re: Swap Record-ID X with Record-ID Y

                   Whether you pop up a new window, a popover or just use your current layout, switching a contact from company A to company B still comes down to using a value list of company names where you edit the _fkCompanyID field by selecting a different company from the value list.

                   You can put that field into a popover or a new window if you want, but it's the same data entry process.