Skip to content

Commit

Permalink
Add GetIif and GetSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Aug 29, 2021
1 parent 265b0f8 commit fdaf249
Show file tree
Hide file tree
Showing 16 changed files with 1,094 additions and 65 deletions.
2 changes: 2 additions & 0 deletions XRMTokensRun/GetAttribute.Designer.cs

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

8 changes: 6 additions & 2 deletions XRMTokensRun/GetAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ public GetAttribute()
InitializeComponent();
}

public static string ShowDialog(XRMTR owner, EntityMetadata entity, IEnumerable<AttributeMetadata> attributes = null)
public static string ShowDialog(XRMTR owner, EntityMetadata entity = null, IEnumerable<AttributeMetadata> attributes = null)
{
var dialog = new GetAttribute();
dialog.xrmtr = owner;
if (entity == null)
{
entity = dialog.xrmtr.recordmeta;
}
dialog.txtTable.Text = entity.DisplayName.UserLocalizedLabel.Label;
dialog.xrmColumn.DataSource = attributes ?? entity.Attributes.Where(a => a.IsLogical == false);
if (dialog.ShowDialog(owner) == DialogResult.OK)
if (dialog.ShowDialog((Control)owner) == DialogResult.OK)
{
var result = "{" + dialog.xrmColumn.SelectedAttribute.LogicalName;
if (dialog.chkParent.Checked)
Expand Down
29 changes: 29 additions & 0 deletions XRMTokensRun/GetAttribute.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,33 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAEUAAABFAAAAAAEAAAAA
AADAwMAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAANTU1NQECAwQEAwUBNTU1NTU1NQYHCAkKCgkLBwI1NTU1NQwNCQoKCgoKCgoNDjU1NQYNCgoK
CgoKCgoKCg0CNQEHDxARCgoKCgoKEhMUFRYCCBcYCgoKCgoKCgkZEwsaAwkbHB0JCh4fICEiGB8JIwQk
JRgmFyEbHgknIBIQJygEJCkbCioqCSEKCismECwoAwkUHAogHQobHSoZIB8JIwIIFy0KCQkKCiwnChkT
CBoBBxIuHwoKCgoKChsuES8WNQINCgoKCgoKCgoKCjAaNTU1MQ0KCgoKCgoKCjAyMzU1NTUCBwgKCgoJ
CC8FATU1NTU1NRYFNCgoIxoWNTU1NfAPAADgBwAAwAMAAIABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAIABAADAAQAA4AMAAPAPAAA=
</value>
</data>
</root>
12 changes: 7 additions & 5 deletions XRMTokensRun/GetChildEntityAttribute.Designer.cs

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

10 changes: 5 additions & 5 deletions XRMTokensRun/GetChildEntityAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ public GetChildEntityAttribute()
InitializeComponent();
}

public static string ShowDialog(XRMTR owner, EntityMetadata entity, IEnumerable<AttributeMetadata> attributes = null)
public static string ShowDialog(XRMTR owner, EntityMetadata entity = null, IEnumerable<AttributeMetadata> attributes = null)
{
var dialog = new GetChildEntityAttribute();
dialog.xrmtr = owner;
dialog.sourceentity = entity;
dialog.txtTable.Text = entity.DisplayName.UserLocalizedLabel.Label;
var ents = entity.OneToManyRelationships.Select(r => r.ReferencingEntity);
dialog.sourceentity = entity ?? dialog.xrmtr.recordmeta;
dialog.txtTable.Text = dialog.sourceentity.DisplayName.UserLocalizedLabel.Label;
var ents = dialog.sourceentity.OneToManyRelationships.Select(r => r.ReferencingEntity);
dialog.xrmEntityComboBox1.DataSource = owner.entities.Where(e => ents.Contains(e.LogicalName));
if (dialog.ShowDialog(owner) == DialogResult.OK)
if (dialog.ShowDialog((Control)owner) == DialogResult.OK)
{
return "<expand|" +
dialog.xrmEntityComboBox1.SelectedEntity?.LogicalName + "|" +
Expand Down
29 changes: 29 additions & 0 deletions XRMTokensRun/GetChildEntityAttribute.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,33 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAEUAAABFAAAAAAEAAAAA
AADAwMAAxvf3AL29pQC1jGMAvXNCAL21nAC9xrUAvVoYAOdaAAD3YwAA/2MAAOdSAAC9rYwA1lIAAL2c
ewC1lEoASs61AIylawCtlFIAQta1AJycYwDGWhAAxvfvAGu9lACUpWsAvYxCAL21lAClnFoAa72MAIyt
cwCEtYQAhK17AJSlcwBzvZQApZxjALWEUgD3awgAY8acAMaEOQDvawgAvWsxAFLOpQB7tYQAc72MAO9r
EACUpWMAOd7GAMZSEADeUgAAv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