locked
Hopefully Last CM Ribbon Question RRS feed

  • Question

  • Thanks to excellent help from this forum I have managed to get a child record entity form in a pop out window from a button click. (code below).I managed this by hardcoding in the ID for a specific record. How can I change this so that I gets the id from the parent entity.

    In the parent entity the lookup is new_OAccounts and under SQL the value is CE993713-EBAE-E311-93FD-00155D04FA2A

    In the child entity the field is new_originatingaccountsid  and under SQL the value is CE993713-EBAE-E311-93FD-00155D04FA2A

    function openDirectDebit()
    {
        var clientURL = Xrm.Page.context.getClientUrl();
        //Set features for how the window will appear.
        var features = "location=no,menubar=yes,status=no,toolbar=yes,width=2000px,height=600px";
        // Open the window.
        window.open(clientURL + "/main.aspx?etc=10014&extraqs=formid%3d0c6b8f80-3c48-43d0-afef-1a0890d30431&id=%7bCE993713-EBAE-E311-93FD-00155D04FA2A%7d&pagetype=entityrecord", "_blank", features, false);
    }


    Dont ask me .. i dont know

    Tuesday, March 18, 2014 11:09 PM

Answers

  • Hi,

    There are reasons for this not to be on a sub grid.  I have lots of similar custom entities and would prefer not to clutter the form with to many tabs and sub grids. I have had a look at retrieve multiple and to be honest its confused the hell out of me. Can anybody spare a bit of time to teach me how to do this. I don't know if this will throw anything into the mix, but There maybe more than one record in the child entity, but only one of those records would be active

     


    Dont ask me .. i dont know

    • Marked as answer by Pete Newman Tuesday, May 27, 2014 9:51 AM
    Wednesday, March 19, 2014 2:29 PM

All replies

  • Hello,

    First want to point out etc, i will suggest you to use etn (your entity name) instead of etc, because sometime it differ from organization to organization.

    I hope you have 1:n relationship between account and your custom entity, so you will be having multiple child records associated to parent account, so now could you help me to understand how and when you want to open the pop to show child entity form ? or let me know if I don't understand your requirement.


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Wednesday, March 19, 2014 12:33 AM
    Moderator
  • Hi,

    I do have a 1-N relationship, but there will only be 1 active record in the child entity. The Jscript id fired from the parent entity form from a button on the ribbon. The current code I have above, opens the form and displays the child record , however this code shows the same child record regardless of the parent record


    Dont ask me .. i dont know

    Wednesday, March 19, 2014 12:46 AM
  • Ok,

    > Not sure if there is any specific reason to create this button, otherwise you can simply add subgrid to your parent form to show child record and if user want to open that record they double click and open it.

    > If you don't want to add subgrid you have to write an another retrievemultiple function to get child entity and once you have that record you can get it's id and use it to pop window.


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Wednesday, March 19, 2014 1:15 AM
    Moderator
  • Hi,

    There are reasons for this not to be on a sub grid.  I have lots of similar custom entities and would prefer not to clutter the form with to many tabs and sub grids. I have had a look at retrieve multiple and to be honest its confused the hell out of me. Can anybody spare a bit of time to teach me how to do this. I don't know if this will throw anything into the mix, but There maybe more than one record in the child entity, but only one of those records would be active

     


    Dont ask me .. i dont know

    • Marked as answer by Pete Newman Tuesday, May 27, 2014 9:51 AM
    Wednesday, March 19, 2014 2:29 PM