locked
MS CRM 4.0 web page called using isv.config opens again on clicking a button in the page: RRS feed

  • Question

  •  

    Hi,

     

    I need to open an external web page  on a button click from MS CRM .

    I have done this using ISV.CONFIG.

    I am passing an array of guids of all selected records to the page and i am getting them using

    window.dialogArguments;

     

    I have a button inside the webpage.when i click this buttom the page is again opening

    i can avoid this using window.open ( my url) in the isv.config, but in this case i am not able to pass multiple guids to the web page.

    Note: In window.open method i am able to pass only one guid and not the guids of all selected records

     

    Below is the extract form my isv.config

    <Buttons>

    <Button Url="http://crm40/Fsmail/SendMail.aspx" PassParams="1" WinMode="2" WinParams="width=550,height=550">

     

    I want to know how i can avoid the page opening once again when i click on the button inside the page.

    And also is it possible to pass all the selected guids in the window.open method

     

    Loking forward for immediate help

     

    Thursday, November 13, 2008 4:57 AM

Answers

  • Try to manage the button in ur custom aspx page using this method,

     

     

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Mypage.aspx.vb" Inherits="Myproject.

    mypage" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server" id="Head1" >

    <title>.::My Custom aspx page::.</title>

    <base target="_self"/>

        <script language="javascript">

    function ReturnString()

    {

    //messageSTR is a string which contains the message

    self.document.write('<%=messageSTR%>'); 
    }

    </script>

     

    etc....etc....etc....

    then, call the function in the button event,

    this is ur button in the custom aspx page,

    <asp:Button ID="Button1" runat="server" Height="18pt"  Width="83px" OnClientClick="ReturnString();" />

    Thursday, November 13, 2008 11:03 AM

All replies

  •  

    Hi,

     So you have a custom aspx page and you want to pass some guids to that aspx page,right?

    Also you have a button in ur custom aspx page and when u click that button, u want to close the aspx page and return something to the CRM entity form,right?

    Thursday, November 13, 2008 5:24 AM
  • Hi,

     

    when i click on the button i have some operation to be done and then give a message through reponse.write.

    but, when i click on the button , the same page is once again opened with the respnse.write message in that.

    So now two pages are there open

    one which i opened by clicking on the isv button.

    two , the same page with the response.write message in that.

     

    where asi want the message to be dispalyed in the first opened page itself.

     

    Regards,

    Soumya. 

     

    Thursday, November 13, 2008 7:00 AM
  • Hi Sasisavi,

    Use this snippet

    <Button PassParams="1" WinMode="0" JavaScript="window.open('http://
    crm40/Fsmail/SendMail.aspx?oid='+ getSelected('crmGrid'),'yourWindowName','width=350,height=250');">
                      <Titles>
                        <Title LCID="1033" Text="Set Test Date" />
                      </Titles>
                      <ToolTips>
                        <ToolTip LCID="1033" Text="Send mail about Test date." />
                      </ToolTips>
                    </Button>


    Here
    getSelected('crmGrid') is a CRM method which returns all the selected record GUIDs.
    Thursday, November 13, 2008 7:31 AM
  • Hi,

    Yes, You can pass the GUIDs as parameter with the URL.

    The key is this little bit of JavaScript: getSelected('crmGrid')

    This gives you the GUID of whatever items you have selected in the CRM Grid.

    So, if you have one selected this code will pass the GUID with the curly braces "{}" around it.

    If multiple items are selected then each GUID will be separated by a comma ","

    Thursday, November 13, 2008 10:47 AM
  • Try to manage the button in ur custom aspx page using this method,

     

     

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Mypage.aspx.vb" Inherits="Myproject.

    mypage" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server" id="Head1" >

    <title>.::My Custom aspx page::.</title>

    <base target="_self"/>

        <script language="javascript">

    function ReturnString()

    {

    //messageSTR is a string which contains the message

    self.document.write('<%=messageSTR%>'); 
    }

    </script>

     

    etc....etc....etc....

    then, call the function in the button event,

    this is ur button in the custom aspx page,

    <asp:Button ID="Button1" runat="server" Height="18pt"  Width="83px" OnClientClick="ReturnString();" />

    Thursday, November 13, 2008 11:03 AM
  • Hi,

     

    Thank you for the info, let  me try it out.

     

    Regards,

    Soumya

     

    Thursday, November 13, 2008 11:41 AM
  • Hi,

    Is it ok?

     

    Monday, November 17, 2008 11:57 AM
  • Hi  Malavika,

    Ur code snippet really helped me a lot, from past 4 days I was trying to find out some thing like this...but it takes a bit more time to fire...is there anywany we can reduce it...??

    Thank you so much..........

     

    Monday, December 15, 2008 12:52 PM
  • Hi,
    How will you use this code if you need to pass the selected GUIDs to an new email.How will you pass the parameters?


    Thanks
    Divya
    Monday, January 4, 2010 3:55 AM