Hi,
I have a scenario where documents gets merge based on keyfield value.
In Assembly Tab I have enabled Custom script for assembly and used "AssemblingErrors.AddRedundantPageError( pageIndex );" if document is not supposed to get merge.
query -
Whenever that keyfield value is blank it throws an assembly error of -Incorrect page order. How to avoid this? Please suggests
I have a scenario where documents gets merge based on keyfield value.
In Assembly Tab I have enabled Custom script for assembly and used "AssemblingErrors.AddRedundantPageError( pageIndex );" if document is not supposed to get merge.
query -
Whenever that keyfield value is blank it throws an assembly error of -Incorrect page order. How to avoid this? Please suggests
Comments
9 comments
Could you please attach a sample project for analysis? And provide a description of expected bahavior?
Regards
Tim
If you open the batch there is a cross mark on document.
(As per my understanding -
Key Field is "Invoice Number", which is blank, due to which that cross mark has appeared)
Expected is -
If above my understanding is correct, then how to avoid that cross mark?
You can find the Assembly script in Assembly Tab - > Use Custom script for assembly - >
Thanks,
can this one. -
https://www.dropbox.com/sh/rkni3t35021088i/AAAYEt2aLkjb5wLbibg2fHFYa?dl=0
If its yet giving issues, provide me your id where I can mail you the project
Thanks,
https://www.dropbox.com/s/fzs9n5upo64cigd/AssemblyProject.rar?dl=0
I have downloaded project in the first link and tried to debug the script.
It looks like there is an error present.
This follwing check fails when processing document in the project
if( field.Text != "" && field.Text.length > 2)
So our pagesToMerge array is empty
which means this variable: var pageIsValid = false; remains false and execution proceeds to the follwoing section:
if( !pageIsValid)
{
AssemblingErrors.AddRedundantPageError( pageIndex );
}
This causes the error.
Regards
Tim
It is analyzed that if page is not marked as invalid, i.e, if none of assembly errors are added then remaining successive pages get merged, it does not remain as single page.
What I want is if key field is empty it should not exception/error.
I have tried several conditions in if (!pageIsValid) loop, but no success.
Thanks,
Regards
Tim
I tested the same, but if I put page count condition wrong merge happens.
Basically, issue is if I don't assign Assembly errors to any page then that page gets wrongly merged with some other document.
Without assembly error assigned page is treated to be mandatorily merged.
Please sign in to leave a comment.