This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function onLoad(executionContext){ | |
| var formContext = executionContext.getFormContext(); | |
| var pageContext = Xrm.Utility.getPageContext(); | |
| var isWon = pageContext.input.data.param_won; | |
| if(isWon) formContext.getControl('actualend').setLabel('Win date'); | |
| else formContext.getControl('actualend').setLabel('Lose date'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Crm.Sdk.Messages; | |
| using Microsoft.Xrm.Sdk; | |
| using Microsoft.Xrm.Sdk.Messages; | |
| using Microsoft.Xrm.Sdk.Query; | |
| using Microsoft.Xrm.Tooling.Connector; | |
| using System; | |
| namespace MEA | |
| { | |
| class sampleConsoleApp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (typeof (MEA) == "undefined") { MEA = {} }; | |
| if (typeof (MEA.Account) == "undefined") { MEA.Account = {} }; | |
| if (typeof (MEA.Account.AccountForm) == "undefined") { MEA.Account.AccountForm = {} }; | |
| MEA.Account.AccountForm = { | |
| onLoad: function (executionContext) { | |
| var formContext = executionContext.getFormContext(); | |
| formContext.data.entity.addOnSave( | |
| (() => { | |
| var asyncSaveValidation = (saveCtx) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (typeof (MEA) == "undefined") { MEA = {} }; | |
| if (typeof (MEA.Account) == "undefined") { MEA.Account = {} }; | |
| if (typeof (MEA.Account.AccountForm) == "undefined") { MEA.Account.AccountForm = {} }; | |
| MEA.Account.AccountForm = { | |
| onLoad: function (executionContext) { | |
| var formContext = executionContext.getFormContext(); | |
| formContext.data.entity.addOnSave( | |
| (() => { | |
| var asyncSaveValidation = (saveCtx) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (typeof (MEA) == "undefined") { MEA = {} }; | |
| if (typeof (MEA.Account) == "undefined") { MEA.Account = {} }; | |
| if (typeof (MEA.Account.AccountForm) == "undefined") { MEA.Account.AccountForm = {} }; | |
| MEA.Account.AccountForm = { | |
| onLoad: function (executionContext) { | |
| var formContext = executionContext.getFormContext(); | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| var formItem = formContext.ui.formSelector.items.get(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (typeof (MEA) == "undefined") { MEA = {} }; | |
| if (typeof (MEA.Utilities) == "undefined") { MEA.Utilities = {} }; | |
| MEA.Utilities = { | |
| onLoad:function(primaryControl, cmdProperties){ | |
| var formContext = primaryControl; | |
| this.openModalFormForAllLookupFields(formContext); | |
| }, | |
| openModalFormForAllLookupFields: function(formContext){ | |
| var attributes = formContext.data.entity.attributes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (typeof (MEA) == "undefined") { MEA = {} }; | |
| if (typeof (MEA.Account) == "undefined") { MEA.Account = {} }; | |
| if (typeof (MEA.Account.AccountForm) == "undefined") { MEA.Account.AccountForm = {} }; | |
| MEA.Account.AccountForm = { | |
| onLoad: function (executionContext) { | |
| var formContext = executionContext.getFormContext(); | |
| var attributes = formContext.data.entity.attributes; | |
| attributes.forEach(att => { | |
| att.getAttributeType() == 'lookup' ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (typeof (MEA) == "undefined") { MEA = {} }; | |
| if (typeof (MEA.Opportunity) == "undefined") { MEA.Opportunity = {} }; | |
| if (typeof (MEA.Opportunity.OpportunityForm) == "undefined") { MEA.Opportunity.OpportunityForm = {} }; | |
| MEA.Opportunity.OpportunityForm = { | |
| onLoad: function (executionContext) { | |
| var formContext = executionContext.getFormContext(); | |
| formContext.getAttribute('budgetamount').addOnChange(this.setNeedApproval); | |
| formContext.getAttribute('mea_riskscode').addOnChange(this.setNeedApproval); | |
| formContext.getControl('mea_isneedapproval').setDisabled(true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(typeof(MEA)=="undefined"){MEA={}}; | |
| if(typeof(MEA.OptionSet)=="undefined"){MEA.OptionSet={}}; | |
| if(typeof(MEA.OptionSet.Utilities)=="undefined"){MEA.OptionSet.Utilities={}}; | |
| MEA.OptionSet.Utilities = { | |
| //Cascading Utility | |
| optionSetBValues : null, | |
| Cascade: function (executionContext, optionAName, optionBName, dependecies) { | |
| var formContext = executionContext.getFormContext(); | |
| var selectedAValue = formContext.getAttribute(optionAName).getValue(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Xrm.Sdk; | |
| using Microsoft.Xrm.Sdk.Client; | |
| using Microsoft.Xrm.Sdk.Query; | |
| using System; | |
| using System.ServiceModel.Description; | |
| namespace MelTools | |
| { | |
| class getAllUsersPersonalViewsContainingField |