-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCreateDelete2.js
39 lines (34 loc) · 1.38 KB
/
CreateDelete2.js
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
function Dianamics_CreateDelete_Onload(executionContext){
const formContext = executionContext.getFormContext();
const dialogs = FormDialog(formContext, ["orb_comment", "orb_count"], "orb_createdeletecancelactioncode",true);
dialogs.setActions({
"434350000" : function(){ //calculate
const dataToSave = dialogs.attributes.map(function(attribute){
return [attribute.getName(), attribute.getValue()];
})
Xrm.Navigation.openAlertDialog({text: `Will execute a related create with: ${JSON.stringify(dataToSave)}`})
.then(() => formContext.ui.close());
},
"434350001" : function(){//delete
Xrm.Navigation.openAlertDialog({text: `Will execute a delete`})
.then(() => formContext.ui.close());
},
"434350002" : function(){
formContext.ui.close();
}
})
}
/*
Xrm.Navigation.navigateTo({
pageType: "entityrecord",
entityName: "orb_dialog",
entityId: "83BD09D6-930D-EB11-A813-000D3A23CB53",
formId:"18BCC641-5D5E-433C-8106-C4099F4C9962",
createdFromEntity: {entityType: "orb_testentity", id: Xrm.Page.data.entity.getId(), name: "dummy"}
}, {
target: 2,
width: 600,
height: 350,
position: 1}
).then(console.log, console.error);
*/