1 Reply Latest reply on Mar 26, 2010 10:42 AM by philmodjunk

    Script Trigger in Portal



      Script Trigger in Portal


      I have a script that works as perscribed upon a Script Triggers execution which is: OnObject Exit when used from a date field on my current layout.


      The script is:

      If [ DayOfWeek ( GetField ( Get ( ActiveFieldName ) ) )=1 ]
      Show Custom Dialog [ Message: "Please Review..."; Buttons: “OK” ]
      Clear [ ]
      [ Select ]
      Exit Script [ Result: 0 ]
      End If


      When I placed the same script on a date field in a portal and attempted to execute it via the script trigger OnObject Exit it went to the next field on Sunday without a message popping up.I would appreciate some assistance.

        • 1. Re: Script Trigger in Portal

          If you modify the first line of your script to read: (Substitute your portal's table occurrence name for the literal text)


          If [ DayOfWeek ( GetField ( "YourPortalTableOccurrence::" & Get ( ActiveFieldName ) ) ) = 1 ]


          It will work. GetField will attempt to return the value of a field from your layout's table occurrence not the portal's table occurrence unless you specify a different table occurrence name.


          If you want to use the same script with different fields, pass the name of the field as a parameter instead of using get (ActiveFieldName)


          Parameter expression: GetFieldName (Yourtable::YourField)


          First line of your script would then be: If [ DayOfWeek ( GetField ( Get ( ScriptParameter ) ) ) = 1 ]