当前位置:网站首页>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 .
边栏推荐
- Alibaba-Canal使用详解(排坑版)_MySQL与ES数据同步
- Loop structure of program (for loop)
- Mongodb problem set
- leetcode刷题_验证回文字符串 Ⅱ
- NLP fourth paradigm: overview of prompt [pre train, prompt, predict] [Liu Pengfei]
- 插卡4G工业路由器充电桩智能柜专网视频监控4G转以太网转WiFi有线网速测试 软硬件定制
- [network attack and defense training exercises]
- 【网络攻防实训习题】
- Leetcode skimming questions_ Sum of squares
- Kubernetes stateless application expansion and contraction capacity
猜你喜欢

Docker compose configures MySQL and realizes remote connection

晶振是如何起振的?

leetcode刷题_验证回文字符串 Ⅱ

MySQL learning notes 2

Force buckle 9 palindromes

Basic operations of databases and tables ----- primary key constraints

Initialize MySQL database when docker container starts

About error 2003 (HY000): can't connect to MySQL server on 'localhost' (10061)

电气数据|IEEE118(含风能太阳能)

dried food! Accelerating sparse neural network through hardware and software co design
随机推荐
Unity VR resource flash surface in scene
【Flask】官方教程(Tutorial)-part1:项目布局、应用程序设置、定义和访问数据库
3D vision - 4 Getting started with gesture recognition - using mediapipe includes single frame and real time video
WGet: command line download tool
Paddle框架:PaddleNLP概述【飞桨自然语言处理开发库】
Idea sets the default line break for global newly created files
Leetcode 剑指 Offer 59 - II. 队列的最大值
module ‘tensorflow. contrib. data‘ has no attribute ‘dataset
Reasonable and sensible
Leetcode skimming questions_ Verify palindrome string II
2022 Guangxi Autonomous Region secondary vocational group "Cyberspace Security" competition and its analysis (super detailed)
黄金价格走势k线图如何看?
Leetcode 208. Implement trie (prefix tree)
Electrical data | IEEE118 (including wind and solar energy)
剑指 Offer 12. 矩阵中的路径
dried food! Accelerating sparse neural network through hardware and software co design
How does the crystal oscillator vibrate?
Nmap: network detection tool and security / port scanner
Redis-字符串类型
SPIR-V初窥