This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Using VB Msgbox Confirmation Box in the server method

Yelena - Thursday, October 1, 2009 9:07 AM:

I am trying to use a Vb Msgbox to create a Confirmation Box that when user vote 'Cancel' on the workflow , it brings up a message box which asks the user whether they wish to continue to Cancel the workflow (By Clicking Ok) or if not, by clicking on a 'Cancel' button.

The method is executed on the workflow path as a Pre methods and the code looks like this

 Dim response
   response=Msgbox("Are you sure you want to Cancel the RFQ",vbyesNo)
   If response = vbYes Then
   'continue
   Else
   Return  

 End If

Here is an error that I am getting in return:

'Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.'

Can anybody help?

Thank you,

Yelena
 

 



tstickel - Thursday, October 1, 2009 10:43 AM:

Yelena;

You are trying to make an Innovator server method display a message box on the client.  That will not be easy to do and is likely not even possible.  If this was a non-Innovator .asp application you might be able to do this (just do a Google search for ServiceNotification for examples).  One solution that will work is to look at the directory: ....ArasInnovatorInnovatorClientscriptsInBasket.  There you should find InBasket-VoteDialog.html.  This is the web page that displays the Activity Completion worksheet.

There is a function called completeActivity defined and it includes the statement  var MyPath = this.VoteList.options[selInd].text;  You could add some code after this statement that checks if MyPath = "Cancel" and if it does then execute code to display the message box and return an error if the user does not wish to Cancel.

The disadvantage to this approach is that it will do this check for "Cancel" on any workflow that has a Cancel path, not just the RFQ, unless you add more code to check that the workflow process is an RFQ.  Also you will be modifying a "core" Innovator html file and a future Innovator upgrade may overwrite your modification.



Yelena - Thursday, October 1, 2009 1:09 PM:

Terry ,

Thank you very much for fast response. I do not think it is a very good idea to change the "core". I will think about alternate solution.

Yelena