Skip to content

Commit d250e56

Browse files
authored
Merge pull request #132 from rezanid/127-error-for-sdk-messages-without-entity
Error for sdk messages without entity
2 parents c7a868d + c91d8e1 commit d250e56

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

src/XrmTools.Meta.Attributes/XrmTools.Meta.Attributes.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
55
<ImplicitUsings>disable</ImplicitUsings>
66
<DevelopmentDependency>true</DevelopmentDependency>
7-
<VersionPrefix>1.1.1</VersionPrefix>
7+
<VersionPrefix>1.1.2</VersionPrefix>
88
<Description>Attributes to be used by Xrm Tools for source generation, registration and other features in Visual Studio. This is a source only package with no assemblies included.</Description>
99
<Authors>Reza Niroomand</Authors>
1010
<PackageIcon>XrmTools_256.png</PackageIcon>

src/XrmTools.Meta.Attributes/src/CustomApiAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class CustomApiAttribute : Attribute
1212
public string Name { get; set; } = string.Empty;
1313
public string UniqueName { get; }
1414
public string Description { get; set; } = string.Empty;
15-
public ProcessingStepTypes StepType { get; set; } = ProcessingStepTypes.SyncAndAsync;
15+
public ProcessingStepTypes StepType { get; set; } = ProcessingStepTypes.None;
1616
public BindingTypes BindingType { get; set; } = BindingTypes.Global;
1717
public string BoundEntityLogicalName { get; set; } = string.Empty;
1818
public string ExecutePrivilegeName { get; set; } = string.Empty;

src/XrmTools/CodeGenTemplates/Plugin_Steps.sbncs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{~for step in plugintype.steps~}}
2+
{{~if step.primary_entity_definition~}}
23
{{~entity_type_name = step.message_name + step.primary_entity_definition.schema_name + "Entity"~}}
34
{{~if (plugintype.steps | array.size > 1) || (plugintype.steps[0].message.pairs[0].request[0].fields | array.size > 1)~}}
45
public static class {{(plugintype.steps | array.size > 1) ? step.message_name : ""}}InputParameters
@@ -29,4 +30,5 @@ public {{image_type_name}}[] {{image.name}}s
2930
public {{image_type_name}} {{image.name}} { get => EntityOrDefault<{{image_type_name}}>(DependencyScope<{{plugintype.type_name | last_segment }}>.Current.Require<IPluginExecutionContext>().{{image_collection_name}}, "{{image.name}}"); }
3031
{{~end~}}
3132
{{~end~}}
33+
{{~end~}}
3234
{{~end~}}

src/XrmTools/CustomMonikers.imagemanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- Version: 17.0.0.4 -->
44
<ImageManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/VisualStudio/ImageManifestSchema/2014">
55
<Symbols>
6-
<String Name="Resources" Value="/XrmTools;v1.5.8.0;Component/Resources" />
6+
<String Name="Resources" Value="/XrmTools;v1.5.9.0;Component/Resources" />
77
<Guid Name="AssetsGuid" Value="{b11584c1-89bd-47a3-b6a4-05b05dd5fc13}" />
88
<ID Name="ApplyToDataverse" Value="10" />
99
<ID Name="Dataverse" Value="20" />

src/XrmTools/Services/PluginRegistrationService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,10 @@ public async Task<PluginRegistrationResult> RegisterAsync(RegistrationInput inpu
414414
private async Task<Dictionary<string, SdkMessage>> FetchSdkMessagesAsync(PluginAssemblyConfig config, CancellationToken cancellationToken)
415415
{
416416
var stepEntities = config.PluginTypes
417-
.SelectMany(p => p.Steps.Select(s => s.PrimaryEntityName))
417+
.SelectMany(p => p.Steps.Select(s => s.PrimaryEntityName)
418+
.Where(s => !string.IsNullOrEmpty(s)))
418419
.Distinct()
420+
.Union(["none"])
419421
.ToArray();
420422

421423
if (stepEntities == null || stepEntities.Length == 0)

src/XrmTools/Xrm/Repositories/SdkMessageRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ internal interface ISdkMessageRepository : IXrmRepository
2929

3030
internal class SdkMessageRepository(IWebApiService service, ILogger logger) : XrmRepository(service, new SlidingCacheConfiguration()), ISdkMessageRepository
3131
{
32-
private const string sdkMessageQueryForEntities = "sdkmessages?$filter=sdkmessageid_sdkmessagefilter/any(n:({0}) and n/iscustomprocessingstepallowed eq true)&$expand=sdkmessageid_sdkmessagefilter($filter=({1}) and iscustomprocessingstepallowed eq true)";
32+
private const string sdkMessageQueryForEntities = "sdkmessages?$select=name&$filter=sdkmessageid_sdkmessagefilter/any(n:({0}) and n/iscustomprocessingstepallowed eq true)&$expand=sdkmessageid_sdkmessagefilter($filter=({1}) and iscustomprocessingstepallowed eq true;$select=primaryobjecttypecode)";
3333
private const string sdkMessageQuerySingle = "sdkmessages?$filter=sdkmessageid_sdkmessagefilter/any(n:n/primaryobjecttypecode eq '{0}' and n/iscustomprocessingstepallowed eq true)&$expand=sdkmessageid_sdkmessagefilter($filter=primaryobjecttypecode eq '{0}' and iscustomprocessingstepallowed eq true)";
3434
private const string sdkMessageQueryForPlugins_WithExpand = "sdkmessages?$select=name&$filter=sdkmessageid_sdkmessagefilter/any(n:n/iscustomprocessingstepallowed eq true)&$expand=sdkmessageid_sdkmessagefilter($filter=iscustomprocessingstepallowed eq true)";
3535
private const string sdkMessageQueryForPlugins = "sdkmessages?$count=true&$select=name&$filter=sdkmessageid_sdkmessagefilter/any(f:f/iscustomprocessingstepallowed eq true)";

0 commit comments

Comments
 (0)