Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

How can I add text to an appointment when user opens it? (AppointmentDialogShown does not seem to work anymore)

We have a customer (on SO win) who want to have a time stamp when they start typing text in an appointment.

Previous (OLD solution :) ) we solved that with an external app subscriping to applications eventes and implemented the AppointmentDialogShown.

After the customer upgraded to 8.3 (from 7.5) this event does not seem to fire any more:( 
Are application events (AppointmentDialogShown) not supported any more?

Can anyone help with a solution to automaticaly add a time stamp to an appointment when the user opens it? 

RE: How can I add text to an appointment when user opens it? (AppointmentDialogShown does not seem to work anymore)

First read this: 
https://community.superoffice.com/en/developer/forum/rooms/topic/superoffice-product-api-group/crm-windows-application/80-changes-to-the-script-events-system/

Second:
In the latest 8.3 release (not sure if it is in the last published R02, but will definately be in R04 right after the summer holidays) I have added *Defaults* messages e.g. OnCurrentAppointmentDefaults. This would be the ideal place to add your changes as it is a garantee that a new entity is about to be created.


Use the Script Events viewer to see what is happening:

 

1: 11:56:33:236 OnCurrentAppointmentDefaults (1) 
2: 11:56:33:885 OnViewPreShow (1) [VT_I4] 1839412, [VT_BSTR] MainWindow.AppointmentDialog
3: 11:56:33:888 OnViewPreShow (1) [VT_I4] 9965700, [VT_BSTR] MainWindow.AppointmentDialog.AppointmentDialogDescriptionView
4: 11:56:34:075 OnViewShown (1) [VT_I4] 1839412, [VT_BSTR] MainWindow.AppointmentDialog
5: 11:56:34:079 OnViewShown (1) [VT_I4] 9965700, [VT_BSTR] MainWindow.AppointmentDialog.AppointmentDialogDescriptionView
6: 11:56:34:084 OnEditAppointmentClicked (1)

The Script Utils menu must be enabled with a preference using Web.Admin, in Functions section:

Then restart the Win client.

Regards,
Conrad

 

Af: Conrad Weyns 16. jul 2018

RE: How can I add text to an appointment when user opens it? (AppointmentDialogShown does not seem to work anymore)

Thanks for quick reply.

I had not seen that post before - I will look into using the generic OnViewPreShow/ViewPreShow or OnViewShow/ViewShow.

Af: Morten Larsen 16. jul 2018

RE: How can I add text to an appointment when user opens it? (AppointmentDialogShown does not seem to work anymore)

Hi Conrad,

I now have had the time to look at this.

First I could not get it to work. To me it seems like the documentation for 'OnViewShown' is wrong. The documentation only mention on parameter - the 'hwnd'. But from your other post (regarding the change) I can see there is a second parameter 'fullpath'.

When I added the fullpath parameter in the sub declaration, it work :)

I found this script helpful in finding the fullpath to trigger on: 
Sub OnViewShown (hWnd, fullPath )
   SOMessageBox "Fullpath for this View: " & fullpath
end sub

 

Link to documentation:

https://community.superoffice.com/documentation/SDK/SO.COM.IApplication/html/M_SuperOffice_COM_ScriptEvents_SOScriptingEventsClass_OnViewShown.htm

Af: Morten Larsen 16. aug 2018

RE: How can I add text to an appointment when user opens it? (AppointmentDialogShown does not seem to work anymore)

Hi Morten,

Thanks for the info.
The fullPath param is the important one.
I am not 100% sure but I believe this part of the documentation is generated with some perl script parsing our c++ code.
I'll try to look into it.

If in doubt, always use the Script Event Viewer. It will never lie and show you exactly what parameters are pushed.

Regards,
Conrad

Af: Conrad Weyns 16. aug 2018