1

我在我的子网格上添加了一个名为“lots_associes”的按钮,我想通过单击此按钮 javascript 恢复所有选定的记录。

我尝试了所有作为http://vikramxrm.blogspot.fr/2013/11/read-subgrid-records-ms-crm-2013-using.html提出的解决方案

但似乎函数“getElementById ('lots_associes')”在“Xrm.Page.ui.controls.get('lots_associes')”工作时不起作用。我有网格的好名字。

你有什么想法?

4

1 回答 1

1

In 2011, it was the Ribbon's job: I assume 2013 would be the same (despite the different look'n'feel).

You had to use CrmParameter to have the IDs of the selected records:

// in the RibbonDiffXml
<JavaScriptFunction FunctionName="YourFunc" Library="YourLibrary">
    <CrmParameter Name="MyRecordIDs" Value="SelectedControlSelectedItemIds" />
</JavaScriptFunction>

//The corresponding function would look like
function YourFunc(recordIDs){
    // recordIDS will be filled with the IDs of the selected records
}

Here is the reference for CrmParameter (it says it applies to 2011 but there is no equivalent for 2013 so I believe this info is still valid)

On a side note, never use getElementById (it's not supported: no support from microsoft and any rollup might break your code).

于 2014-03-03T11:08:03.343 回答