We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

VB Script not working before. Upgrade 8.0>8.5R07

Hi all,

I have this script running at a customer, but after upgradring to SO85R07, its not running as before. I changed so it runs on document.Name insted of TASK_IDX becuase task_idx was not working, but now its removing some of the hedding and now always addning the number to the heading?

Has there been some major changes to how VB scipts works on 8.5R07?

 

Sub DoSetHeader(document)
If document.Identity = 0 Then
taskId = document.Template.Id
setupId = Database.Find.FirstMatch("pv_Doc_Template_List", "pv_Doc_Template_List_id", "DOC_TMPL_ID", taskId)

If setupId <> 0 Then
'header = Database.Preferences.Get("Adwiza.EDS", "$fandimprojektnr")
header = CurrentSale.Title
document.Header = header
End If

If setupId = 0 Then
document.Header = ""
End If
End If
End Sub

Sub OnCurrentDocumentFieldChanged(field)
'If field = "appointment.TASK_IDX" Then DoSetHeader(CurrentDocument)
If field = "document.NAME" Then DoSetHeader(CurrentDocument) 'change made by Rune & Allan 14jan2020
End Sub

Sub OnDocumentDialogShown()
DoSetHeader(CurrentDocument)
End Sub

 

RE: VB Script not working before. Upgrade 8.0>8.5R07

On*DialogShown messages are no more.
See this first: https://community.superoffice.com/en/developer/forum/rooms/topic/superoffice-product-api-group/crm-windows-application/80-changes-to-the-script-events-system/

A.f.a. TASK_IDX field changed i.c. I will look into and come back to you.

/conrad

Not sure what you mean by "number", but recently a major change was introduced in to how we allocate numbers:
This is now delayed until the Save phase is running.

Typically, you will see <snum> in Our Reference.
This variable will get auto-generated (if so enabled in Admin) at Save time instead of when opening a new document dialog so as to avoid creating holes in the number allocation system.

Just so you know...

As i happens, Oct 2015 is a while back.
In the same post you wil see a reason why your TASK_IDX testing might be failing now :-)

 

Av: Conrad Weyns 3. feb 2020