Adding the Document Drop Plugin into a Custom Page in Sage CRM v7.2

This question is not answered

I note in this article Jeff talks about adding the document drop plugin to a custom entity.

https://community.sagecrm.com/partner_community/b/hints_tips_and_tricks/archive/2009/03/30/adding-the-document-drop-plugin-into-a-custom-page.aspx

Is there a way of doing this for version 7.2? 

All Replies
  • Okay, so no help forthcoming yet, let me show you how far I've got doing this in 7.2:

    Using a system entity in CRM (opportunity in this case), when you select a file from the document drop plug in:

    http://mfb-crm/crmtng//eware.dll/Do?
    SID=75740163837719&
    Act=343&
    Mode=1&
    CLk=T&
    Key0=7&
    Key7=15&
    SaveDocDir=C%3A%5CUsers%5CMarkr%5CAppData%5CLocal%5CTemp%5C&
    SaveDocName=test525339500.txt&
    SaveOriginalName=test.txt

    When we click new, from a custom entity, we end up here (note, same action code): 

    http://mfb-crm/crmtng/eware.dll/Do?
    SID=75740163837719&
    Act=343&
    Mode=1&
    CLk=T&
    Key0=58&
    Key1=6&
    Key2=9&
    Key37=6011&
    Key50=346&
    Key58=6011&
    mfbc_MFB_OppoID=6011&
    Key-1=58&
    MakeCommunicationYN=Y&
    PrevCustomURL=%2Fcrmtng%2Feware.dll%2FDo%3FSID%3D75740163837719%26Act%3D6030%26Asp%3D%252Fcrmtng%252FCustomPages%252FMFB_Oppo%252FMFB_OppoLibrary.asp%253FSID%253D75740163837719%2526Key0%253D58%2526Key1%253D6%2526Key2%253D9%2526Key37%253D6011%2526Key50%253D346%2526Key58%253D6011%2526J%253DMFB_Oppo%252FMFB_OppoLibrary.asp%2526F%253DMFB_Oppo%252FMFB_OppoCommunication.asp%2526mfbc_MFB_OppoID%253D6011%2526T%253DMFB_Oppo&E=MFB_Oppo

    We get a bunch of other keys too here to glue us to our custom entity and show CRM the way back to the entity once we are done. 

    So I create this javascript to make a new exciting button (note the use of the new clientside scripting of 7.2, very useful indeed).

    function onLoadScripts() {
    //Add the Document Drop button in
    var buttonimage = '..\\..\\Themes/img/default/buttons/houseprice.png';
    var SIDArray = getQueryParams($("#btnerLink").text().split("?")[1]);

    //Find the URL from the new button we set on the server
    var buttonlink = $("img[src$='new.gif']").parent().attr("href");

    //Add the extra parameters to specify the file to add
    var buttonaction = buttonlink + "&" +
    "SaveDocDir=C%3A%5CUsers%5CMarkr%5CAppData%5CLocal%5CTemp%5C&" +
    "SaveDocName=test4586827501111231321222.txt&" + //This filename needs to be unique
    "SaveOriginalName=test.txt";

    crm.addButton(buttonimage, 'Button', 'quotes', buttonaction);
    }

    This does work, ish. It takes us to a new document screen:

    However, on save we go to the following place:

    http://mfb-crm/crmtng/eware.dll/Do?
    SID=75740163837719&
    Act=343&
    Mode=3&
    CLk=&
    Key-1=58&
    Key0=58&
    Key1=6&
    Key2=9&
    Key37=6011&
    Key50=346&
    Key58=6011

    And we error: 

    An error occured saving the document to the document library.
    Errorcode: 2
    Error text: An error occured saving the document to the document library.
    A record was still created 

    The record is created against the correct custom entity record, it has no attachment though. I realise we are bending CRM out of shape here, and I should just live with the fact of no document drop button, however, I know this will be a bone of contention for our users who are used to this when using 'out of the box' entities. 

  • After all that messing around I just need to use the new version of the Advanced Customisation Wizard.

    community.sagecrm.com/.../sage-crm-v7-1-sp2-ensuring-a-new-custom-entity-has-mail-merge-capabilities.aspx