locked
ISV, Custom Button and PassParams RRS feed

  • Question

  •  

    Hello All,

     

    I have a custom button that calls a dialog window using ISV. The button is on the Grid view of the Cases entity. One of the 'nodes' is PassParams=1.

     

    When I execute the button and examine the URL, the GUID (=id) of the Case is clearly NOT being passed as a parameter? Can anyone advise please? Is this something peculiar to the Grid buttons? The only parameters apparently being passed are the OrgName, UserLcid and OrgLcid?

    Monday, August 4, 2008 3:14 PM

Answers

  • The function (doIsvAction) which handles the popup resides in [crm install folder]\_static\_grid\action.js

    Try alerting or debugging the parameters passed to the window (sParams parameter).

     

     

     

    Tuesday, August 5, 2008 9:52 AM

All replies

  • You have to put the 1 in quotes, like this:

    <MenuItem Url="http://www.microsoft.com" PassParams="1">
    Monday, August 4, 2008 11:11 PM
    Moderator
  • In the XML file? I was looking at it using XML notepad? I thought " was an invalid character?

    Tuesday, August 5, 2008 7:49 AM
  • After further testing....

     

    This is the XML code. It just doesnt work from the Grid bar with a selected record, but does work from the ToolBar of the Cases Record Form.

    Code Snippet

     

    <Grid>
    <MenuBar>
    <Buttons>
    <Button Icon="/_imgs/ico_18_debug.gif" Url="\ISV\EngineerCaseReport\Default.asp" PassParams="1" WinMode="0">
    <Titles>
     <Title LCID="1033" Text="Case Report"/>
     </Titles>
    <ToolTips>
     <ToolTip LCID="1033" Text="Engineer Call Report"/>
     </ToolTips>
     </Button>
     <ToolBarSpacer/>
     </Buttons>
     </MenuBar>
     </Grid>

     

     

    Tuesday, August 5, 2008 8:40 AM
  • Is the button valid for update? also change the url to

    /ISV/EngineerCaseReport/Default.asp and see how it goes...

     

     

     

     

    Tuesday, August 5, 2008 9:30 AM
  • It is now...

     

    Still no joy. It wont work from the Grid button but it will work from the Form ToolBar.

     

    It's like record doesnt exist until it is in a form?

    Tuesday, August 5, 2008 9:37 AM
  • The function (doIsvAction) which handles the popup resides in [crm install folder]\_static\_grid\action.js

    Try alerting or debugging the parameters passed to the window (sParams parameter).

     

     

     

    Tuesday, August 5, 2008 9:52 AM
  • The alert shows no parameters being passed. I can see this also from the URL. The GUID is missing. The only parameters it is passing are the ones I listed in the first post. It is as though you can only pass parameters from inside a form and not from a selected record in the grid. Is this your experience also?

    Tuesday, August 5, 2008 10:18 AM
  • Am I reading this correctly? It says that params only get passed through a form? If this is so, then there's the answer.

     

    Code Snippet

    var currWindow = window;
    var oForm = null;
    do
    {
    oForm = currWindow.document.all["crmFormSubmit"];
    if (!IsNull(oForm))
    break;
    if (currWindow == currWindow.parent)
    break;
    currWindow = currWindow.parent;
    } while ((IsNull(oForm)) && (!IsNull(currWindow)))
    var sParams;

    if (!IsNull(oForm))
    {
    if ((!IsNull(oForm.crmFormSubmitId)) && (!IsNull(oForm.crmFormSubmitObjectType)))
    {
    sParams = "?_CreateFromType=" + CrmEncodeDecode.CrmUrlEncode(oForm.crmFormSubmitObjectType.value) + "&_CreateFromId=" + CrmEncodeDecode.CrmUrlEncode(oForm.crmFormSubmitId.value);
    }
    }
    return sParams;

     

     

    Tuesday, August 5, 2008 10:23 AM