var navigateFormId;
if (typeof (t1) == "undefined")
{ t1 = { __namespace: true }; }
t1.Entity = {
Form:
{
Default: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
OtherForm: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
},
FormType:
{
Undefined: 0,
Create: 1,
Update: 2,
ReadOnly: 3,
Disabled: 4,
QuickCreate: 5,
BulkEdit: 6
},
OnLoad: function () {
var formType = Xrm.Page.ui.getFormType();
try {
if (formType == t1.Entity.FormType.Update) {
var lookup= Xrm.Page.getAttribute("new_attribute").getValue();
var currentFormId = Xrm.Page.ui.formSelector.getCurrentItem().getId();
if (lookup && currentFormId.toLowerCase() != t1.Entity.Form..toLowerCase()) {
navigateFormId = E2.BaseContract.Form.OtherForm.toLocaleLowerCase();
} else {
if (currentFormId.toLowerCase() != t1.Entity.Form.Default.toLowerCase()) {
navigateFormId = t1.Entity.Form.Default.toLocaleLowerCase();
}
}
}
if (navigateFormId) {
setTimeout("t1.Entity.Navigate()", 4000);
}
} catch (e) {
}
},
Navigate: function () {
if (navigateFormId) {
Xrm.Page.ui.formSelector.items.get(navigateFormId).navigate();
}
},
__namespace: true
};
No comments:
Post a Comment