简体   繁体   中英

Dynamics CRM 2011 - FirstSelectedItemId not being passed

The following doesn't work and not sure why.

I should get the ID passed in as a param but it's always undefined.

Ribbon xml section.

<Actions>
                        <JavaScriptFunction Library="$webresource:ct_/scripts/jqueryandjson2.js" FunctionName="isNaN" />
                        <JavaScriptFunction Library="$webresource:ct_/scripts/MyJSLib.js" FunctionName="isNaN" />
                        <JavaScriptFunction Library="$webresource:ct_/scripts/lead/ribbon.js" FunctionName="startDisqualifyLead">
                            <CrmParameter Value="FirstSelectedItemId" />
                        </JavaScriptFunction>
                    </Actions>

Javascript method.

function startDisqualifyLead(entityId) {
if (!entityId)
    entityId = Xrm.Page.data.entity.getId();

alert(entityId); // always undefined.

}

I did however get it working by importing and publishing using Erik Pools ribbon editor. No clue why my stuff was not working when manually importing and publishing using MSDNs guide on how to import/export the ribbon.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM