locked
Is it possible to create composite fields menu for custom fields? RRS feed

  • Question

  • I want to add one field inside composite field.But i read this is not possible.Please give me one solution for this.
    Thursday, September 7, 2017 6:28 AM

All replies

  • This method is not a supported way by MS CRM, however I have already tried it and it worked. 

    Add the event click on the composite field who will open custom web resource which will make the necessary changes between the custom field in the custom html and the composite field in CRM.

    There is no XRM OnClick field event for MS CRM. However you can externally attach OnClick Event to field on Onload function of the form.
    Sample:
    function Onload_Method() {
       var control = document.getElementById("field_name");
       if (control) {
         control.attachEvent("onclick" , CallFunction );
         }
    }
    function CallFunction()
    {
     // Your Logic
    }

    • Proposed as answer by Moh Helper Thursday, September 7, 2017 1:01 PM
    Thursday, September 7, 2017 1:01 PM
  • Hi Moh,

    Thanks for reply.but can u please give me one by one step to add one field into composite field ? I want to add one 'state code' field into composite field.how come connect custom html and javascript? please give me one custom html code for my requirement.



    Monday, September 11, 2017 9:39 AM
  • Hi,

    I can call javascript file when on loading form.i want to add one input type field using html,where i will call inside html ? how can connect this html and javascript in form load time?

    Tuesday, September 12, 2017 8:43 AM
  • Hi, 

    I want to add one onclick event.Inside on load form i added this control.attachEvent("onclick" , CallFunction ).but this is not working.can u help me solve this ?

    Tuesday, September 12, 2017 1:23 PM
  • Hello,

    Can you please describe your scenario?


    Dynamics CRM/Business Solutions MVP
    Read My blog

    Tuesday, September 12, 2017 1:39 PM
    Moderator
  • Hi

    I want to add one field inside composite field.But i read this is only possible through custom html and javascript.because of this i am trying this code on Onload function of the form

    function OnLoadMethod() {
     var control  =Xrm.Page.getAttribute("billto_composite");

    if (control) {
      control.attachEvent("onclick" , CallFunction );

       }
    }

    function CallFunction()
    {

     //logic
    }

    but i am getting this error 'control.attachEvent is not a function at OnLoadMethod' when form onload time.Actually i don't have idea how can create one more field inside composite field? can u give me one solution?


    Wednesday, September 13, 2017 5:09 AM
  • Please, try to avoid creating duplicated threads.

    Regarding your question - there is only one supported way to implement your logic - webresources. I would suggest not trying to implement it with standard functionality because it'll be wasting of your time. Any update can break your unsupported stuff.


    Dynamics CRM/Business Solutions MVP
    Read My blog

    Wednesday, September 13, 2017 11:26 AM
    Moderator
  • Hi

    Can you please explain how to do this using web resources? I am a beginner and am having a hard time getting this to work. Can you please point me towards the right way to do this.

    Friday, September 15, 2017 10:48 AM
  • Hello,

    You can start here - http://crmbook.powerobjects.com/extending-crm/javascript/html-web-resources/


    Dynamics CRM/Business Solutions MVP
    Read My blog

    Friday, September 15, 2017 11:12 AM
    Moderator
  • Thanks for the response Andrew. I have added web resource for the field (State Code) as suggested. The output is as shown in the screen shot below. It looks a bit messy now but ignore that.

    Next, I have a invoice form. When I click on the address field a fly-out should appear that should contain the "State Code" field that I created above.

    The red circle shows where the State Code field should appear. How do I achieve this?

    Saturday, September 16, 2017 11:19 AM
  • This flyout menu is not customizable in supported way and I have no suggestion for you how to do that in unsupported way. There is no other way to do that except you will try to do it by yourself. Good luck.

    Dynamics CRM/Business Solutions MVP
    Read My blog

    Sunday, September 17, 2017 12:26 AM
    Moderator
  • Hi Neethy , 

    sorry for the late, I was in holiday. I am completely agree with Andrew. You must to customize by yourself the composite field.

    Kr, 

    Mohamed

    Thursday, September 21, 2017 10:41 AM