Skip to content

Commit 5f832c5

Browse files
Commit for change action JS and Provider profile
1 parent 0b81ada commit 5f832c5

File tree

4 files changed

+99
-1
lines changed

4 files changed

+99
-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: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
function hideFacilitiesSection(executionContext) {
2+
var formContext = executionContext.getFormContext();
3+
var changeType = Xrm.Page.getAttribute("ccof_changetype");
4+
5+
if (typeof (changeType) != "undefined" && changeType.getValue() != null) {
6+
7+
if (changeType.getValue() == 100000005) { //Value of "Add New Facility"
8+
//hide the document list and mtfi
9+
formContext.ui.tabs.get("general_tab").sections.get("attachments_section").setVisible(false);
10+
formContext.ui.tabs.get("general_tab").sections.get("mtfi_facilities_section").setVisible(false);
11+
12+
//show the unlock section
13+
formContext.ui.tabs.get("general_tab").sections.get("org_unlock_section").setVisible(true);
14+
//hide the change request unlock and document unlock field
15+
formContext.getControl("ccof_unlock_change_request").setVisible(false);
16+
formContext.getControl("ccof_unlock_other_changes_document").setVisible(false);
17+
18+
} else if (changeType.getValue() == 100000007) { //Value of "MTFI"
19+
//hide the document list and new facilities
20+
//formContext.ui.tabs.get("general_tab").sections.get("attachments_section").setVisible(false);
21+
formContext.ui.tabs.get("general_tab").sections.get("new_facilities_section").setVisible(false);
22+
}
23+
else if (changeType.getValue() == 100000015 || changeType.getValue() == 100000016 || changeType.getValue() == 100000017) { //Value of "NEW CLOSURE" "EDIT CLOSURE" "REMOVE CLOSURE"
24+
debugger;
25+
formContext.ui.tabs.get("general_tab").sections.get("change_action_closure_section").setVisible(true);
26+
formContext.ui.tabs.get("general_tab").sections.get("new_facilities_section").setVisible(false);
27+
formContext.ui.tabs.get("general_tab").sections.get("mtfi_facilities_section").setVisible(false);
28+
29+
}
30+
else { //Change type is other changes
31+
//hide the mtfi and new facilities
32+
formContext.ui.tabs.get("general_tab").sections.get("new_facilities_section").setVisible(false);
33+
formContext.ui.tabs.get("general_tab").sections.get("mtfi_facilities_section").setVisible(false);
34+
35+
//show the unlock section
36+
formContext.ui.tabs.get("general_tab").sections.get("org_unlock_section").setVisible(true);
37+
//hide the ecewe unlock, licence upload unlock and supporting document unlock field
38+
formContext.getControl("ccof_unlock_ccof").setVisible(false);
39+
formContext.getControl("ccof_unlock_ecewe").setVisible(false);
40+
formContext.getControl("ccof_unlock_licence_upload").setVisible(false);
41+
formContext.getControl("ccof_unlock_supporting_document").setVisible(false);
42+
}
43+
}
44+
}
45+
46+
//Open Unlock Notes Custom Page On save
47+
function openCRUnlockCustomPage(entityName, recordId) {
48+
var window_width = 1400;
49+
var window_height = 900;
50+
51+
Xrm.WebApi.retrieveRecord(entityName, recordId).then(
52+
function success(result) {
53+
54+
//if Change Action type is not MTFI and New Facility
55+
if (result.ccof_changetype != 100000005 && result.ccof_changetype != 100000007) {
56+
window_height = 417;
57+
}
58+
// console.log(result);
59+
Xrm.Navigation.navigateTo({
60+
pageType: "custom",
61+
name: "ccof_changerequestunlockform_f6704",
62+
entityName: entityName,
63+
recordId: recordId,
64+
65+
}, {
66+
target: 2,
67+
width: window_width,
68+
height: window_height
69+
})
70+
.then(function () {
71+
// formContext.data.refresh();
72+
})
73+
.catch(console.error);
74+
75+
},
76+
function (error) {
77+
console.log(error.message);
78+
// handle error conditions
79+
}
80+
)
81+
82+
}
83+
function showHideCreateUnlockButton(primaryControl) {
84+
debugger;
85+
var formContext = primaryControl;
86+
87+
88+
var visible = false;
89+
var userRoles = Xrm.Utility.getGlobalContext().userSettings.roles;
90+
userRoles.forEach(function hasRole(item, index) {
91+
if (item.name === "CCOF - Sr. Adjudicator" || item.name === "CCOF - Admin" || item.name === "CCOF - Leadership" || item.name === "System Administrator") {
92+
visible = true;
93+
}
94+
});
95+
return visible;
96+
};

CCOF.Infrastructure.WebAPI/Controllers/ProviderFiscalProfileController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public ActionResult<string> Get(string userName, string? userId = null)
5959
<attribute name=""ccof_unlock_supportingdocument"" />
6060
<attribute name=""ccof_unlock_ccof"" />
6161
<attribute name=""ccof_unlock_ecewe"" />
62+
<attribute name=""ccof_application_template_version"" />
6263
<link-entity name=""ccof_program_year"" from=""ccof_program_yearid"" to=""ccof_programyear"" link-type=""outer"" alias=""ProgramYear"">
6364
<attribute name=""ccof_name"" />
6465
<attribute name=""ccof_program_yearid"" />

CCOF.Infrastructure.WebAPI/Models/CCOFModels.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public class Application
9292
public int? statuscode { get; set; }
9393
[JsonPropertyName("ccof_providertype@OData.Community.Display.V1.FormattedValue")]
9494
public string? ccof_providertype_formatted { get; set; }
95+
public string? ccof_application_template_version { get; set; }
9596
public int? ccof_providertype { get; set; }
9697
public string? _ccof_organization_value { get; set; }
9798
public int? ccof_unlock_ccof { get; set; }

0 commit comments

Comments
 (0)