web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Consume Java Service for Drop Down

(0) ShareShare
ReportReport
Posted on by 905

Dear All,

I have a requirement in CRM 2015. I have one Drop down field on Account form but this Drop Down List data i need to show it from Java Service, i need to consume the Java Service and Display the Results in the CRM Drop Down List. 

Can you please help on this requirement. How to achieve this and what are the possible ways to accomplish this task.

Thank You.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi,

    I had dynamic dropdowns in CRM 2011 but I've had a lot of trouble getting it to work in 2015.  Since your drop down is dynamic it can't actually store the selected value. You need to let somebody select the value and then you copy that out to a hidden field and use that. In 2015 you can add items to a drop down list, but the problem I'm having is that dynamically added options don't kick of the changed event on the drop down, so you can't copy that value to your hidden field. You could do it with a drop down and a lookup (where you're filtering values in the lookup), but that would be a pain too.

    What you could do here is to have a filtered Lookup field instead of a drop down, so you can create new entities on the fly. Set up your entities so there's a N:1 lookup from your Primary to the Secondary entity, and also an N:N relationship, so it's like this:

    relationships.png

    When the form loads and you get the possible values, ensure they exist as a Secondary entity (create it if you need to), and associate them through the N:N. Then you can set the lookup to only get back Secondary entities related to your Primary entity (via the N:N).

    Hope this helps! Let me know if you have any followup questions or I missed something. I'd really appreciate if you'd mark this as a Verified answer.

    Thanks,

    Aiden

  • VenkataSambasivaRao K Profile Picture
    905 on at

    Dear Aiden,

    Thanks for your reply.

    But i need to show the Consumed data in the Drop Down List only. I will not use Lookups. And i will not store the Consumed data in the Drop Down also. Whenever they open the form and i need to consume the Java Service and Bind the Data to Drop Down. This is my requirement.

    Can you please guide me how to achieve this.

    Thank You.

  • gopi.royal999@gmail.com Profile Picture
    430 on at

    Hi,

    We had a similar requirement long back. You can convert Text box to Dropdown but I don't if it works on CRM 2013/2015/2016 as we did follow this approach on CRM 2011

    http://mscrmtechie.blogspot.com/2014/03/convert-textbox-to-dropdown-in-crm-2011.html

    --

    Gopinath

    My Blog

  • VenkataSambasivaRao K Profile Picture
    905 on at

    Hi Gopi,

    Thanks for your response.

    I have seen the blog you provided but in that code they are consuming asmx service right but in my case i need to consume java REST Service and it will return the result in JSON format and then i need to bind it to Drop Down.

    And one more thing is that is for CRM 2011 you have implemented and i found there they used dom elements and is that will be used in CRM 2015?

    Please guide me how this will accomplish in CRM 2015.

    Thank you.

  • Verified answer
    gopi.royal999@gmail.com Profile Picture
    430 on at

    Yes, it was implemented for CRM 2011.

    I don't think you can populate option set items dynamically on the fly.

    I would suggest to have a HTML web resource which will have a drop down and a button. and add it on the form and do all your work in that consumption of the service in the HTML.

    Once the user selects the value from the dropdown, then need to click on the button beside which will set the CRM attribute value. I know we are giving some extra work to the end user. But this is the supported way I suggest.

    I think, you can wait for some more time on this community to get advise from more people.

    --

    Gopinath

    My Blog

  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi Venkata,

    I understand your requirement, but I wanted to point out difficulties and an alternate approach. If you must use a drop down, you can do something like this:

    - Create a new option set attribute on your entity for display, and a textbox for storing the value.

    - Add both controls to the form but mark the textbox as hidden.

    - You can dynamically add items to a drop down list in CRM in the OnLoad for event but it may not be supported. You would hit the service, parse the results in javascript and dynamically add items to the list.

    - Since the drop down list doesn't have any Options in CRM, if somebody selects an item in the drop down then you can't save that value to CRM.

    - To save the value, in the OnSave event you need to see what the text or value is from the drop down and set that on the textbox control. This will need to be done in javascript.

    - Update the OnLoad event, so after you fill the drop down, if there's a value in the textbox, select that value in the drop down.

    Hope this helps! I'd appreciate if you'd mark this as a Verified answer.

    Thanks,

     Aiden

  • VenkataSambasivaRao K Profile Picture
    905 on at

    Thank you Gopi.

    Any other suggestions please.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans