ProApp Designer - Release 14 (Package 22)

Configure Custom action for Word Generator

To generate Word or PDF documents using this generator, it can be configured as a custom action or added to CUI menus within Innovator. Below are the steps to use it via a custom action:

  1. Create a custom action on the context item type.
  2. Attach a client method that calls the server method “dg_WordDocument_GenerateDocument”. This server method internally utilizes the DocumentService from the Document Generator to process and generate the Word or PDF document.
  3. The method “dg_WordDocument_GenerateDocument” can be executed on context item, which will be used to replace the properties values in Document template.
    e.g.

  4. Additionally, a custom server method can be introduced to modify values on the context item before processing. Instead of directly invoking the ‘dg_WordDocument_GenerateDocument’ method, you can create a separate method that sets the required values on the context item. After that, the DocumentService object can be instantiated and the relevant APIs can be called.

    e.g.

    Item contextItem = inn.newItem(itemType, “get”);
    contextItem.setID(itemId);
    contextItem = contextItem.apply();

    Prorigo.Plm.DocumentGenerator.IDocumentService documentService = new Prorigo.Plm.DocumentGenerator.Aras.DocumentService(inn,CCO);
    var fileItem = inn.newItem(“File”);
    var fileId =documentService.GenerateWordDocument(contextItem,"GetDocumentAssociationJson”,false); //Boolean parameter to indicate file to be checked in to item as per configuration or not
    fileItem.setID(fileId);
    var resultItem = fileItem.apply(“get”);
    return resultItem;