码迷,mamicode.com
首页 > 其他好文 > 详细

MSCRM 获取列表所选记录相关信息

时间:2016-05-25 11:14:48      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

问题:如何通过JS获取列表中所选记录信息?

解决办法:

The CRM2011 Ribbon has a special set of parameters called ‘CrmParameters‘ that provide information about the current session such as the selected rows in a sub-grid. We can use the ‘SelectedControlSelectedItemReferences‘ parameter to pass an array of selected items in the grid to our custom JavaScript function. Each object in the array contains the following fields:

Field Name Type Example
Id string {2D080FA6-8D18-E211-9DB7-000C299FFE7D}
Name string Some Account
TypeCode Number 1
TypeName string account

 

实例:

function run(selectedItems)
{
    var selectedItem = selectedItems[0];
    // Here you can use the information below to open a new window or whatever!
    alert("Id=" + selectedItem.Id + "\nName=" + selectedItem.Name + "\nTypeCode=" + selectedItem.TypeCode.toString() + "\nTypeName=" + selectedItem.TypeName);
}

MSCRM 获取列表所选记录相关信息

标签:

原文地址:http://www.cnblogs.com/diaozhuaiba/p/5526067.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!