当前位置:网站首页>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 .
边栏推荐
- Folio. Ink is a free, fast and easy-to-use image sharing tool
- MUX VLAN configuration
- 安装Redis
- ORA-00030
- Format code_ What does formatting code mean
- National intangible cultural heritage inheritor HD Wang's shadow digital collection of "Four Beauties" made an amazing debut!
- LeetCode 322. Change exchange (dynamic planning)
- 2 power view
- Force buckle 9 palindromes
- [detailed] several ways to quickly realize object mapping
猜你喜欢

Accelerating spark data access with alluxio in kubernetes

leetcode刷题_平方数之和

Open source | Ctrip ticket BDD UI testing framework flybirds

False breakthroughs in the trend of London Silver

You are using pip version 21.1.1; however, version 22.0.3 is available. You should consider upgradin

3D vision - 4 Getting started with gesture recognition - using mediapipe includes single frame and real time video

插卡4G工业路由器充电桩智能柜专网视频监控4G转以太网转WiFi有线网速测试 软硬件定制

Basic operations of databases and tables ----- unique constraints

ORA-00030

MUX VLAN configuration
随机推荐
剑指 Offer 12. 矩阵中的路径
Unity VR solves the problem that the handle ray keeps flashing after touching the button of the UI
PHP error what is an error?
[solved] how to generate a beautiful static document description page
[flask] static file and template rendering
一图看懂!为什么学校教了你Coding但还是不会的原因...
leetcode刷题_反转字符串中的元音字母
3D model format summary
Alibaba canal usage details (pit draining version)_ MySQL and ES data synchronization
How to get all sequences in Oracle database- How can I get all sequences in an Oracle database?
【网络攻防实训习题】
SPIR-V初窥
How to upgrade kubernetes in place
ClickOnce does not support request execution level 'requireAdministrator'
CocoaPods could not find compatible versions for pod 'Firebase/CoreOnly'
You are using pip version 21.1.1; however, version 22.0.3 is available. You should consider upgradin
037 PHP login, registration, message, personal Center Design
3D模型格式汇总
[network attack and defense training exercises]
C web page open WinForm exe