当前位置:网站首页>Thinking about the best practice of dynamics 365 development collaboration
Thinking about the best practice of dynamics 365 development collaboration
2022-07-06 01:38:00 【zcy_ wxy】
One 、 The front desk development
1、 The first thing to consider is to separate the common code into a public js, Then introduce when needed . It will be easier to maintain .
2、 Do request aggregation . If there are too many requests in a page , And not asynchronous , It will cause the front desk to jam obviously . So in order to reduce the number of requests , Do request aggregation , Integrate several requests into one request , Get the data required by the page .
Commonly used, for example :
Lock and release form properties
/**
* Lock or unlock attributes
* @param {any} attributeName
*/
lockOrUnlockControlByAttributeName: function (attributeName,lock) {
let controls = Xrm.Page.getAttribute(attributeName).controls.getAll();
if (controls) {
for (con of controls) {
con.setDisabled(lock);
}
}
}Get option set field name
/*
* summary: The front end gets the name of the option set field
* author:
* createTime:
*/
getOptionName:function (context, attributeName, value) {
let val = value;
if (val == null || val == undefined) {
val = context.getAttribute(attributeName).getValue();
}
let attrArray = context.getControl(attributeName).getOptions().filter(t => t.value == val);
if (attrArray.length > 0) {
return attrArray[0].text;
}
return "";
}Judge whether the user is in charge
/*
* summary: Judge whether the user is in charge
* author:
* createTime:
* returns:
*/
function currentUserIsOwner() {
let owner = Xrm.Page.getAttribute("ownerid");
if (owner) {
let ownerid = owner.getValue()[0].id;
return Xrm.Page.context.getUserId() == ownerid;
}
return false;
}
Determine whether the user contains the specified role
/*
* summary: Determine whether users have certain roles
* author:
* createTime:
* returns:
*/
function currentUserContainRoles(roleNames) {
var roleNameArray = roleNames.split(',');
let userRoles = Xrm.Utility.getGlobalContext().userSettings.roles.getAll();
if (roleNameArray.length > 1) {
let nameSet = new Set();
for (let role of userRoles) {
nameSet.add(role.name);
}
for (let roleName of roleNameArray) {
if (nameSet.has(roleName)) {
return true;
}
}
return false;
}
for (var role of userRoles) {
if (role.name == roleNameArray[0]) {
return true;
}
}
return false;
}wait .
Two 、 Plug-in development
1、 It is better to build a plug-in project by an entity , In this way, we can avoid conflicts when developing by multiple people , It can also avoid sending too much or missing content when the solution is released . Or divide plug-in projects according to modules , A plug-in project contains only the entities required by a single module .
2、 Common modules are also best extracted , Put it in a shared project . Press dao、service、controller In terms of the hierarchical concept of ,dao Layer and the service Public content of layer , All in shared projects .
边栏推荐
猜你喜欢

Electrical data | IEEE118 (including wind and solar energy)

Maya hollowed out modeling

ORA-00030

1. Introduction to basic functions of power query

伦敦银走势中的假突破

Ordinary people end up in Global trade, and a new round of structural opportunities emerge

Idea sets the default line break for global newly created files
![[Jiudu OJ 09] two points to find student information](/img/35/25aac51fa3e08558b1f6e2541762b6.jpg)
[Jiudu OJ 09] two points to find student information

2 power view

Mathematical modeling learning from scratch (2): Tools
随机推荐
[flask] obtain request information, redirect and error handling
Basic operations of databases and tables ----- primary key constraints
You are using pip version 21.1.1; however, version 22.0.3 is available. You should consider upgradin
2022年广西自治区中职组“网络空间安全”赛题及赛题解析(超详细)
[flask] response, session and message flashing
Redis-列表
Luo Gu P1170 Bugs Bunny and Hunter
Paddle framework: paddlenlp overview [propeller natural language processing development library]
Open source | Ctrip ticket BDD UI testing framework flybirds
Threedposetracker project resolution
MATLB|实时机会约束决策及其在电力系统中的应用
Nmap: network detection tool and security / port scanner
网易智企逆势进场,游戏工业化有了新可能
NLP第四范式:Prompt概述【Pre-train,Prompt(提示),Predict】【刘鹏飞】
C web page open WinForm exe
Kotlin basics 1
How does Huawei enable debug and how to make an image port
国家级非遗传承人高清旺《四大美人》皮影数字藏品惊艳亮相!
3D视觉——4.手势识别(Gesture Recognition)入门——使用MediaPipe含单帧(Singel Frame)和实时视频(Real-Time Video)
Paddle框架:PaddleNLP概述【飛槳自然語言處理開發庫】