diff --git a/entity/DocumentTemplateLink_entity/DocumentTemplateLink_entity.aod b/entity/DocumentTemplateLink_entity/DocumentTemplateLink_entity.aod
index 21fbf86b1a5f37920f4b92b7435be1cf584068f5..8f3f448246d2b84f1b5e5dec220721c3c667e99d 100644
--- a/entity/DocumentTemplateLink_entity/DocumentTemplateLink_entity.aod
+++ b/entity/DocumentTemplateLink_entity/DocumentTemplateLink_entity.aod
@@ -81,8 +81,18 @@
           <name>DocumentId_param</name>
           <triggerRecalculation v="true" />
         </entityParameter>
+        <entityParameter>
+          <name>Type_param</name>
+          <triggerRecalculation v="true" />
+        </entityParameter>
       </children>
     </entityProvider>
+    <entityParameter>
+      <name>Type_param</name>
+      <expose v="true" />
+      <triggerRecalculation v="false" />
+      <description>PARAMETER</description>
+    </entityParameter>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
diff --git a/entity/DocumentTemplateLink_entity/entityfields/attachments/children/documenttemplatetype_param/valueProcess.js b/entity/DocumentTemplateLink_entity/entityfields/attachments/children/documenttemplatetype_param/valueProcess.js
index 68704076d059e799a31deef4fe9b0ae6971c1a52..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/entity/DocumentTemplateLink_entity/entityfields/attachments/children/documenttemplatetype_param/valueProcess.js
+++ b/entity/DocumentTemplateLink_entity/entityfields/attachments/children/documenttemplatetype_param/valueProcess.js
@@ -1,5 +0,0 @@
-import("system.vars");
-import("system.result");
-if(vars.getString("$field.TYPE") == "ATT"){
-    result.string("$field.DOCUMENTTEMPLATEID");
-}
\ No newline at end of file
diff --git a/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/stateProcess.js b/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/stateProcess.js
index 1e6f365bf258032e33e2cf832dae7d6d3a37c449..e2ebc8de0adefb916e5dd47ec8c36e2d0b7d7842 100644
--- a/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/stateProcess.js
+++ b/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/stateProcess.js
@@ -4,8 +4,10 @@ import("system.result");
 import("system.vars");
 import("system.db");
 
-//var parenttype = db.cell("select TYPE from DOCUMENTTEMPLATE");
-//
-//
-//if(parenttype == "MAI")
-//    result.string("DISABLED");
\ No newline at end of file
+var parenttype = vars.get("$param.Type_param");
+logging.log(parenttype);
+
+if(vars.exists(parenttype) && paraenttype != null && parenttype != "MAI"){
+    result.object(neon.COMPONENTSTATE_DISABLED);
+}
+    
\ No newline at end of file
diff --git a/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/valueProcess.js b/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/valueProcess.js
index ce2998f625ec57b697b8ba7e6d1b4441232b5dd9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/valueProcess.js
+++ b/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/valueProcess.js
@@ -1,8 +0,0 @@
-import("system.logging");
-import("system.result");
-import("system.vars");
-
-if (vars.exists("$param.DocumentTemplateType_param")) 
-{
-    result.string(vars.get("$param.DocumentTemplateType_param"));
-}
diff --git a/entity/DocumentTemplateLink_entity/recordcontainers/db/conditionProcess.js b/entity/DocumentTemplateLink_entity/recordcontainers/db/conditionProcess.js
index d1d7f21be9ad5759bbd0deb5c1d8f622936e3531..ae6a038872ba9e137fcc10b724488bf2293367fa 100644
--- a/entity/DocumentTemplateLink_entity/recordcontainers/db/conditionProcess.js
+++ b/entity/DocumentTemplateLink_entity/recordcontainers/db/conditionProcess.js
@@ -7,4 +7,14 @@ var cond = SqlCondition.begin()
                        .andPrepareVars("DOCUMENTTEMPLATELINK.DOCUMENTTEMPLATE_ID_PARENT", "$param.DocumentId_param");
 
 //TODO: use a preparedCondition when available #1030812 #1034026
-result.string(db.translateCondition(cond.build("1 = 0")));
\ No newline at end of file
+result.string(db.translateCondition(cond.build("1 = 0")));
+
+//if(vars.exists("$param.Type_param") && vars.get("$param.Type_param") != null && vars.get("$param.Type_param") == "ATT"){
+//    
+//    var cond = SqlCondition.begin()
+//                       .andPrepare("DOCUMENTTEMPLATELINK.ATTACHMENT_TYPE", type)
+//                       .andPrepareVars("DOCUMENTTEMPLATELINK.DOCUMENTTEMPLATE_ID_PARENT", docId)
+//                       .build();
+//                       
+//    result.string(db.translateCondition(cond));
+//}
\ No newline at end of file
diff --git a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod
index 87e643c5d7c1b2c70335f9a10c18d8f31da6eed1..3fb259e5a8e1df13a81faa8b39ef62c5fdd9cb59 100644
--- a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod
+++ b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod
@@ -208,6 +208,14 @@
         <entityParameter>
           <name>DocumentId_param</name>
           <valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/links/children/documentid_param/valueProcess.js</valueProcess>
+          <expose v="true" />
+          <triggerRecalculation v="true" />
+        </entityParameter>
+        <entityParameter>
+          <name>Type_param</name>
+          <valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/links/children/type_param/valueProcess.js</valueProcess>
+          <expose v="true" />
+          <triggerRecalculation v="true" />
         </entityParameter>
       </children>
     </entityConsumer>
diff --git a/entity/DocumentTemplate_entity/entityfields/links/children/type_param/valueProcess.js b/entity/DocumentTemplate_entity/entityfields/links/children/type_param/valueProcess.js
new file mode 100644
index 0000000000000000000000000000000000000000..e133265a133774e7833f803e776e6321c6ab1aac
--- /dev/null
+++ b/entity/DocumentTemplate_entity/entityfields/links/children/type_param/valueProcess.js
@@ -0,0 +1,4 @@
+import("system.vars");
+import("system.result");
+
+result.string(vars.get("$field.TYPE"));
\ No newline at end of file