2 Replies Latest reply on Nov 5, 2015 4:24 AM by igu06411

    action on a request process - show different window depending on the customer


      Hi there,


      I've been trying to amend one of our existing Request processes. The process allows you to add a note via a particular window (NoteWindowA).


      I've changed the process so that when you click on the "Add Note" action, a new version of the window (NoteWindowB) is displayed instead. This window has a checkbox on it. When the checkbox is ticked, a copy of the note is emailed to the customer (Raise User). This has been tested and works fine.


      Now what I need to do is only have the checkbox to display if the customer is from a particular department.


      I tried creating a new String attribute SendNoteToCust on the Note business object with a Max Length of -1 which has an After Read calculation associated with it. I then added the attribute (and label) to the NoteWindowB but I can't get this to work. Here is the Calculation Formula:


      import System

      static def GetAttributeValue(Note):

          HideSendToCustomer = false

          if  Note.Request.RaiseUser._ADDepartment == 'External Customer':

              HideSendToCustomer = true

          return String.Format(":SetHidden(Note._SendToCustomer, {0});", HideSendToCustomer)



      All that happens is that the SendNoteToCust attribute displays on the window as a blank, read only field. The checkbox displays regardless of whether the customer is from the 'External Customer' department or not.


      I've also tried replacing the last line with:

          return String.Format(":SetHidden(Note._SendToCustomer, HideSendToCustomer);")



      Is this the correct approach, or is there a way to change the "Add Note" action to display either the original NoteWindowA or the new NoteWindowB?


      Many thanks in advance!