Показать сообщение отдельно
Старый 04.10.2017, 18:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
CRMScape: MS Dynamics CRM Web Resources Basic Starter Page
Источник: http://crmscape.blogspot.com/2017/10...ces-basic.html
==============

When creating a Web Resource Page in MS CRM there are some basic parts that I've tend to use in all of my pages. These are all contained in the script block above the body.

User Information:

UserId = Xrm.Page.context.getUserId();
UserName = Xrm.Page.context.getUserName();

Query String parameters to drive the page

QueryStringParameters = Xrm.Page.context.getQueryStringParameters();

QueryStringParm = "None";

if (QueryStringParameters["feature"] != null) {

QueryStringParm = QueryStringParameters["feature"].toString();
}

Entity Id - when you are running in a Form iframe and the entity has been saved.

EntityId = window.parent.Xrm.Page.data.entity.getId();

Id = QueryStringParameters["id"].toString();

Trigger for Query

document.onreadystatechange = function () {

if (document.readyState == "complete") {

// Typically call a query to populate the page

}
}

Function to Open a CRM Form in a new window

function OpenCRMForm(entityName, entityId) {

var windowOptions = {
openInNewWindow: true
};

Xrm.Utility.openEntityForm(entityName, entityId, null, windowOptions);

}

Источник: http://crmscape.blogspot.com/2017/10...ces-basic.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.