Topic
  • 5 replies
  • Latest Post - ‏2013-01-30T12:59:54Z by SystemAdmin
Tombre
Tombre
12 Posts

Pinned topic Displaying messages in web client for an action initialization

‏2012-05-03T14:59:28Z |
I am trying the following in an action initialization

if GetSession.HasValue("_CQ_WEB_SESSION") then
errString = "As part of the Closure process, before you click Apply, you must delete all attachments that could potentially contain Patient Health Information."
Defect_Initialization = errString
Else
msgbox vbcrlf & vbcrlf & "As part of the Closure process, before you click Apply, you must delete all attachments that could potentially contain company information."
end if

I get a the message: Error from RPC server: Server error: Unexpected exception: CRMUD0082E Execution of a hook failed during the action Close. It was the ACTION_INITIALIZATION hook attached to the SPR "CISDB00049685". The reason for the failure was:
Illegal assignment: 'Defect_Initialization'

This works great in the windows client. Any help for getting it to work in the web client would be appreciated.
Updated on 2013-01-30T12:59:54Z at 2013-01-30T12:59:54Z by SystemAdmin
  • pdubovitsky
    pdubovitsky
    376 Posts

    Re: Displaying messages in web client for an action initialization

    ‏2012-05-03T15:03:58Z  
    You cannot use msgbox for Web client. What you can do is to display message in validation hook (if there are some attachments to the record) and proceed to commit on second validation attempt (when user clicked "Submit" again).

    Pavel
  • Tombre
    Tombre
    12 Posts

    Re: Displaying messages in web client for an action initialization

    ‏2012-05-03T15:13:01Z  
    You cannot use msgbox for Web client. What you can do is to display message in validation hook (if there are some attachments to the record) and proceed to commit on second validation attempt (when user clicked "Submit" again).

    Pavel
    I am not using msgbox for the Web client. The msgbox is contain in the else clause which only runs if the session is not a web session. I am concerned about the code above the "else" clause. This runs fine if called from a field hook.

    What I am trying to do is urge the user to delete certain attachments prior to saving the record but not stop them from doing so.
  • SystemAdmin
    SystemAdmin
    24948 Posts

    Re: Displaying messages in web client for an action initialization

    ‏2012-05-03T15:21:00Z  
    We've been getting RPC server errors sporatically every few months. Working with IBM to try to resolve the issue. At first they saw that we needed to increase the jvm heap size. We added memory and did that but still getting errors. We just sent a bunch more logs.

    Try restarting the server and then updating the record again and see if you still get the same error. If you don't then it's not the code.

    We've found that it's only with hooks -- hooks that in our case are not new and did not change -- that used to work and now sometimes spit out an error when trying to execute them.
    Good Luck.
  • Tombre
    Tombre
    12 Posts

    Re: Displaying messages in web client for an action initialization

    ‏2012-05-03T16:07:54Z  
    We've been getting RPC server errors sporatically every few months. Working with IBM to try to resolve the issue. At first they saw that we needed to increase the jvm heap size. We added memory and did that but still getting errors. We just sent a bunch more logs.

    Try restarting the server and then updating the record again and see if you still get the same error. If you don't then it's not the code.

    We've found that it's only with hooks -- hooks that in our case are not new and did not change -- that used to work and now sometimes spit out an error when trying to execute them.
    Good Luck.
    Thanks for suggestion, but it did not work for me. I actually think it is the code. From the action_initialization hook, is there another way to present the following:

    if GetSession.HasValue("_CQ_WEB_SESSION") then
    errString = "As part of the Closure process, before you click Apply, you must delete all attachments that could potentially contain company Information."
    Defect_Initialization = errString
    End If

    It seems to not like the "Defect_Initialization" statement. This is the same code I would use from any field hook.
  • SystemAdmin
    SystemAdmin
    24948 Posts

    Re: Displaying messages in web client for an action initialization

    ‏2013-01-30T12:59:54Z  
    Please check if there are any file attached in this record. If exist, the file name can't be too large. Change the file name and try access them again.

    It worked fine with me.