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

QuoteLine set DiscountAmount via Windows VB Script SuOf v7.5

Hi All

I am trying to set the DiscountAmount and DiscountPercent fields in the current QuoteLine via Windows VB Script

The QuoteLine object has a Save method but does not allow me to save anything

I resorted to updating the database via SQL, and I can see the updated value in the QuoteLine archive (via a forced refresh) BUT it does not appear to change the cached value

When I create a Quote the Quote uses the local cached value, and does not get it from the DB Quoteline table :(

How can I set the Discount Amount via VB Script in SuperOffice Windows client v7.5?

 

RE: QuoteLine set DiscountAmount via Windows VB Script SuOf v7.5

Note that if I close SuperOffice and reopen it, then the local cache is refreshed and the value I wrote to the DB with SQL is correctly displayed when I open the QuoteLine in the Windows Client

So how can I force the Windows Client to either

1. Let me update a QuoteLine via VB Script, or

2. Refresh the Window Client QuoteLine cache from the DB?

Af: Jochen Siegenthaler 17. maj 2017

RE: QuoteLine set DiscountAmount via Windows VB Script SuOf v7.5

Hi Jochen.

I am afraid that nothing has changed when it comes to COM (VB Scripting) and Quote, since my response in this post:

https://community.superoffice.com/en/developer/forum/rooms/topic/superoffice-product-api-group/crm-windows-application/scripting-quoteline/

Though we still dispatch QuoteLine events, I cannot recomment using them.
Consider the Win Quote events as non-existing.
They are neither here nor there. I do not see that Win will ever address this. I will most probably remove them sooner or later if ever I get the time to do a clean-up!

We want you to use the C# service layer events for Quote.
Conrad

Af: Conrad Weyns 17. maj 2017

RE: QuoteLine set DiscountAmount via Windows VB Script SuOf v7.5

OK thanks

I did get it to work eventually using the QuoteLineCreated event and updating the QuoteLine with an SQL command

Reworking all our VB scripts to C# is a large and impractical task at this stage so I am happy with my solution as it stands.

Af: Jochen Siegenthaler 18. maj 2017

RE: QuoteLine set DiscountAmount via Windows VB Script SuOf v7.5

Ok good. I am happy for you.
I would be interested in knowing exactly how many QuoteLine scripts and code lines you have.
Also if anyone else here is using it.

I realize there will be a entrance fee for any one moving from vb script to c# scripting but as far as Quote is concerned, it is the way to go. And remember you will then have a solution for the Web client too.

Thanks in anticipation.
Conrad

Af: Conrad Weyns 18. maj 2017

RE: QuoteLine set DiscountAmount via Windows VB Script SuOf v7.5

Hi

Our customising script contains a lot of clever functions as well as full logging and very robust error handling and error notification routines. The script can recover from all errors and continue without crashing.

We manage and validate documents, persons, projects, contacts, sales and now also quotes and quotelines.

We trigger ERP Systems, check SuperOffice data against external systems and update as required, and automate many other business functions - all in VB script.

For quotes we automatically attach the correct attachments based on the selected product and language, and also set special discounts if applicabe

We use a commonly available IDE to build and test the scripts in VBA, then convert to VBS to put into production. We also have development and test platforms for writing and testing the scripts.

The entire script module is currently 724 KB and 13,900 lines in size.

 
Af: Jochen Siegenthaler 18. maj 2017

RE: QuoteLine set DiscountAmount via Windows VB Script SuOf v7.5

Thanks. That seems quite a system. Would be great to see it once!
I was however only refering to scripts directly related to the Quote system, more specificaly the QuoteLine hooks since that is the only quote entity that still has messages dispatched.
In Win, only Quote is bound to use the netserver Quote Service layer.
The classic c++ COM model hooks in the Quote system came to be because Quote started of as a C++ only development project..
You would only have to look into C# scripting for Quote.

Conrad

Af: Conrad Weyns 18. maj 2017