Community

Custom Script to scan station : the transmission of the batch

Hello,

I have a custom script in then scan station where the user click to send the batch.

I would like to get the name of the current batch (the one the user clicked) but i can not.


I find the property "ActiveBatch" but It does not work : me.ActiveBatch.Name?


here's what I've done yet :

nb_tot = me.Batches.count -1
nom_lot = me.Batches.item(nb_tot).Name


The variable "nom_lot" contains the name of last batch scanned but this is not necessarily the batch on which the user clicked

Another question : in my script, I stop the exportation of the batch if a condition is not true :

this is my code : me.Batches.item(nb_tot).IsExported = false

this code is OK but I would like to put a message for the user to warn that the export failed. How can i do it?

Thanks for your answers

Baltus

Was this article helpful?

0 out of 0 found this helpful

Comments

1 comment

  • Avatar
    Permanently deleted user
    Hello, this is the solution to get the name of the current batch :

    current_batch = me.ScriptItems.Item(0).Name

    And also to stop the exportation :

    me.ScriptItems.item(0).IsExported = false


    0

Post is closed for comments.