0

Can I use ListBox control in MS CRM? I want to scroll the list item inside list. But in picklist It seems not possible. So I just want to add the Listbox control in dynamics CRM page. So can I?

2 Answers 2

0

Yes, you can add document elements into the HTML using JavaScript. The rendered page in CRM is just HTML (with JavaScript, CSS, of course) so you can use the DOM to manipulate it in places like the onLoad event of the form.

To add an html element into a page, you would need to find the location of an existing page element then use document.createElement() to add a SELECT object into the DOM.

This blog post should get you started on adding and removing items from the list box:

http://timstall.dotnetdevelopersjournal.com/adding_and_removing_items_from_an_html_listbox.htm

Essentially, you're using JavaScript to create an element, then add items to that. Something like this:

var selector = document.createElement('select');
selector.id = 'selTest1';
selector.name = 'selTest1';
cell.appendChild(selector);

var option = document.createElement('option');
option.value = '0';
option.appendChild(document.createTextNode('Test Item 1'));
selector.appendChild(option);

option = document.createElement('option');
option.value = '1';
option.appendChild(document.createTextNode('Test Item 2'));
selector.appendChild(option);

You would then need to manually save the option selected by the user in the onSave, and load that value in the onLoad for a record update.

Overall, it sounds like quite a complex solution for your problem. Perhaps you could explain more about what you say:

"I want to scroll the list item insid list. But in picklist It seems not possible."

There may well be a solution to this problem we can help with. Do you essentially want to scroll the picklist to a value in the onLoad?

HTH.

0

you can implement the functionality through a simple script in the form onload event

Here is an example

http://innovartecnologias.blogspot.com.es/2013/04/despliegue-de-campos-listbox.html

It's written in spanish but js is international ;)

Hope it be helpful, Regards

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.