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

Scripting default values into the appointment dialog before it has been shown to the user

Hi everybody, i'm trying to solve a scripting assignment, where i basically promised the customer that i could alter the default values of the appointment dialog, basically altering the default appointment entity before it is being loaded into the gui. Aren't there a OnAppointmentDialogShown() event or anything similar (which doesn't seem to be recognized)? I need to alter the visible for field to being visible for a specific secondary group the associate is associated with by default, for new appointments.

I'm running SuperOffice 8 SR4

any suggestions?

 

thanks

RE: Scripting default values into the appointment dialog before it has been shown to the user

Hi Dennis,

Yes you can do that. Version 8.0 replaced all DialogShown events with a more generic evening mechanism. Here is a complete explaination of this:

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

Af: Tony Yates 11. jan 2018

RE: Scripting default values into the appointment dialog before it has been shown to the user

Try this:

------------------------------------
Sub OnViewShown( hWnd, fullPath )
    If StrComp( fullPath, "MainWindow.AppointmentDialog", vbTextCompare ) = 0 Then
        If CurrentAppointment.Identity = 0 Then
            SetDefaults()
        End If
    End If
End Sub

Sub SetDefaults()
    CurrentAppointment.Duration = 195
    CurrentAppointment.Description = "Hello world!"
End Sub
------------------------------------------

/conrad

 

 

 

 

Af: Conrad Weyns 11. jan 2018