7 Replies Latest reply on Aug 21, 2009 3:29 PM by etripoli

    Locking Product Numbers

    dinora

      Title

      Locking Product Numbers

      Post

      I sell tours, these tours can be operated by different suppliers so I have a table that contains all my tours for each city in each country then I have a table that has suppliers - I have yet a third table that gets connects suppliers to tours - The tour number is defined by Country Code, City Code -  Operator Number + Tour number

       

      For example Buenos Aires Argentina, Operator 1 tour 1 will be ARBUE-0101 and then number 2 ARBUE-0102 - Assuming Operator 1 is the supplier to tour number 2 etc etc

       

      A script is automatically creating the tour numbers, so under the operators table I have a portal where I can choose the tours and the number gets assigned based on the concept explained above

       

      My problem is that when you go back to a portal row and click on the drop down arrow for the tour, then the tour number changes and takes the tour number of the last tour number created

       

      So if we follow the example above tour number 3 will be ARBUE-0103 - But if I then go to tour number two and click on the drop down field to see tours it will update tour number two to be the same number as tour number 3 so I will end up with two tours ARBUE-0103

       

      If I then go and allocate a new tour it will allocate to tour number 4 but then if I go to number 3 and click on the field for tour selection then tour number 3 becomes 4

       

      The field that has the script to create numbers is the drop down field where I see the selection of tours to allocate

       

      I need to lock this field or edit the script so that once a tour is allocated, that portal row is locked and the tour number does not change

       

      Thanks in advance for your help

        • 1. Re: Locking Product Numbers
          etripoli
            

          I'm thinking that there is a problem in your layout/relationship design, and without screenshots or a sample DB, it will be tough to troubleshoot.  That said, you say 'a script is automatically creating the tour numbers', but it really sounds like the IDs are created by a calculation.

           

          So, on the Operators layout, you have a portal based on Supplier_Tours (guessing at the name), but it's not clear what fields are in the portal to allow you to specify the City & Country.  And why is there a drop-down menu for the tour number?  What type of drop-down is it, and where are the items coming from?

           

          Then again, maybe none of this matters, and you just need to set the Country-City-Supplier-Tour ID to 'Prohibit modification of value during data entry', and on the Validation tab, uncheck 'Allow user to override during data entry' & check 'Unique value'.

          • 2. Re: Locking Product Numbers
            dinora
              

            Well the ID is created by a calculation so the tour in Buenos Aires, Argentina ARBUE is created by a calculation but then you have the counting of the tours 01,02,03 being done by a script.

             

            You are correct On the operator layout I have a portal that shows me the Supplier_Tours table - the fields in this portal that I specify are city name, and tour name which is a drop down selection that is coming from the tours table where I enter all tours

             

            I am not sure if the below applies as the field is calculation so I don't know hos to prohibit modification during data entry or any of the below listed.

             

            "Then again, maybe none of this matters, and you just need to set the Country-City-Supplier-Tour ID to 'Prohibit modification of value during data entry', and on the Validation tab, uncheck 'Allow user to override during data entry' & check 'Unique value'."

             

            Thanks in advance for your help

            • 3. Re: Locking Product Numbers
              etripoli
                

              I was hoping the Country-City-Supplier-Tour ID was an auto-enter text field using a calculation, or script.  This would keep it from being changed.  Otherwise, if it remains a calculation, you'll need to set the fields it is based on to 'Prohibit modification'.

               

              One thing I'm still not sure of, and that is exactly which field you are clicking on, 'when you go back to a portal row and click on the drop down arrow for the tour.'  Why would the tour need to be selected in the portal after it is created?

              • 4. Re: Locking Product Numbers
                dinora
                  

                thanks your response

                 

                You say

                 

                "I was hoping the Country-City-Supplier-Tour ID was an auto-enter text field using a calculation, or script.  This would keep it from being changed.  Otherwise, if it remains a calculation, you'll need to set the fields it is based on to 'Prohibit modification'."

                 

                How do you set this field to prohibit modification once it is created/

                 

                You say

                 

                "One thing I'm still not sure of, and that is exactly which field you are clicking on, 'when you go back to a portal row and click on the drop down arrow for the tour.'  Why would the tour need to be selected in the portal after it is created?"

                 

                You really should not have to go back to that portal row once the tour is created but the fact is that if I go as this is how I discovered the error and I click on the drop down for any reason then it re-syncs the tour number and I get the problem

                 

                Let me know if you can help

                thanks

                 

                 

                 

                 

                 

                • 5. Re: Locking Product Numbers
                  etripoli
                     Are you using FMP10 or 9?  If 10, is there a script associated on the drop-down box?  I guess it's still not clear to me hwo a script is involved in setting the tour numbers, since something must trigger the script to perform.
                  • 6. Re: Locking Product Numbers
                    dinora
                      

                    I am using FM 10 and yes there is a script associated with the drop down field to count the tours 01 02 03 etc

                     

                    • 7. Re: Locking Product Numbers
                      etripoli
                         Is it possible that the script is changing the value when you click it again?  Try modifying the script to exit if the field already contains a value.