Источник:
http://malikhan.wordpress.com/2010/0...0-task-entity/
==============
In this small post, i will show you how to add more options(Values) to the Standard
“Duration” drop-down in the “
Task” Entity. So, out of the box, the “
Duration” field on the “
Task” entity look like this.
Note:- “Duration” Field is not a MS CRM Pick-List. It is editable and user can add anything e.g. “4 Days”, “52 Minutes” etc. In fact the data type of the
“Duration” field is
“Integer”. but in Task entity it looks like a Standard MS CRM Pick list. In-Background MS CRM is generating a table for this field and displaying the values in the drop-down. See the attribute description below:-
So to add more values to the “
Duration” drop-down, put the following JavaScript code in the Task Entity Form ==> OnLoad() event, save the form and publish the
“Task” entity. The code is simply adding rows to the table, which is used to display the
“Duration” drop-down on
“Task” Entity Form.
var obj =
document.getElementById('actualdurationminutesSelect');
var tbl = obj.childNodes[1];
var lastRow = tbl.rows.
length;
var row = tbl.insertRow(lastRow);
var cell = row.insertCell(0);cell.val = '4 days';cell.innerText = '4 days';lastRow++;row = tbl.insertRow(lastRow);
var cell = row.insertCell(0);cell.val = '5 days';cell.innerText = '5 days';After publishing the
“Task” entity, the
“Duration” drop-down now look like this, with values “4 days” & “5 days” coming inside the default drop-down.
That’s all folks !!!
Источник:
http://malikhan.wordpress.com/2010/0...0-task-entity/