6 Replies Latest reply on Apr 17, 2013 11:30 PM by GregR

    Privilege set

    GregR

      Title

      Privilege set & GetField value (OnObjectSave)

      Post

           I have a order type layout (Order Header ) that contains a portal.

           The portal contains order lines (Order Line).

           Each line can create entries in a table that are related to size (Order Line Size). These are accessed by aliases ( e.g. Order Line Size 8 ).

           If I login with a user with a privilege set the same as [Full Access] then there is a problem the $Quantity in the OnObjectSave event script.

           If I login with [Full Access] then there is no problem.

           After entering a value (OrderQuantity) in the size (not pressing Enter or Tab) and then selecting a button using the mouse that runs a script outside of the portal then the following occurs.

           Note: If I click into a field (not a button) then there is no problem.

            

           OnObjectValidate calls a script to validate the entry (with in a quantity range depending on the type of order and size).

           Values checked after the following line has executed -

                Set Variable ( $Quantity ; GetField ( $SourceTable & “::OrderQuantity” ) )

           see attachment  - first for data values

           Note: the value for $Quantity

            

           OnObjectSave calls a script to maintain some Order & Customer quantities.

           Values checked after the following line has executed -

                Set Variable ( $Quantity ; GetField ( $SourceTable & “::OrderQuantity” ) )

           see attachment - second data values

           Note: the value for $Quantity

            

           Note: The GetField problem not only occurs with OrderQuantity  but with any field in the relevant Order Line Size table.

           I'm guessing the problem has something to do with the creation of the "Order Line Size" row which appears to happen between the validate and save events.

           Any help appreciated.

      Validate%2C_Save%2C_Code.JPG

        • 1. Re: Privilege set & GetField value (OnObjectSave)
          DillipKumarMahapatra

               Hi,

               Although i am not clear about your case you have explain above...... but i can say few things. As per my understanding you might have given "Allow ceration of Record" in the portal relationship due to which when you make an entry to the Order Line portal it creates a new record in Order Line size.

               Now "Allow ceration of Record" will create a new record only when you make an entry to any field of any portal row  and click outside/ other portal row for commiting the record.

               So when you make an enrty to a portal row and without clicking outside just select a button to run a script, the record is not being commited at that time and not created also which makes problem to gather the value. Hence the GetField not works properly.

               Or if you have problem related to running the script in different privilege set other than Full Access privilege, then you can run the same script by checking "Run script with Full access privileges" extreme below to the script edit window.

               The screenshot you have attached i think is not explained properly the situation you are facing. It would be great if you can attach some more screenshot with describing the problem, help me to understand the problem properly. Any further help would be appreciated.

               Thanks

          • 2. Re: Privilege set & GetField value (OnObjectSave)
            GregR

                 Hi Dillip

                 Thanks for your comments.

                 You are correct in your statement about clicking outside of the portal row to commit the record but it does exist before committing.

                 I think the key screen shot is the "OnObjectSave" one. At the point in the scipt after the line "Set Variable [ $Quantity; Value:GetField ( $SourceTable & "::OrderQuantity" ) ]" has been executed the values for the row do exist (i.e. OrderLineRange_8::OrderQuantity) but $Quantity has no value even though GetField is calling the same data in the script.

                 With [Full Access] there is a value for $Quantity.

                 Note: I already have "Run script with Full access privileges" checked.

                 Regards

                 Greg

            • 3. Re: Privilege set & GetField value (OnObjectSave)
              GregR

                   Any other suggestions/solutions?

              • 4. Re: Privilege set & GetField value (OnObjectSave)
                GregR

                     Anything?

                • 5. Re: Privilege set & GetField value (OnObjectSave)
                  DillipKumarMahapatra

                       Hi,

                       I have a little bit of confusion in the below statement

                  >>If I login with a user with a privilege set the same as [Full Access] then there is a problem the $Quantity in the OnObjectSave event script.

                       Are you trying to say that you have created one new privilege set having same kind of access as [Full Access] privilege. And when you trying to login with that privilege you are getting the above problem. Please correct me if i am wrong anywhere.

                       If this is the case then if possible you can share your file with me. I will check with the issue by debugging it and will come back to you with the fix.

                       Thanks

                  • 6. Re: Privilege set & GetField value (OnObjectSave)
                    GregR

                         Hi Dillip

                         That is correct on the privilege set.

                         Unfortunately I can't share the code but I will try to share a cut down piece.

                         I believe that there is a problem in FMP11. The screen dumps definitely show a difference in results with the 2 privilege sets.

                         Greg