当前位置:网站首页>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 .
边栏推荐
- Flutter Doctor:Xcode 安装不完整
- Electrical data | IEEE118 (including wind and solar energy)
- How to get the PHP version- How to get the PHP Version?
- Leetcode1961. Check whether the string is an array prefix
- XSS learning XSS lab problem solution
- 3D vision - 4 Getting started with gesture recognition - using mediapipe includes single frame and real time video
- 037 PHP login, registration, message, personal Center Design
- Docker compose配置MySQL并实现远程连接
- [flask] static file and template rendering
- 竞价推广流程
猜你喜欢
yii中console方法调用,yii console定时任务
[flask] official tutorial -part3: blog blueprint, project installability
TrueType字体文件提取关键信息
MATLB|实时机会约束决策及其在电力系统中的应用
Ordinary people end up in Global trade, and a new round of structural opportunities emerge
Docker compose配置MySQL并实现远程连接
Maya hollowed out modeling
[flask] official tutorial -part2: Blueprint - view, template, static file
Force buckle 9 palindromes
Condition and AQS principle
随机推荐
晶振是如何起振的?
[understanding of opportunity-39]: Guiguzi - Chapter 5 flying clamp - warning 2: there are six types of praise. Be careful to enjoy praise as fish enjoy bait.
Ordinary people end up in Global trade, and a new round of structural opportunities emerge
Mathematical modeling learning from scratch (2): Tools
Redis-字符串类型
LeetCode 322. Change exchange (dynamic planning)
什么是弱引用?es6中有哪些弱引用数据类型?js中的弱引用是什么?
Redis-Key的操作
【已解决】如何生成漂亮的静态文档说明页
Redis守护进程无法停止解决方案
Idea sets the default line break for global newly created files
[detailed] several ways to quickly realize object mapping
CocoaPods could not find compatible versions for pod 'Firebase/CoreOnly'
电气数据|IEEE118(含风能太阳能)
A glimpse of spir-v
[flask] official tutorial -part3: blog blueprint, project installability
False breakthroughs in the trend of London Silver
MySQL learning notes 2
Internship: unfamiliar annotations involved in the project code and their functions
【全網最全】 |MySQL EXPLAIN 完全解讀