从 Microsoft CRM 获取 guid id - javascript 控制台

get guid id from Microsoft CRM - javascript console

显然,在早期版本的 Microsoft CRM 中,可以使用 Javascript 控制台,使用诸如

的语法在记录的详细页面(例如:帐户、联系人)中获取记录 Guid

Xrm.Page.data.entity.getId(); 帧[0].Xrm.Page.data.entity.getId();

参考:https://crmbusiness.wordpress.com/2014/02/17/crm-2013-javascript-to-get-id-of-record/

我无法在 CRM 2015 中重复此操作。

> frames[0].Xrm.Page.data.entity.getId();
Unable to get property 'entity' of undefined or null reference


> Xrm.Page.data.entity.getId();
Unable to get property 'entity' of undefined or null reference

但是:

> this

给我转储,其中包括

USER_GUID: "{98D61030-7513-4EAA-A243-1D29FA99E0A0}",

IE 控制台的屏幕截图

这是由于 Dynamics CRM(也称为 Turbo Forms)中的新表单呈现而发生的变化

你可以试试

frames[1].Xrm.Page.data.entity.getId();