This repository has been archived by the owner on Mar 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patharticle-convvr.html
197 lines (177 loc) · 10.2 KB
/
article-convvr.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Salesforce Discord Community</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.12/css/all.css" integrity="sha384-G0fIWCsCzJIMAVNQPfjH08cyYaUtMwjJwqiRKxxE/rx96Uroj1BtIQ6MLJuheaO9" crossorigin="anonymous">
<link href="assets/css/style.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Raleway:400,500,600,700,800' rel='stylesheet' type='text/css'>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon" sizes="180x180" href="/assets/ico/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/ico/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/ico/favicon-16x16.png">
<link rel="manifest" href="/assets/ico/site.webmanifest">
<link rel="mask-icon" href="/assets/ico/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/assets/ico/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/assets/ico/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<!-- NAVBAR
================================================== -->
<div class="banner navbar navbar-static-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="index.html"><img src="assets/img/logo.png" width=70px></a>
<!-- Responsive Navbar -->
<div id="nav-main">
<ul id="menu" class="nav">
<li><a href="index.html">Home</a></li>
<li class="active"><a href="wiki-index.html">Knowledge Base</a></li>
<li><a href="faq.html">Faq</a></li>
<!-- Read about Bootstrap dropdowns at http://twitter.github.com/bootstrap/javascript.html#dropdowns -->
</ul>
</div><!--/.nav-collapse -->
</div> <!-- /.container -->
</div><!-- /.navbar-inner -->
</div><!-- /.navbar -->
<!-- PAGE HEADER -->
<div id="page-header-container">
<div class="container">
<div class="page-header row">
<div class="span8">
<h1>The SFXD wiki</h1>
<p class="tagline">Literally one page</p>
</div>
</div>
</div>
</div>
<!-- PAGE CONTENT -->
<div id="wrap" class="container" role="document">
<div id="content" class="row">
<div id="main" class="single-post span12" role="main">
<article class="post type-post">
<header>
<h1 class="entry-title">Validation Rules Naming Convention</h1>
<div class="post-meta">
<time class="updated" pubdate>Last Updated: June 13, 2018</time>
</div>
</header>
<div class="page-main">
<p>All Naming Conventions Are <a href="https://www.ietf.org/rfc/rfc2119.txt">RFC 2119</a> and <a href="https://tools.ietf.org/html/rfc6919">RFC 6919</a> compliant.</p>
<h3 id="metadata-conventions">Metadata Conventions</h3>
The Validation Rule Name ***MUST*** try to explain in a concise manner what the validation rule prevents.
Note that conciseness trumps clarity for this field.
<ol>
<li> The Validation Rule Name ***MUST*** try to explain in a concise manner what the validation rule prevents.
Note that conciseness trumps clarity for this field.</li>
<li>All validation Rules <code>API</code> names <strong><em>MUST</em></strong> be written in <a href="https://en.wikipedia.org/wiki/PascalCase" target="_blank">PascalCase</a>.</li>
<li>Validation Rules <strong><em>SHOULD NOT</em></strong> contain an underscore in the fields name, except where explicitely defined otherwise in these conventions.</li>
<li>A Validation Rule <strong><em>SHALL</em></strong> always start by <code>VR</code>, followed by a shorthand name of the object, followed by a number corresponding to the number of validation rules on the triggering Object, followed by an underscore.</li>
<li>The Validation Rule Error Message <strong><em>MUST</em></strong> contain an error code indicating the number of the Validation Rule, in the format <code>[VRXX]</code>, <code>XX</code> being the Validation Rule Number. <em>\\</em>1*</li>
<li>Validation Rules <strong><em>MUST</em></strong> have a description, where the description details the Business Use Case that is adressed by the VR. A Description <strong><em>SHALL NOT</em></strong> contain technical desccriptions of what triggers the VR - the Validation Rule itself <strong><em>SHOULD</em></strong> be written in such a manner as to be clearly readable.</li>
</ol>
<h3 id="rule-conventions">Rule Conventions</h3>
<ol>
<li>
All Validation Rules MUST contain a Bypass Rule check.</li>
<ul>
<li>The simplest bypass is a custom field of type <code>Checkbox</code>, set on the <code>User</code> Sobject, which you can Name <code>Bypass Validation Rules</code>. To avoid having to check how the consultant set the bypass, we recommend the API name always be <code>IsBypassVR__c</code>.</li>
<li>If more granularity is needed, a consultant <strong><em>MAY</em></strong> want to create a <code>Hierarchical Custom Setting</code> to implement the bypass.</li>
<li>This bypass can be added to the more common User-based bypass, but <strong><em>SHOULD NOT</em></strong> supplant it.</li>
</ul>
<li><p>Wherever possible, a Consultant <strong><em>SHOULD</em></strong> use operators over functions.</p></li>
<li><p>All possible instances of <code>IF()</code> <strong><em>SHOULD</em></strong> be replaced by <code>CASE()</code></p></li>
<li><p>Referencing other formula fields should be avoided at all cost. </p></li>
<li><p>In all instances, <code>ISBLANK()</code> should be used instead of <code>ISNULL</code>, as per <a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions.htm&language=en#ISBLANKDef">this link</a>.</p></li>
<li><p>Validation Rules <strong><em>MUST NOT</em></strong> be triggered in a casquading manner. <em>\\</em>2*</p>
<h3 id="examples">Examples</h3></li>
</ol>
<table>
<thead>
<tr>
<th>Name</th>
<th>Formula</th>
<th>Error Message</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>VR01_OPP_CancelReason</td>
<td><code>!$User.IsCanBypassVR__c && <BR/>TEXT(Cancellationreason__c)="Other" &&<BR/>ISNULL(OtherCancellationReason__c)</code></td>
<td>If you select "other" as a cancellation reason, you must fill out the details of that reason. [VR01]</td>
<td>Prevents selecting "other" less reason without putting a comment in. [VR01]</td>
</tr>
<tr>
<td>VR02_OPP_NoApprovalCantReserve</td>
<td><code>!$User.IsCanBypassVR__c && <BR/>!IsApproved__c && <BR/>( ISPICKVAL(Status__c,"Approved - CC ") ||<BR/> ISPICKVAL(Status__c,"Approved - Client") ||<BR/> ISPICKVAL(Status__c,"Paid") )</code></td>
<td>The status cannot advance further if it is not approved. [VR02]</td>
<td>The status cannot advance further if it is not approved. [VR02]</td>
</tr>
</tbody>
</table>
<blockquote>
<p><em>\</em>1 While including an error code in a user displayed message may be seen as strange, this will allow any admin or consultant to find exactly which validation rule is causing problems when user need only communicate the end code for debugging purposes.*
<em>\</em>2 Casquading Validation Rules are defined as VRs that trigger when another VR is triggered. Example: A field is mandatory if the status is Lost, but the field cannot contain less than 5 characters. Doing two validation rules which would trigger one another would result in a user first seeing that the fild is mandatory, then saving again, and being presented with the second error. In this case, the second error should be displayed as soon as the first criteria is met..*</p>
</blockquote></div></div>
</div>
</div><!-- /#content -->
</div><!-- /#wrap -->
<!-- FOOTER -->
<footer>
<div class="main-footer">
</div>
<!-- Sub footer -->
<div class="sub-footer">
<div class="container">
<div id="social-icons">
<ul>
<li class="social-icon discord">
<a class="fade-img" href="http://discord.gg" target="_blank" rel="tooltip" title="Discord">
<img src="assets/img/social/icons_discord.png" alt="Discord" />
</a>
</li>
<li class="social-icon salesforce">
<a class="fade-img" href="http://www.salesforce.com" target="_blank" rel="tooltip" title="Salesforce">
<img src="assets/img/social/icons_salesforce.png" alt="Salesforce" />
</a>
</li>
</ul>
</div>
<div class="copyright-text">Copyright 2018. Powered by <a href='http://github.io/'>GitHub</a>
</div>
</div>
</div>
</footer>
<!-- Javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap-transition.js"></script>
<script src="assets/js/bootstrap-alert.js"></script>
<script src="assets/js/bootstrap-modal.js"></script>
<script src="assets/js/bootstrap-dropdown.js"></script>
<script src="assets/js/bootstrap-tab.js"></script>
<script src="assets/js/bootstrap-tooltip.js"></script>
<script src="assets/js/bootstrap-popover.js"></script>
<script src="assets/js/bootstrap-button.js"></script>
<script src="assets/js/bootstrap-collapse.js"></script>
<script src="assets/js/bootstrap-carousel.js"></script>
<script type="text/javascript" src="assets/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="assets/js/jquery.fitvids.js"></script>
<script type="text/javascript" src="assets/js/application.js"></script>
<script src="assets/js/holder/holder.js"></script>
</body>
</html>