Using local exchange server

  • 270 Views
  • Last Post 29 December 2020
Andre Dias posted this 08 December 2020

Hi everyone,

i've built a workflow to filter through scanned documents (our daily papermail) and find the correct recipient. Now I'm trying to automatically send the recipient an e-mail with the scanned pdf as an attachment. The workflow does what it's supposed to but i'm having trouble using our local exchange 2016 server to send the email. Since the attachments are confidential i can't use a public provider for this.

I always get the error: "Das Benutzerkonto, das zum Übermitteln der Anforderung verwendet wurde, ist nicht berechtigt, E-Mail im Auftrag des angegebenen sendenen Kontos zu senden. Die Nachricht kann nicht übermittelt werden." - Which pretty much translates to: the account you're using to send the request doesn't have the necessary privileges to send e-mails on behalf of the used account. message can't be send.

 

Is this something i need to adress on the exchange server or can i do something within scanshare? I've tried our admin account to send the email too with no success.

Edit: Nevermind, I've figured it out 1 minute after hitting send. After trying for over an hour..

 

But while i'm here i've got another question. The way i'm doing the recognition is by scanning a barcode.

The barcode has to fit into a specific size so i'm pretty limited by the characters i can use. Is there a way to add a script to for example do:

if (barcode  == abreviation) {

barcode = full name;

}

and then use that + domain as the recipient?

Order By: Standard | Newest | Votes
luca.scarpati posted this 11 December 2020

Hi Andre,

 

do you need to add more content to the variable %BARCODE%? right?

If yes you can do it directly maybe checking with the triggers and adding different fields into mail connectors depending on the valid trigger.

Otherwise you can update the variable directly in a script without using a triggers, maybe check out our "Sample & Materials" section for some example script.

 

Have a nice day!

 

Best regards,

Luca

Andre Dias posted this 11 December 2020

Hi Luca, thank you for replying.

I have barcode labels which are pretty small. Therefore i can't fit too much information on there.

Since i'm doing the e-mail adress by stitching together the %barcode% variable + domain i'm pretty lost at what to do with long names. I was hoping for a way to manipulate the variable depending on set abreviations which i could then store on the barcode.

Somewhat like this:

if (%barcode%  == luca) {

%barcode% = luca.scarpati;

}

so that i can then use luca.scarpati@scanshare.com as the recipient.

luca.scarpati posted this 11 December 2020

Hi Andre,

 

more than welcome!

Your case is very easy and there are various ways to do it as always in Scanshare cool.

For the script, you need something like this:

   MyBarcode = Metadata.Values("BARCODE")

   'some other line....

   If (MyBarcode = "luca") Then

       MyBarcode = luca.scarpati

    '...other conditional case

   End If

   Metadata.SetValues("MYBARCODE", MyBarcode )

 

...in this case you can use the variable %MYBARCODE% into your Mail Connector field/fields.

Obviously this is just an example piece of code but you can find other examples in the category suggested in the previous message.

 

 

Best regards,

Luca

Andre Dias posted this 11 December 2020

Hi Luca,

my script looks like this:

MyBarcode=Metadata.Values("%BARCODE01%")

If (MyBarcode = "fe") Then

MyBarcode = andre.dias

End If

Metadata.SetValues("MYBARCODE", MyBarcode )

 

The process gets stuck for a few minutes and then just stops. Any ideas?

I want the Variable "%Barcode01%" which becomes fe to become andre.dias.

 Debugging this is pretty tedious since it's doesn't log any errors. But it stops the other jobs from running so i have to restart every process manually.

 

 

luca.scarpati posted this 14 December 2020

Hi Andre,

 

if you check the process logs I think you will find a crash of the VBS component because your script is wrong.

Your script is structurally similar to the one above but it is incorrect in this line (if you read in our manual in our CALL you don't need to insert the "%" but only the variable name):

YOUR -> MyBarcode = Metadata.Values("%BARCODE01%")

SUGGESTED -> MyBarcode = Metadata.Values("BARCODE")

 

Again please refer to our category Sample & Materials, you will find them examples of scripts already made and you can't go wrong with the various .vbs or .js CALL.

 

Have a nice week.

 

Best regards,

Luca

Andre Dias posted this 15 December 2020

 This is the log:

2020-12-15 13:44:09:605 | Information | Starting barcode recognition
2020-12-15 13:44:09:605 | Detailed | Loading Barcode
2020-12-15 13:44:09:621 | Detailed | Loading Barcodes
2020-12-15 13:44:09:637 | Detailed | Barcode found:  Type= 'Code128', Value= 'fe', on page= 1
2020-12-15 13:44:09:652 | Debug | Recognition completed in 37 milliseconds
2020-12-15 13:44:09:652 | Information | Barcode recognition completed
2020-12-15 13:44:09:699 | Detailed | Executing trigger, id: 144, type: tr_SCRIPT
2020-12-15 13:44:09:699 | Detailed | Executing script
2020-12-15 13:45:09:770 | Debug | BarcodeReader.BarcodeReader_HomeController.Index(wm_9)
2020-12-15 13:45:09:770 | Detailed | Loading Barcode
2020-12-15 13:45:09:898 | Debug | BarcodeReader.BarcodeReader_CoreController.Viewer()
2020-12-15 13:45:10:192 | Debug | BarcodeReader.BarcodeReader_CoreController.GetAll()
2020-12-15 13:45:10:192 | Detailed | Loading Barcodes
2020-12-15 13:45:1001 | Debug | BarcodeReader.BarcodeReader_CoreController.List()
2020-12-15 13:45:11:489 | Debug | BarcodeReader.BarcodeReader_CoreController.Load()
2020-12-15 13:45:15:744 | Debug | BarcodeReader.BarcodeReader_CoreController.Config(0)
2020-12-15 13:45:19:601 | Debug | BarcodeReader.BarcodeReader_CoreController.SaveRule(0)
2020-12-15 13:45:19:851 | Debug | BarcodeReader.BarcodeReader_CoreController.List()
2020-12-15 13:45:20:867 | Debug | BarcodeReader.BarcodeReader_HomeController.Save()
2020-12-15 13:45:20:883 | Detailed | Updating barcodes

 

It just stays that way for multiple minutes until i stop the process manually.

At least that's something different now that i updated the script.

luca.scarpati posted this 15 December 2020

Hi Andre,

 

Sorry but I think there is a bit of confusion, you are using a trigger script not a script connector eheheheh smile as seen from the small log above.

The Script trigger expects a RESULT as return value and not the creation of variables in it.

 

I think that for your specific case you need to contact our support and provide more information, maybe your example workflow and your script they will surely be able to help you.

 

Best regards,

Luca

Andre Dias posted this 15 December 2020

Haha, you are correct. Apperently i forgot to select that connector during the installation so that was the only script component i could fine. Is there an easy way to add the connector without reinstalling?

Thank you very much!

luca.scarpati posted this 15 December 2020

More than welcome Andre,

 

mmm maybe if you don't see it due to be the license you have doesn't contain it (just for info the Script is only available in the Enterprise version). 

Obviously if you have done a custom installation, you can add the missing modules by double clicking on the installer again and click modify: 

 

Best regards,

Luca

Andre Dias posted this 22 December 2020

Hi all,

i've installed the script connector and added in my script. Sadly seeing the same issue as before. The workflow just stays at "Executing script".

2020-12-22 08:52:27:043 | Detailed | Loading watch folder: wm_0
2020-12-22 08:52:27:043 | Detailed | Found 1 total files to process for this session
2020-12-22 08:52:27:043 | Detailed | Found a file to process: C:\ScanTemp\Eingangspost\FE.pdf
2020-12-22 08:52:27:043 | Information | Creating backup of original file
2020-12-22 08:52:27:043 | Information | Starting workflow process on the document (Eingangspost + Script)
2020-12-22 08:52:27:059 | Debug | Loading Imaging engine
2020-12-22 08:52:27:059 | Debug | Loading Imaging engine succeeded.
2020-12-22 08:52:27:059 | Information | Document format: RasPdf
2020-12-22 08:52:27:059 | Detailed | Loading Barcodes
2020-12-22 08:52:27:168 | Detailed | Found 1 total triggers
2020-12-22 08:52:27:168 | Debug | BuildProcessPath>> End module: wm_25 [E-mail]
2020-12-22 08:52:27:168 | Debug | BuildProcessPath>> wm_25 --> wm_1 [Windows File System] @@ [wm_25,]
2020-12-22 08:52:27:168 | Debug | BuildProcessPath>> wm_1 --> wm_27 [Script] @@ [wm_1,]
2020-12-22 08:52:27:168 | Debug | BuildProcessPath>> wm_27 --> wm_9 [Barcode Reader] @@ [wm_27,]
2020-12-22 08:52:27:168 | Debug | BuildProcessPath>> wm_9 --> wm_0 [Watch Folder] @@ [wm_9,]
2020-12-22 08:52:27:168 | Detailed | Found '1' document paths
2020-12-22 08:52:27:168 | Detailed | Travelling path #'1'
2020-12-22 08:52:27:168 | Debug | Executing path, source: wm_0, target: wm_9
2020-12-22 08:52:27:168 | Debug | Executing path, source: wm_9, target: wm_27
2020-12-22 08:52:27:168 | Debug | Getting Image for page number: 1
2020-12-22 08:52:27:184 | Debug | Current Memory usage: 149Mb, Working Set: 170Mb
2020-12-22 08:52:27:621 | Information | Starting barcode recognition
2020-12-22 08:52:27:637 | Detailed | Loading Barcode
2020-12-22 08:52:27:637 | Detailed | Loading Barcodes
2020-12-22 08:52:27:652 | Detailed | Barcode found:  Type= 'Code128', Value= 'fe', on page= 1
2020-12-22 08:52:27:652 | Debug | Recognition completed in 18 milliseconds
2020-12-22 08:52:27:652 | Information | Barcode recognition completed
2020-12-22 08:52:27:652 | Debug | Executing path, source: wm_27, target: wm_1
2020-12-22 08:52:27:652 | Debug | Starting connector: Script
2020-12-22 08:52:27:684 | Debug | Creating output document for connector
2020-12-22 08:52:27:699 | Debug | Generating file: firstpage=1, lastpage=1
2020-12-22 08:52:27:699 | Debug | Loading connector: Script
2020-12-22 08:52:27:699 | Debug | Executing connector's STORE command
2020-12-22 08:52:27:699 | Detailed | Executing Connector(s)
2020-12-22 08:52:27:699 | Detailed | Parsing connector settings
2020-12-22 08:52:27:715 | Detailed | Parsing variables
2020-12-22 08:52:27:715 | Information | Executing script

I let it stay at that last step for ~10 minutes with no change.

The workflow reads the barcode "fe" into the variable BARCODE01. Then it runs my script and gets stuck. I wan't the script to swap the "fe" for "andre.dias" The E-Mail connector uses the MYBARCODE variable to find the correct recipient.

This is my script:

MyBarcode = Metadata.Values("BARCODE01")

   If (MyBarcode = "fe") Then

       MyBarcode = andre.dias

   End If

   Metadata.SetValues("MYBARCODE", MyBarcode )

Screenshot

luca.scarpati posted this 28 December 2020

Hi Andre,

 

sorry but have you tried to execute the script without using Scanshare? To do this, just remove the CALL from our SDK and double click. Does it work? does not give any error?

 

From what I see your script above still has some errors, for example:

MyBarcode = andre.dias -> I don't think it's allowed in VBS, strings always like this:  

      MyBarcode = "andre.dias"

Again are you sure that use a correct CALL, so for the add the value of variable you need for example:

Metadata.SetValues("MYBARCODE", MyBarcode ) -> I don't know if you copy/paste it wrong or not, but are you sure you add call at the beginning of this line? The correct line should be:

      call Metadata.SetValues("MYBARCODE", MyBarcode)

 

Please check the other scripts in the section suggested above or contact our support for any specific issues.

 

Best regards,

Luca

Andre Dias posted this 29 December 2020

Hi luca, sorry i just can't get it to work. I've tried every scenario i could think of.

Now i've pretty much given up on the script. I've already wasted too much time on this.

This is the script i was using.

MyBarcode=Metadata.Values("BARCODE01")

If (MyBarcode = "fe") Then

MyBarcode = "andre.dias"

End If

call Metadata.SetValues("MYBARCODE", MyBarcode)

The barcode used to test was fe - the path was \\APPl\Trigon\Eingangspost\%MYBARCODE% - the email was %MYBARCODE%@domainname.com. The steps in the workflow i posted a few days ago remain the same.

Using %MYBARCODE% as variable for the document name always resulted with the string %MYBARCODE% beign used as the name. Same for the e-mail.

luca.scarpati posted this 29 December 2020

Hi Andre,

 

I think this conversation has become too long smile and it is useless for the forum because at this point I think the problem is specific to your case.

Please as already said several times send us a complete export (not image) of your current workflow, the current script and example document with initial barcode to our support. They will surely know how to help you in the best way cool.

 

Best regards,

Luca

Close