11 Replies Latest reply on Mar 11, 2009 9:44 AM by davidhead

    This might be a tricky one...

    mgxdigital

      Title

      This might be a tricky one...

      Post

      Is this even possible?

       

      I have a field called "recoat" and it is a radio check box as of now (yes or no values)  It is in a layout called "Commissions" and whenever recoat is marked "yes" i would like to set a script trigger to show a popup box that asks if the recoat job is commissionable or not (with values yes and no)

       

      If they pick "yes" it is commissioble, then I want the script to leave the box alone, but if they mark "no" it is not commissionalbe, I would like the script to make the "commission due" field "0"...

       

      It seems simplier in my head :)

        • 1. Re: This might be a tricky one...
          mwc_1
             If you are using Filemaker 10, this is a perfect use for the new script triggers feature.
          • 2. Re: This might be a tricky one...
            mgxdigital
              

            I am using Filemaker 10, but i'm still unsure how to do all of these steps.

            Any way that someone can walk me through it?

            • 3. Re: This might be a tricky one...
              davidhead
                

              The script you need will look like this:

               

              If [Painting::recoat = "yes"]

                Show Custom Dialog ["Commission"; "Is the recoat job commissionable?" // with buttons Yes and No ]

                If [Get ( LastMessageChoice ) = 2  // user clicked No]

                  Set Field [Painting::commission due; 0]

                End If

              End If

               

              You would set this as an OnObjectModify script trigger on the recoat field. This appears to test OK for the business rules you have specified. See how it goes for you. 

              • 4. Re: This might be a tricky one...
                mgxdigital
                  

                Hey David,

                I put in everything exactly like you said and whenever I click recoat checkbox set to "yes" nothing happens. I guess something in the first steps of the script aren't working.

                Any suggestions?

                • 5. Re: This might be a tricky one...
                  davidhead
                    

                  robin wrote:

                  Hey David,

                  I put in everything exactly like you said and whenever I click recoat checkbox set to "yes" nothing happens. I guess something in the first steps of the script aren't working.

                  Any suggestions?


                  It may be to do with the use of checkboxes. You should really use radio buttons because Yes/No is an exclusive choice. 
                  Try that. If it still does not work, write back with the exact steps you followed and options you set.
                  I have a sample file I used to test the technique but unfortunately I can't post it here. :( 

                   


                  • 6. Re: This might be a tricky one...
                    mgxdigital
                      

                    I wrote the script just as you did and "recoat" is a radio button set of yes or no.

                     

                    Script is as followed:

                    If [Job Ticket::Recoat = "Yes"]

                         Show Custom Dialog ["Commission"; "Is this recoat job commissionable?]

                         If [Get (LastMessage Choice) = 2]

                             Set Field [Packing Slips::CommissionDue; 0]

                         End If

                    End If

                     

                    I've tried playing around with it alittle and now whenever I click yes or no on hte dialog box, it comes back and says that the field in not modifiable. I checked both the recoat field and commission due field and they are both open to modify. I'm not sure what to do.

                    • 7. Re: This might be a tricky one...
                      davidhead
                         What is your data structure? It seems that the Recoat field and the CommissionDue field are in different tables. What is the relationship between Job Ticket and Packing Slips? This is what happens when you don't provide all the details. ;)
                      • 8. Re: This might be a tricky one...
                        mgxdigital
                          

                        I'm sorry.

                        The Recoat field is in a Job Ticket DB and the Commissions field is in a Packing Slip DB. The relationship is via the Job Number, each Job number has a packing slip. The Commission is in the packing slip because it calculates of what is actually shipped out.

                        If there is any other info you might need, please just ask. I'm not sure how much detail to go into.

                        Thanks so much!

                        • 9. Re: This might be a tricky one...
                          davidhead
                            

                          robin wrote:

                          I'm sorry.

                          The Recoat field is in a Job Ticket DB and the Commissions field is in a Packing Slip DB. The relationship is via the Job Number, each Job number has a packing slip. The Commission is in the packing slip because it calculates of what is actually shipped out.

                          If there is any other info you might need, please just ask. I'm not sure how much detail to go into.

                          Thanks so much!


                          OK, is there an existing related packing slip record? If not, does the relationship allow creation of related records via the relationship? What version of FileMaker Pro? I am assuming 10 because you are setting up script triggers. 

                           


                          • 10. Re: This might be a tricky one...
                            mgxdigital
                              

                            Yes, there is an existing related record, whenever a job ticket is created, a packing slip is also created.

                             

                            I am using Filemaker 10.

                            • 11. Re: This might be a tricky one...
                              davidhead
                                 Can you send me a sample file - david at ulearnit dot com dot au. It will be far easier to work out what is going wrong. The basic technique works but there is something about your files that I can't see.