partial void OnLedgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntityChanging(global::Microsoft.Dynamics.DataEntities.AdvancedRuleCriterion value);
        public static AdvancedRule CreateAdvancedRule(string accountStructure, string advancedRuleName, global::Microsoft.Dynamics.DataEntities.AdvancedRuleCriterion ledgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity, global::Microsoft.Dynamics.DataEntities.AccountStructure ledgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity)
        {
            AdvancedRule advancedRule = new AdvancedRule();

            advancedRule.AccountStructure = accountStructure;
            advancedRule.AdvancedRuleName = advancedRuleName;
            if ((ledgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity == null))
            {
                throw new global::System.ArgumentNullException("ledgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity");
            }
            advancedRule.LedgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity = ledgerAdvancedRuleEntity_RelatedRole_LedgerAdvancedRuleCriterionEntity;
            if ((ledgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity == null))
            {
                throw new global::System.ArgumentNullException("ledgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity");
            }
            advancedRule.LedgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity = ledgerAdvancedRuleEntity_RelatedRole_LedgerAccountStructureEntity;
            return(advancedRule);
        }