-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtempEntityForm.js
More file actions
23 lines (20 loc) · 981 Bytes
/
Copy pathtempEntityForm.js
File metadata and controls
23 lines (20 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function OnLoad(executionContext) {
var formContext = executionContext.getFormContext();
//create or update form type then
if (formContext.ui.getFormType() == 1 || formContext.ui.getFormType() == 2) {
var ownerControl = formContext.getControl('ownerid');
if (ownerControl.getEntityTypes().length > 1) {
// Set entity type to team
ownerControl.setEntityTypes(['team']);
//alert(ownerControl.getEntityTypes().length);
//set default view to display "My Owner Teams" (which will only show teams user been part of!)
var defaultViewId = "00000000-0000-0000-00AA-000010001027";
ownerControl.setDefaultView(defaultViewId);
}
//while Creating new record set default value to blank for user to pick correct team!
if(formContext.ui.getFormType() == 1)
{
ownerControl.getAttribute().setValue(null);
}
}
}