Unique ID for a recognized document

  • 89 Views
  • Last Post 2 weeks ago
tvidenov posted this 3 weeks ago

Hi All,

I am looking for a way to access the document id after recognized. I need to write it in a database during the export of the data. Can anyone help?

Order By: Standard | Newest | Votes
Vladimir Dimitrijevic posted this 3 weeks ago

Hi,

Are you using custom script in a workflow stage, or export out of document definition?

 

Best regards,

Vladimir

tvidenov posted this 3 weeks ago

Well, currently i am trying with a custom script/rule for a custom field and searching for such value. If there is such value at all I should be able to get it by a rule, at least I hope so...

Vladimir Dimitrijevic posted this 3 weeks ago

Hi,

Yes, there is. If you are using "Batch processing" type of script, then you would go with:

foreach (IDocument document in Documents) {

string documentId = document.Id;

...

}

 

Best regards,

Vladimir

Ekaterina posted this 3 weeks ago

In fact, there are two different situations for the values that are written in the IDocument :: Id property.
If the documents are assembled by the layout, then IDocument :: Id is just the string representation of document's number in the batch (equals to IDocument :: Index)
If the documents are assembled by barcodes, then IDocument :: Id is the same as barcode value. In this case to get the unique number of a document a hidden property IDocument :: InternalId can be used.

tvidenov posted this 2 weeks ago

Hi Ekaterina,

 I am using FC12 for invoices if that excludes somе of the proposed solutions. 

Can I access this internalID value from a rule in Document Definition to map it to a field?

Ekaterina posted this 2 weeks ago

Hello,

Due to changes made to object model of FC12, the InternalId will not work as document index in the batch, however it will be still a unique document identifier. 

You may use Service Field "Document Number" or Context.Document.Pages[0].Id.ToString() to get document's number in the batch.

Close