locked
Add custom field RRS feed

  • Question

  • Hi I want to create a new custom field to microsoft CRM. I've got three dropdownlist and based on the value of those three dropdownlists I want to change the html content with code behind of the custom field (the field will be basicly an picture). Where can I download tools to customize crm 4.0? (is there something like extensions for visual studio in sharepoint). How can I deploy this custom field to CRM ? Is there a good example on msdn (I haven't found one:( )
    Thanks for soon replay
    Monday, August 24, 2009 9:23 AM

Answers

  • Hi you can add custom field(or call it attribute) to MS CRM. But there is no datatype for picture. For this purpose you have to add an iframe. and this iframe will point to the picture URL. you can save the picture URL in MS CRM attribute.

    In order to add any custom attribute to ms crm use this procedure.

    Open CRM.  Go to Settings --> Customizations --> Customize Entities.  Find the entity you want to add custom fields to and double click it to open the entity.  Click the 'Attributes' link then click 'New'.  Put the details of your custom attribute i.e. name, default value, data type etc.  Click Save and Close.  Select 'Publish' from the 'Actions' menu of the entity.  Then click 'Forms and Views' and double click 'Form' to open the form.  Select the section where you want to add the attribute then click the 'Add Attribute' link and select the newly created attribute.  Use the arrows to position it on the form where you want it.  Save and close the form then select 'Publish'' from the 'Actions' menu again.

    You have to use some javascript on the onchange of the respective dropdown(picklist) to change the url to the iframe.
    something  like this.
    crmForm.all.Iframe_Pic.src = http://servername:5555/mypicsfolder/pic1.gif;

    • Marked as answer by Marianxyz Monday, August 24, 2009 10:49 AM
    Monday, August 24, 2009 10:03 AM
  • Hi

    For  this, You can add an iframe and this iframe can point  to the custom asp.net page. In this asp.net page you can load the picture in the <img> tag. here you can add onclick to the picture. something like this.

    crmForm.all.Iframe_frm1.src = http://myserver:5555/myweb/custom.aspx;

    and in the custom.aspx (which is just like a normal asp.net page) you can do anything.  something  like this custom.aspx html code

    <img src="mypic.gif" onclick="DoSomething();"/>

    offcourse you also have the custom.aspx.cs file if you want to do something in codebehind.

    remember if you create your own asp.net application you have to deploy it in IIS (can be inside ISV Config folder but not necessarly) and point the iframe to your web application.

    i hope it helps.

    • Marked as answer by Marianxyz Monday, August 24, 2009 10:49 AM
    Monday, August 24, 2009 10:23 AM

All replies

  • Hi you can add custom field(or call it attribute) to MS CRM. But there is no datatype for picture. For this purpose you have to add an iframe. and this iframe will point to the picture URL. you can save the picture URL in MS CRM attribute.

    In order to add any custom attribute to ms crm use this procedure.

    Open CRM.  Go to Settings --> Customizations --> Customize Entities.  Find the entity you want to add custom fields to and double click it to open the entity.  Click the 'Attributes' link then click 'New'.  Put the details of your custom attribute i.e. name, default value, data type etc.  Click Save and Close.  Select 'Publish' from the 'Actions' menu of the entity.  Then click 'Forms and Views' and double click 'Form' to open the form.  Select the section where you want to add the attribute then click the 'Add Attribute' link and select the newly created attribute.  Use the arrows to position it on the form where you want it.  Save and close the form then select 'Publish'' from the 'Actions' menu again.

    You have to use some javascript on the onchange of the respective dropdown(picklist) to change the url to the iframe.
    something  like this.
    crmForm.all.Iframe_Pic.src = http://servername:5555/mypicsfolder/pic1.gif;

    • Marked as answer by Marianxyz Monday, August 24, 2009 10:49 AM
    Monday, August 24, 2009 10:03 AM
  • Thanks for replay and is it possible to add some c# code behind to this picture ? (for example onclick ? ) or add ascx file ? (like in sharepoint)
    • Marked as answer by Marianxyz Monday, August 24, 2009 10:49 AM
    • Unmarked as answer by Marianxyz Monday, August 24, 2009 10:49 AM
    Monday, August 24, 2009 10:19 AM
  • Hi

    For  this, You can add an iframe and this iframe can point  to the custom asp.net page. In this asp.net page you can load the picture in the <img> tag. here you can add onclick to the picture. something like this.

    crmForm.all.Iframe_frm1.src = http://myserver:5555/myweb/custom.aspx;

    and in the custom.aspx (which is just like a normal asp.net page) you can do anything.  something  like this custom.aspx html code

    <img src="mypic.gif" onclick="DoSomething();"/>

    offcourse you also have the custom.aspx.cs file if you want to do something in codebehind.

    remember if you create your own asp.net application you have to deploy it in IIS (can be inside ISV Config folder but not necessarly) and point the iframe to your web application.

    i hope it helps.

    • Marked as answer by Marianxyz Monday, August 24, 2009 10:49 AM
    Monday, August 24, 2009 10:23 AM
  • Thanks for quick answers :)
    Monday, August 24, 2009 10:49 AM