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

OnEditSaleClicked - Trouble - in 8.2 R6



We have a similar problem with a VB-script that works in 7.5 but not in 8.2 R6. 

The answer in this post may solve it, as in 8.3 it will be handled different.

Our Problem:

We hav a script that will create a special document when a sale is saved (the user choose a template version from a own defined list, that then maps to EXCEL-offer template)

The problem is that when a new sale is created it can have already values in currentsale. variable:
eg the gui does not have time to empty the values in a new sale before our code has run check for "orig" value in our template chooser, breaking hour logic.

When OnEditSaleClicked has finnished then the fields in the new sale are reset

I have info and Images from customer if needed, but do you understand my problem?

We want to check if we are in new sale o editing a already created sale to be able to set a variable that keeps track of what template version we have choosen and only create a document if there is no document already.

As it is now if creating a second sale in my session or if looking on sale and the try to create a new one value from that sale is wrongly fetched.

CODE to set current template

Sub OnEditSaleClicked()

                ' Set a couple of variables used elsewhere in the script

                Set QuoteTemplateField = CurrentSale.Udef.ByProgId("QuoteTemplate")

                OrigQuoteTemplate = QuoteTemplateField.Value

                ' Set certain default sale values



End Sub


CODE to create the a document when saving a new sale

Sub OnCurrentSaleSaved()

' If the sale's UD field 'Offertmall' has been changed (and is not blank) then generate and open a new document from the corresponding template

                If QuoteTemplateField.Value <> OrigQuoteTemplate And QuoteTemplateField.Value <> 0 Then

                                Set SODoc = CreateDoc()

                                Call OpenDoc(SODoc.FullPath)

                End If

End Sub




RE: OnEditSaleClicked - Trouble - in 8.2 R6

Hi Anders,
I believe this is solved in the upcoming 8.3 RO2. We will be doing the acceptance test next week so it should be out soon.
Win has made a clear break between 8.2 and 8.3 and my hands are tight a.f.a. 8.2 is concerned.
(Even a Red Alert would be hard to justify for this issue)

For a new Sale, OnEditSaleClicked will be triggered after all defaults are set:

1: 08:28:57:525 OnCurrentSaleIdentityChanged (1)
2: 08:28:57:528 OnCurrentQuoteIdentityChanged (1)
3: 08:28:57:532 OnCurrentQuoteVersionIdentityChanged (1)
4: 08:28:57:535 OnCurrentQuoteAlternativeIdentityChanged (1)
5: 08:28:57:945 OnCurrentSaleDefaults (1)
6: 08:28:58:199 OnEditSaleClicked (1)
(6) - 08:28:58:201 CreateEditSale.vbs

Observe new data message: OnCurrentSaleDefaults

I believe this will help you make the right decisions as after the Sale card is put in Edit mode the user can still trigger New Sale once more. You will then not get the Gui message but the data message:

   7: 08:29:28:907  OnCurrentSaleDefaults (1) 

Once 8.3 is out, I suggest you check your script and report back to me. Any new issues I will fix for next release.



Af: Conrad Weyns 1. jun 2018

RE: OnEditSaleClicked - Trouble - in 8.2 R6

Hi Conrad!

Thanks for the information.

We decided to go for 8.3 R1, that vesion solved our issues with this load-order for script events


Another Question that you may be able to solve:

In 7.5 the SO win client did not require the Win security right List Folder 7 / read data on the SO-ARC.
We could then effectivly hinder that users was not able to brows the SO-ARC folder.

Now in 8.3 at least we must add List Folder / read data in security tab of SO-ARC to be able to open up documents from with in SuperOffice win client. I belive it has something to do with the Locked-Folder that is created when a user edit a document that signals to other users that the document is locked for editing?

Do you have anything to say about this?? I can eleborated in Email if you like


Af: Anders Larsson 7. jun 2018

RE: OnEditSaleClicked - Trouble - in 8.2 R6

Hi Anders,

I think you want 8.3 R02. The version we have been acceptance testing this week.

A.f.a. the Folder access rights to so_arc is concerned, I suggest you make a new item here or register an issue.
Per Arne knows all about how the locking mechanism works for MS Office docs.
But there is another variable compared to 7.5: Win now uses the netserver doc-plugin.
I am not sure myself without first digging into the code. I was under the impression that our so_arc document system simply requires all rights to the so_arc content.


Af: Conrad Weyns 7. jun 2018