Dear Experts
I am trying to use table 5064-Interaction Template in Nav 2009 R2 classic with sql server to attach multiple different files/documents to for each employee in the employee. When i attach a document, it indicates YES, meaning it has been attached. When i go to a new line to attached another different file to the same employee, it replaces the previous attachment. So, it is accepting only one attachment per employee in the employee card.
Is it possible to attach multiple different documents against each employee? What am i not doing right to get many, documents attached for each employee? Thanks.
0
Answers
If you are developing it then be more specific please, describe your solution, maybe include some code.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
The only thing I can say at this stage is that the documents (the actual document files) are normally stored in T5062 Attachment table, which usually works in conjunction with the T5065 Interaction Log Entry table. You can find a set of useful functions in the Attachment table which you could use to import document files, or view already imported ones.
Using table 5064 Interaction Template for that does not seem right here. It can be a part of your solution where you could group all documents related to Employee table under single template code, but since you have not revealed any details I can't really tell much about your design and use of the Interaction Template table
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
OnInsert()
OnModify()
OnDelete()
InteractTmplLanguage.SETRANGE("Interaction Template Code",Code);
InteractTmplLanguage.DELETEALL(TRUE);
OnRename()
Code - OnValidate()
Code - OnLookup()
Interaction Group Code - OnValidate()
Interaction Group Code - OnLookup()
Description - OnValidate()
Description - OnLookup()
Unit Cost (LCY) - OnValidate()
Unit Cost (LCY) - OnLookup()
Unit Duration (Min.) - OnValidate()
Unit Duration (Min.) - OnLookup()
Information Flow - OnValidate()
Information Flow - OnLookup()
Initiated By - OnValidate()
Initiated By - OnLookup()
Attachment No. - OnValidate()
Attachment No. - OnLookup()
Campaign No. - OnValidate()
Campaign No. - OnLookup()
Campaign Target - OnValidate()
Campaign Target - OnLookup()
Campaign Response - OnValidate()
Campaign Response - OnLookup()
Correspondence Type (Default) - OnValidate()
IF NOT Attachment.GET("Attachment No.") THEN
EXIT;
ErrorText := Attachment.CheckCorrespondenceType("Correspondence Type (Default)");
IF ErrorText <> '' THEN
ERROR(
Text003+ErrorText,
FIELDCAPTION("Correspondence Type (Default)"),"Correspondence Type (Default)",TABLECAPTION,Code);
Correspondence Type (Default) - OnLookup()
Date Filter - OnValidate()
Date Filter - OnLookup()
No. of Interactions - OnValidate()
No. of Interactions - OnLookup()
Cost (LCY) - OnValidate()
Cost (LCY) - OnLookup()
Duration (Min.) - OnValidate()
Duration (Min.) - OnLookup()
Language Code (Default) - OnValidate()
IF NOT InteractTmplLanguage.GET(Code,"Language Code (Default)") THEN BEGIN
IF CONFIRM(Text004,TRUE,InteractTmplLanguage.TABLECAPTION,"Language Code (Default)") THEN BEGIN
InteractTmplLanguage.INIT;
InteractTmplLanguage."Interaction Template Code" := Code;
InteractTmplLanguage."Language Code" := "Language Code (Default)";
InteractTmplLanguage.Description := Description;
InteractTmplLanguage.INSERT;
END ELSE
ERROR('');
END;
CALCFIELDS("Attachment No.");
Language Code (Default) - OnLookup()
InteractTmplLanguage.SETRANGE("Interaction Template Code",Code);
IF FORM.RUNMODAL(0,InteractTmplLanguage) = ACTION::LookupOK THEN BEGIN
"Language Code (Default)" := InteractTmplLanguage."Language Code";
END;
Wizard Action - OnValidate()
Wizard Action - OnLookup()
Ignore Contact Corres. Type - OnValidate()
Ignore Contact Corres. Type - OnLookup()
Table Name - OnValidate()
Table Name - OnLookup()
Line No. - OnValidate()
Line No. - OnLookup()
The above is the code in the interactive template table.
I am using the Interaction Template table to store the documents associated to each employee. I use the interactive template form and link it to the employee card. I use the interactive template form to import the documents to attach them to each employee, but it is only attaching one file to each employee and does not allow more than one file/doc. to be attachment to each employee. My question is how can i have this form attach more than one document to each employee?
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
From your answers/symptoms I am guessing that you link records in those tables by storing Employee No. in the Interaction Template table in Code field.
The trouble with this solution is that the Interaction Template table has a simple primary key - the Code field alone. If you do link Employee and Interaction Template by storing Employe's No. in the Code field in Interaction Template table you are creating 1 to 1 relation between these two tables. One Employee record = one Interaction Template record. It is not going to be any different.
You need to use a different table to store many documents against one Employee record, and probably a bit of C/AL coding skills to link the two things together
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Field Type Value
Code CONST
Code FIELD Employee No.
which results to the follow:
RunFormLink = Code=CONST(),Code=FIELD(Employee No.)
You are right, my solution creates a one to one relationship between the two tables. So any hints on how to code this then? Thanks.
The Interaction Log Entry table has already Document No. field which you could use. The Interaction Log Entries page offers you Show function to view attached documents, but you would need to write part inserting a new document into Attachment table, and linking it to the new Interaction Log Entry record.
The Attachment table has no 'front end' - you would need to add a page showing linked entries.
Look into both tables, analyse code in them, learn how they work, how they handle standard NAV interactions/attachments and you will be able to reuse a large part of existing code.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03