2 Replies Latest reply on Oct 3, 2011 2:15 PM by schnook

    Script Help?????????

    schnook

      Title

      Script Help?????????

      Post

       G'day all

      Am missing something in this script.

      What i am trying to do is If the From field is not = to VMR466 i would like the To field to have VMR466 entered automatically. This is what i have got so far.

       

      If [NEW RADIO LOG:: From (not = to (the little = sign with the stroke through it) "VMR466"

      Set Field {NEW RADIO LOG::To; "VMR466"]

      End If.

      Now this partly works except VMR466 is still entered into the To field if the From field has VMR466

      I think it is because it is a Set Field thing is that wright?

      Any help would be great.

       

      Regards

      schnook

       

       

        • 1. Re: Script Help?????????
          LaRetta_1

          Hi schnook,

          If the field is being set anyway then the If[] is not properly evaluating but it looks correct as listed.  Is NEW RADIO LOG a related table? If the record being set is a related field, your current table can only see the first related record and will set that. 

          Anyway, if you do not have Advanced, you can use Custom Dialog[] to see what error is thrown.

          If [NEW RADIO LOG:: From (not = to (the little = sign with the stroke through it) "VMR466"
          Set Error Capture [ On ]
          Set Field [NEW RADIO LOG::To; "VMR466"]
          Show Custom Dialog [ OK ; Get ( LastError ) ]
          End If

          ... Check your Set Field[] step.  Set Field[] has two parts and it is one of the most normally mis-specified script steps.  The first part Specify Target Field (and here you select the field to set) and the second part, Calculated Result (and here you only type the calculation of "VMR466").  I might also suspect that something else is in the field, such as a space (which will throw off the match).

          • 2. Re: Script Help?????????
            schnook

            Hi LaRetta

            I worked it out, what i did was to select on exit in the script trigger and it worked. Thanks for the reply once again. You have a great day.

            Regards

            schnook