locked
Problem while customizing ISV.Config file. RRS feed

  • Question

  •  

    Hello,

    Can we execute javascript in the ISV.config file?

    I mean,I've a button "Quote Address" in an entity named Ofers.Here is the button tags in ISV.Config file,

               <Button Icon="/_imgs/ico_18_debug.gif" Url="/isv/account_address.aspx" PassParams="1"            WinParams="" WinMode="1">
                  <Titles>
                    <Title LCID="1033" Text="Quote Address" />
                  </Titles>
                  <ToolTips>
                    <ToolTip LCID="1033" Text="List of quote's addresses" />
                  </ToolTips>
                </Button>

     

    While cklicking this button,a popup page will came.But i want to pass an ID value as parameter to the newly called popup page.The popup page is an aspx page with i'd published in the CRM server.

    Urgent! Help me plzz..

    Tuesday, July 15, 2008 10:29 AM

Answers

  • Here's an example of using javascript in an ISV.config button.  In this case we are passing the address attributes to local.live.com to display a map of the customer's address:

    Code Snippet

     

    <ToolBarSpacer />
            <Button Title="Map"
                    ToolTip="Show a map for this record's address"
                    Icon="/_imgs/ico_16_2013.gif"
                    JavaScript=
    "
    var sState = crmForm.all.address1_stateorprovince.DataValue;
    var sZip = crmForm.all.address1_postalcode.DataValue;

    if (sState || sZip) {
        var sStreet = crmForm.all.address1_line1.DataValue;
        if (!sStreet) sStreet = '';
        var sCity = crmForm.all.address1_city.DataValue;
        if (!sCity) sCity = '';
        var sAddress = sStreet + ',' + sCity + ',' + sState + ' ' + sZip;
        var sURL = 'http://local.live.com/default.aspx?where1=' + sAddress;
        window.open(sURL, '_blank');
        }
    else {
        alert('State or Zip Code must be supplied.');
    }
    "
                     />
    </ToolBar>

     

     

     

    Tuesday, July 15, 2008 11:18 AM
    Moderator

All replies

  • try to write something like this:
    <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="alert('hello')" PassParams="1" WinParams="" WinMode="1">

    Url will be ignore if u have Javascript..

    regards,
    toongyang
    Tuesday, July 15, 2008 11:02 AM
  • Here's an example of using javascript in an ISV.config button.  In this case we are passing the address attributes to local.live.com to display a map of the customer's address:

    Code Snippet

     

    <ToolBarSpacer />
            <Button Title="Map"
                    ToolTip="Show a map for this record's address"
                    Icon="/_imgs/ico_16_2013.gif"
                    JavaScript=
    "
    var sState = crmForm.all.address1_stateorprovince.DataValue;
    var sZip = crmForm.all.address1_postalcode.DataValue;

    if (sState || sZip) {
        var sStreet = crmForm.all.address1_line1.DataValue;
        if (!sStreet) sStreet = '';
        var sCity = crmForm.all.address1_city.DataValue;
        if (!sCity) sCity = '';
        var sAddress = sStreet + ',' + sCity + ',' + sState + ' ' + sZip;
        var sURL = 'http://local.live.com/default.aspx?where1=' + sAddress;
        window.open(sURL, '_blank');
        }
    else {
        alert('State or Zip Code must be supplied.');
    }
    "
                     />
    </ToolBar>

     

     

     

    Tuesday, July 15, 2008 11:18 AM
    Moderator
  • Thank you very much.I've tried this method and it works finely.

    Also i want to show and validate this button while new mode and Edit mode.So i set

    ValidateforCreate="1",ValidateforUpdate="1".But When i click the button in NEW mode......ERROR ON PAGE...occured.No problem when it is in EDIT MODE.Help me please....

    Wednesday, July 16, 2008 4:29 AM