What is the expected format when an attribute (meta -tag field) is filled in via Javascript for a 'Date' field? I've attempted both a Javascript date object AND plain text formatted as 'mm/dd/yyyy' but both throw errors. Thanks.
Date Field Format
Was this article helpful?
0 out of 0 found this helpful
Comments
10 comments
Hello,
Could you please clarify what ABBYY product are you using?
ABBYY recognition server, processing station.
Any help or answers?
Hello,
Sorry for being so late with my response.
You may look at the article “Attribute Object” from ABBYY Recognition Server Help. If it does not help to resolve the issue, please, tell us how is the tag filled and what is the exact error message that you receive.
I've tried both as a Javascript date object and as plain text. (See below). Thanks!
var d = new Date(2016,8,30);
Attributes.Item(0).Value = d;
SkipManualIndexing = false;
<Params>Indexing Script: Invalid procedure call or argument (line 8, pos 1)</Params>
<Text>Processing error: Indexing Script: Invalid procedure call or argument (line 8, pos 1)</Text>
----------------------------------------------------------------------------------------------------------
Attributes.Item(0).Value = "8/30/2016";
SkipManualIndexing = false
<Params>Indexing Script: Invalid procedure call or argument (line 8, pos 1)</Params>
<Text>Processing error: Indexing Script: Invalid procedure call or argument (line 8, pos 1)</Text>
So, any idea what Abbyy is looking for here? In the 'Help' the attribute type is defined as follows:
DAT_DateTime - Date. The enumerator value is 5.
However as stated above a JS date object throws an error. thanks again.
Hello,
Please check the size of your Attributes collection to ensure that there are elements in it.
Also, if you get a message about the 8th line that contains an error, could you please send us the full text of the script you are using, as now we can't see which line is the 8th.
Hello, Any news on that? I also have no clue about filling Document attribute of "Date" type.
Information.
Product: Recognition server 4.0
Document attributes: DocNum (Single text), DocDate (Date) {document type="sf"}
Workflow step: Indexing (script).
Script:
DocumentType = 'sf';
var dDocDate = '03.04.2018';
setAttribute( 'DocNum',"1111" );
setAttribute( 'DocDate',dDocDate);
SkipManualIndexing = true;
function setAttribute( attrName, newValue )
{
for( i = 0; i < Attributes.Count; i++ ) {
var attribute = Attributes.Item( i );
if( attribute.Name == attrName) {
attribute.Value = newValue;
break;
}
}
}
I've tried different values for dDocDate variable (as text & as date): new Date(2018,03,2), '03/04/2018' and so on.
Result: Processing error: Processing error: Indexing Script: Invalid procedure call or argument (line 11, pos 13 - selected in script as bold).
Hello,
I am terribly sorry for keeping you waiting for soo long. I have reproduced the problem both in VB script and in Jscript.
My guess is that this value is somehow read-only. I have forwarded this issue to the ABBYY HQ Moskow. I will let you know about any news regarding this.
Alexey
I am sorry for the long silence. We have created a reclamation for such behavior. The fix is planned for the version 4.0.8.71 and later.
Please sign in to leave a comment.