当前位置:网站首页>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 .
边栏推荐
- How to see the K-line chart of gold price trend?
- 晶振是如何起振的?
- Condition and AQS principle
- Spir - V premier aperçu
- Leetcode skimming questions_ Invert vowels in a string
- 【已解决】如何生成漂亮的静态文档说明页
- A Cooperative Approach to Particle Swarm Optimization
- D22:indeterminate equation (indefinite equation, translation + problem solution)
- 什么是弱引用?es6中有哪些弱引用数据类型?js中的弱引用是什么?
- Docker compose配置MySQL并实现远程连接
猜你喜欢
Folio. Ink is a free, fast and easy-to-use image sharing tool
干货!通过软硬件协同设计加速稀疏神经网络
黄金价格走势k线图如何看?
False breakthroughs in the trend of London Silver
Basic operations of databases and tables ----- non empty constraints
leetcode刷题_验证回文字符串 Ⅱ
现货白银的一般操作方法
[detailed] several ways to quickly realize object mapping
Idea sets the default line break for global newly created files
3D视觉——4.手势识别(Gesture Recognition)入门——使用MediaPipe含单帧(Singel Frame)和实时视频(Real-Time Video)
随机推荐
2022 Guangxi Autonomous Region secondary vocational group "Cyberspace Security" competition and its analysis (super detailed)
【网络攻防实训习题】
Cadre du Paddle: aperçu du paddlelnp [bibliothèque de développement pour le traitement du langage naturel des rames volantes]
正则表达式:示例(1)
Superfluid_ HQ hacked analysis
【Flask】官方教程(Tutorial)-part2:蓝图-视图、模板、静态文件
yii中console方法调用,yii console定时任务
Spir - V premier aperçu
Cookie concept, basic use, principle, details and Chinese transmission
About error 2003 (HY000): can't connect to MySQL server on 'localhost' (10061)
[ssrf-01] principle and utilization examples of server-side Request Forgery vulnerability
Netease smart enterprises enter the market against the trend, and there is a new possibility for game industrialization
Remember that a version of @nestjs/typeorm^8.1.4 cannot be obtained Env option problem
Initialize MySQL database when docker container starts
竞赛题 2022-6-26
500 lines of code to understand the principle of mecached cache client driver
3D模型格式汇总
【SSRF-01】服务器端请求伪造漏洞原理及利用实例
Redis-Key的操作
Format code_ What does formatting code mean