Skip to main content

We want to execute a document macro after creating from template. Follwoing procedure is supposed:

  • the document is created with class and format
  • file is copied from template
  • file is checked out
  • macro CREATENEW should be executed!

The macro is not executed. Instead the file is only opened. (document process action is set for the class, document class has macros set, CHECKIN and CHECKOUT work normal)

The Debug log shows the following lines:

CreateDocFromTemplSet(Objkey='6FB1409321FB4B0AB9881F4B51C5E937')

GetDefaultValuesForNewDocument(LuName='EngPartRevision',KeyRef='PART_NO%3D0398028%5EPART_REV%3DR01%5E',DocClass='2057',LanguageCode='de',Format='A4',DocRev='A1',DocSheet='1',OnClassChange='NO')

CreateDocument

GetLocalFileName(DocClass='2057',DocNo='1000543',DocSheet='1',DocRev='A1')

GetMacroInfo(DocClass=null,DocNo='1000543',DocSheet=null,DocRev=null,Process='CREATENEW')

GetAttachmentCount(Lu

 

With that Parameters for GetMacroInfo there is no macro found.

The question is now, why are the paramters DocClass, DocSheet and DocRev in the context have the value ‘null’.

Has anyone some hints for that?

 

Additional I have the question: Is it possible to disable the automatic document open function when creating a document from template?

 

Hi,

We discovered this problem recently as well and are working on a solution.

There is a workaround: instead of using the command New Document From Template, use the command New Document. Select the class and enter the title. Then, on the card that shows the new document, click the Edit command/button. This should download a copy of the document file template as well as run a CREATENEW macro, if available.

Perhaps you can try this and report back your findings?

Thanks!
 


Thanks very much for your hints.

Your workaround works good. The Macro is started as needed.


Thanks for reporting back, now we know it does not only work for me 🙃


Reply