11 Replies Latest reply on Jan 19, 2013 7:34 AM by JimMac

    How to set location field from previous record of user.

    PeterMontague

      Title

      How to set location field from previous record of user.

      Post

           I had a set field script that copied the location of a box of books on the previous record onto the current record. This made it easier so I would have less to enter. When I started a box I would go and put in the location manually and then use the set field script for the rest of the books. 

           But now there will be more than one user adding books to the inventory from different box locations (on a hosted database).So now I want the script to copy the location from the last record edited by that user. I know I need to

           insert Current User Name

           go to record/request/ppage

           What calculation would get me to the previous record made by that user?

        • 1. Re: How to set location field from previous record of user.
          philmodjunk

               Can you describe what you want to do in more detail and why it won't work for two or more users at the same time?

          • 2. Re: How to set location field from previous record of user.
            PeterMontague

                 My plan is that there will be maybe five of each working on good inwards in the warehouse. Each of us will be working on a separate box of books e.g. 1B1. Each of us will be logged in with our separate accounts on Filemaker Pro (this is a very expensive idea, but the 64kb limit on the text fields in Filemaker Go mean we cannot download the source codes of the webpages for scraping). Imagine if I started entering a book's details at 9:01. John starts enterering a book's details from box 15E2 at 9:02. I want to be able to use set field to copy the box number from the previous record to the current record to save me from re-entering the location. But when I start on my next record at 9:03 the previous record will be from John's box: 15E2. This can be avoided if I could go to the previous record of the same user. 

            • 3. Re: How to set location field from previous record of user.
              philmodjunk

                   Can you describe the tables and relationships involved.

                   I think you can set up a simple auto-enter calc that uses GetNthRecord to copy data from the preceding record and if each user is working from their own set of records, this won't be needed.

                   Alternatively, you'd specify the lcoation once in a parent record and just list the books in a portal as they are added to the box, you wouldn't have to enter any location, either manually or automatically. Think of your shipping list like an invoice where you specify the location once on the "Invoice" and not over and over again for each line item on the invoice. You can have a record for your "box" and by entering data in a portal, link each book to that box automatically as you pack it in the box.

              • 4. Re: How to set location field from previous record of user.
                PeterMontague

                     This query refers to the table and relationships I set up in the thread: "How to make a new sku if the product-id is new and go to related record if it product-id is already present". Should I post this query in that thread instead? 

                     The tables involved are child sku::product-id=inventory::product-id. 

                     

                          I think you can set up a simple auto-enter calc that uses GetNthRecord to copy data from the preceding record and if each user is working from their own set of records, this won't be needed.

                     Really? We're all working on a hosted database. So if I made record 1 and John made record 2 while I was making record 1 and then I made record 3 would GetNthRecord go back to record 1 for me?

                     

                          Alternatively, you'd specify the lcoation once in a parent record and just list the books in a portal as they are added to the box, you wouldn't have to enter any location, either manually or automatically. 

                     Now that sounds like a great idea. So I would set up a locations table

                     locations::skuChild=child sku::sku child. (I must change the name of those tables and fields as this could start to get confusing.)

                     I need to scrape info into about 20 different fields in child sku and check their accuracy. Could this feasibly be done through a portal?

                • 5. Re: How to set location field from previous record of user.
                  philmodjunk

                       Really? We're all working on a hosted database. So if I made record 1 and John made record 2 while I was making record 1 and then I made record 3 would GetNthRecord go back to record 1 for me?

                       Each of you would have a different found set. GetNthRecord refers to records in your current found set so the other user's found set won't affect the results that you get and vice versa.

                       I'm not clear on why you would need to scrape any data at all. Wouldn't this data have been already scraped when the book was added to your inventory? Why would you need to do this at the time you are packing a shipping box?

                  • 6. Re: How to set location field from previous record of user.
                    PeterMontague

                         I was referring to goods inwards. When we have brand new books and more copies of already current books to the child inventory.

                         

                    My plan is that there will be maybe five of each working on good inwards in the warehouse.

                          

                    • 7. Re: How to set location field from previous record of user.
                      JimMac

                           I am chiming in because it sounds like an interesting problem.  Peter, you seem to be trying to figure a way to ""work around" the classic inventory control problem, using a shared database.  I may be wrong in my assumption, but you shouldn't worry about "simultaneous" changing of the shared DB.

                           1) FMP prevents more users than are licensed.  So 5 remote stations with 2 license = maximum of 2 users.

                           2) Your "good inwards" will not update the inventory until all users "release" the shared tables and globals.  So you can't see anothers work until he commits that "good inwards" records and its related records.

                           3) There is no such thing as "simultaneous" on a shared database.  It is sequentially done by "who is on first"

                           Jim...

                      • 8. Re: How to set location field from previous record of user.
                        Sorbsbuster

                        "It is sequentially done by "who is on first".

                             To see the an explanation of that click here

                        • 9. Re: How to set location field from previous record of user.
                          PeterMontague

                               Jim I was planning on splashing out on a few one year licences on volume purchase. 

                               Also my colleague may finish record 2 and start record 3. When I start record 4 and refer back to the previous record wouldn't that take me back to record 2 - not my previous record. 

                                

                               
                                    "It is sequentially done by "who is on first".
                               
                                     
                               
                                    To see the an explanation of that click here
                               Entertaining and informative. I think I'm getting the idea. I suppose GetNthRecord can be adapted to take me to the last record I looked at. Am I right?
                          • 10. Re: How to set location field from previous record of user.
                            philmodjunk

                                 Peter,

                                 The key thing is that each user can be looking at completely independent found sets of records. Your previous record has no impact on the other user's previous record.

                            • 11. Re: How to set location field from previous record of user.
                              JimMac

                                   Peter, a found set is a "snapshot" of the db at the time your request was "sequentially" served.  That snapshot is a frozen picture, not a "movie".  The way collisions are prevented is to "lock" the records as I noted in my last response item #2.  If what I suggested is not true, Banks would go crazy trying to manage your bank account with multiple debit card users on your account using ATM machines at the same "time".

                                   If you feel worried about server management, you can write a script to "lock" all changes while each User does his thing.  Major time delays will occur in a busy server and unhappy users.  Most banks do transfers at 1am and do just that when Users are at a minimum, to avoid customer complaints.  Or with a notice that says "All deposits made before 9am will be credited before 3pm on the same day."

                                   A online bankstatement is a "found set" on your account. at that time.

                                   Good luck with "whose on first" cuz "I don't know" is on second.

                                   Jim...