CRM Word Doc to Add New Fields

mikehmikeh Member Posts: 3
When creating Word documents for use as attachments in Relationship Management, you can open the attachment document in Interaction Templates, and modify the document. The list of Navision fields is predetermined with many fields from Contact table, Salesperson table and some others.
I was able to add a line in the Codeunit 5054 WordManagement that added a new field on the Word document field list. However, it did not print successfully. Rather, it pushed all the other fields following my code down one, as if I did not add it somewhere else. I can't see where else it would go.

Has anyone successfully added fields to the Navision field list for Word document interactions? If so, how?

Comments

  • sggsgg Member Posts: 109
    if you want to add the field Contact."Correspondence type" for example,
    Your Modifications Should Include The following Functions:

    1. ExecuteMerge : Add the following:
    AddField(format(Contact."Correspondence type"));

    2. ShowMergedDocument :
    AddField(FORMAT(Contact."Correspondence Type"));

    3. CreateHeader
    AddField(Contact.TABLECAPTION + ' ' + Contact.FIELDCAPTION ("Correspondence Type"));


    Make sure that you Put the Codes to insert the field in the right place in EACH of the Functions.



    Sgg
    Sunday, Godwin G
  • mikehmikeh Member Posts: 3
    An interesting twist: I added the Interaction Log Entry field Description. This field is already listed with AddField code in the function ExecuteMerge. But the data pulled into the Word doc from the wrong fields. Following your advice, I added it again (same as the existing code) in ExecuteMerge in a location consistent with the AddField code added in CreateHeader, and the data now pulls from the correct fields into the Word doc.

    Thank you. :D

    mikeh
  • sggsgg Member Posts: 109
    As You can see, the issue is in the
    Consistency of the Location where you are inserting the field(s).

    And that you Insert in ALL the functions where the field(s) will be used.
    Sunday, Godwin G
  • postacipostaci Member Posts: 116
    I am also trying it, but after that I am getting this message !!

    I can not save it, because it sais: The selected typelibrary cannot be loaded??

    dutch: de geselecteerde typebibliotheek kon niet geladen worden !!
    :shock:
Sign In or Register to comment.