Сообщество

Random Number generation for a field

Hi,

 

I want to generate a random number for a field for each invoice document scanned.

 

Please let me know how I can handle this scenario.

 

Thank You.

 

Regards,

Vikranth

0

Комментарии

Комментариев: 2

  • Avatar
    Ekaterina

    Hello,

    If you need to generate a number and to fill the field after document definition is matched and the document is recognized, then you may use the Event Handler "After document state changed" with the condition 

    //------------------

    using ...; //list here the .Net library that will provide the random number to you

    if (ChangedStates.Has(2)) //after recognition

    {

        if (Document.HasField("Document Section 1\\<name of the field where you want to put your random number>")) //full path to your <field where you want to put your random number>

    {

            Document.Field("Document Section 1\\<name of the field where you want to put your random number>").Text = ...; //here is your random number obtained by any appropriate method you want, cast to string

    }

    }

    If you want to assign a random number to the document before the recognition, then it should not be written to a field (because fields are created on matching only), but rather to the document's registrtion parameter

    0
  • Avatar
    Sara

    Hi,

    I want to generate random number upon export of a document. It should not be  duplicate if i export the same document after some time.

    How to do this?

    0

Войдите в службу, чтобы оставить комментарий.