Skip to content

Commit ae132db

Browse files
committed
2 parents d84c7cb + 7afcfe2 commit ae132db

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.vs/CCOF/config/applicationhost.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
</site>
156156
<site name="CCOF.Application.WebResources" id="2">
157157
<application path="/" applicationPool="Clr4IntegratedAppPool">
158-
<virtualDirectory path="/" physicalPath="C:\Richard\Code\CCOF\EDUC-CCOF-D365\CCOF.Application.WebResources" />
158+
<virtualDirectory path="/" physicalPath="C:\Users\p.alemettesivanaraya\source\repos\CCOF MARCH\CCOF.Application.WebResources" />
159159
</application>
160160
<bindings>
161161
<binding protocol="http" bindingInformation="*:6061:localhost" />
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
var Contact = Contact || {};
2+
Contact.BCeid = Contact.BCeid || {};
3+
Contact.BCeid.Form = Contact.BCeid.Form || {};
4+
5+
Contact.BCeid.Form = {
6+
getTypeOfForm: function () {
7+
debugger;
8+
9+
var UserName = Xrm.Page.getAttribute("ccof_username").getValue(); //Get user name on the contact form, If user name present, display bceid form other wise contact only.
10+
console.log("UserName" + UserName);
11+
var lblForm;
12+
if (UserName != null) {
13+
lblForm = "BCeID";
14+
}
15+
else {
16+
lblForm = "CCOF Contact Only";
17+
}
18+
19+
// Current form's label
20+
var formLabel = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();
21+
console.log("lblForm " + lblForm);
22+
console.log("CFL " + formLabel);
23+
//check if the current form is form need to be displayed based on the value
24+
if (Xrm.Page.ui.formSelector.getCurrentItem().getLabel() != lblForm) {
25+
var items = Xrm.Page.ui.formSelector.items.get();
26+
for (var i in items) {
27+
var item = items[i];
28+
var itemId = item.getId();
29+
var itemLabel = item.getLabel()
30+
if (itemLabel == lblForm) {
31+
//Check the current form is the same form to be redirected.
32+
if (itemLabel != formLabel) {
33+
//navigate to the form
34+
item.navigate();
35+
} //endif
36+
}//endif
37+
} //end for
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)