Hi everyone,
I need to put the "Attach Document" command (from Attachment tab) into menubar in detail_cr.htmpl form. However, no matter what I do, the JavaScript calling does not work.
Here is my code in menubar_sd_l2_analyst.htmpl:
<PDM_OBJECT>
function do_attach_doc() {
var add_file_src = "View=Upload+ShowFields=Yes+ShowImgStatus=Yes+ShowRepList=Yes+RepType=0+KEEP.POPUP_NAME=" + top.name +
"+KEEP.PARENT_DIV=" + window.frameElement.parentNode.id + "+KEEP.attmnt_parent=$args.persistent_id";
AddFile(0, 0, 0, add_file_src, 50 );
}
<PDM_MACRO name=menuItem label="Attach_File" function="JavaScript: do_attach_doc()" icon_name="Attachment_16.png" tooltip="anexar arquivo">
</PDM_OBJECT>
Note: the do_attach_doc function is from xx_attmnt_tab.htmpl.
Note 2: the Attach_File item is inside "Activities" menu.
When I try to click on Attach_File menu item, nothing happens and I get the following error: "ReferenceError: do_attach_doc is not defined". Already tried to execute AddFile without the do_attach_doc, without success. I tried with the "Attach Document" code from detail_cr in analyst/employee too, no success neither.
Any ideas?