[ExtensionOf(formstr(CredManTable))] final class VKCredManTableFrm_Extension { public void init() { this.GetFormRunPersonalizationSettings().EnableSavedViewQueryPriority(); next init(); }}
[ExtensionOf(classStr(FormRun))] final class VKFormRunCls_Extension { public void init() { if (this.form().name() == formstr(CredManTable)) { // per specific form }// global this.GetFormRunPersonalizationSettings().EnableSavedViewQueryPriority(); next init(); }}
/// <summary> /// Extension point used as a fallback method when saved view's was unable to apply query personalizations due /// to conflicts with the form's query. /// </summary> /// <param name = "_sourceQuery">Query object with saved view query personalizations</param> /// <param name = "_targetQuery">Query object to be executed</param> /// <returns>Method has performed any modifications to the form's query</returns> [Replaceable] public boolean OnFailureQueryPersonalizationApply(Query _sourceQuery, Query _targetQuery) { return false; }
/// <summary> /// Extension point used as a fallback method when saved view's was unable to apply query personalizations due /// to conflicts with the form's query. /// </summary> /// <param name = "_sourceQuery">Query object with saved view query personalizations</param> /// <param name = "_targetQuery">Query object to be executed</param> /// <returns>Method has performed any modifications to the form's query</returns> [Replaceable] public boolean OnFailureQueryPersonalizationApply(Query _sourceQuery, Query _targetQuery) { boolean ret = true; int filterCount, i; QueryBuildDataSource qbdsTarget; Map skipRangesDS = new Map(Types::Integer, Types::Class); Map skipRangesFields= new Map(Types::Integer, Types::Integer); QueryFilter queryFilterSource, queryFilterTarget; FieldId fieldId; TableId tableId; // define fields, which should be skipped skipRangesFields.insert(fieldNum(SalesTable, SalesStatus), 1); skipRangesFields.insert(fieldNum(SalesTable, InterCompanyOrder), 1); // add each Map to it's own data source skipRangesDS.insert(tableNum(SalesTable), skipRangesFields); filterCount = _sourceQuery.queryFilterCount(); for (i = 1; i <= filterCount; i++) { queryFilterSource = _sourceQuery.queryFilter(i); tableId = queryFilterSource.dataSource().table(); if (skipRangesDS.exists(tableId)) { skipRangesFields = skipRangesDS.lookup(tableId); } else { skipRangesFields = null; } fieldId = fieldName2Id(tableId, queryFilterSource.field()); if (skipRangesFields && skipRangesFields.exists(fieldId)) { continue; } qbdsTarget = _targetQuery.dataSourceTable(tableId); if (qbdsTarget) { queryFilterTarget = _targetQuery.addQueryFilter(qbdsTarget, queryFilterSource.field()); queryFilterTarget.value(queryFilterSource.value()); } } return ret; }
If you found value in what I share, I've set up a Buy Me a Coffee page as a way to show your support.
Buy Me a CoffeeNo comments. Be the first one to comment on this post.
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics 365 FO.
Authors are allowed to set their own "buy me a coffee" link.
Join us.