Skip to content

Commit

Permalink
Possible to exclude all (?) MS custom tables #88
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Dec 30, 2023
1 parent 05ee444 commit 218a142
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 108 deletions.
12 changes: 10 additions & 2 deletions LCG-UDG/LCG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -903,11 +903,16 @@ bool GetCustomFilter(EntityMetadataProxy e)
}
bool GetNoDataFilter(EntityMetadataProxy e) { return !chkEntExclNoRecords.Checked || e.Records > 0 || e.Records == null; }

bool GetNoMSFT(EntityMetadataProxy e) =>
!chkEntExclMS.Checked ||
!e.LogicalName.Contains("_") ||
!(commonsettings.MicrosoftPrefixes.Contains(e.LogicalName.Split('_')[0] + "_"));

if (ConnectionDetail?.OrganizationMajorVersion < 9 && chkEntExclNoRecords.Checked)
{
MessageBox.Show("Sorry, currently not possible to count records with Dynamics 365 before version 9.*.\n\nClick 'Help' for more info!",
"Count Records", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1, 0,
"https://learn.microsoft.com/dotnet/api/microsoft.crm.sdk.messages.retrievetotalrecordcountrequest?WT.mc_id=BA-MVP-5002475");
"https://learn.microsoft.com/dotnet/api/microsoft.crm.sdk.messages.retrievetotalrecordcountrequest?WT.mc_id=DX-MVP-5002475");
chkEntExclNoRecords.Checked = false;
}
var filteredentities = entities.Where(
Expand All @@ -917,7 +922,8 @@ bool GetCustomFilter(EntityMetadataProxy e)
&& GetManagedFilter(e)
&& GetIntersectFilter(e)
&& GetSearchFilter(e)
&& GetNoDataFilter(e));
&& GetNoDataFilter(e)
&& GetNoMSFT(e));
return filteredentities;
}

Expand Down Expand Up @@ -1216,6 +1222,8 @@ private void LoadCommonSettings()
}
commonsettings.MigrateFromOldConfig(isUML);
commonsettings.SetFixedValues(isUML);
toolTip1.SetToolTip(chkEntExclMS, $"Will not include with prefix:\r\n {string.Join($"\r\n ", commonsettings.MicrosoftPrefixes)}");

}

private void LoadEntities()
Expand Down
21 changes: 18 additions & 3 deletions LCG-UDG/LCG.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 218a142

Please sign in to comment.