Community

IDocument Repair

Hi All,

According to the help files IDocument Repair Updates the Document Definition to the latest version. I have a scenario where I'd like to update documents either when the batch is opened or when the document is opened. Can someone please give me an example of the code and where to put it within an event handler or similar?

Thanks

Richard

0

Comments

3 comments

  • Avatar
    Alexey Efremov

    Hello Richard,

    We propose the following solution:

    On the Verification Stage in the On Task Window Create event handler paste the following script:

    foreach(IDocument doc in TaskWindow.Batch.Documents) 

    {

        TaskWindow.OpenDocument(doc);

        doc.Repair();

        TaskWindow.CloseDocument(doc);

    }

    I have tested it and it updates the definitions every time the operator receives the task on Verification station. 

    Please note that this script will work in the following conditions:

    1. You are verifying the full batches.

    2. You do not use the document sets

    Otherwise the script needs modifications.

    Hope this helps.

    Alexey

     

    0
  • Avatar
    richfish

    Hi Alexey,

    Thank you for this and sorry for the delay in replying, when implementing I get error 'No overload for method repair' error message, should it have arguments?

    Thanks

    Richard

    0
  • Avatar
    Alexey Efremov

    Hello Richard.

    What is your FC version? (Project Setup Station > Help > About)

    Alexey

     

    0

Please sign in to leave a comment.