Skip to content

Autogenerated messages are incorrectly created and reference non-existent class attribute with PAC v1.47.1 #35

Description

@ramirezaa

Describe the bug
When autogenerating the classes from Dynamics, the messageNamesFilter: searchquery and searchautocomplete class files are being generated with a wrong setter. They are using a Parameters to set the response but it does not exist. This issue persists in PAC v1.47.1. The error does not exist with PAC version 1.40.4

To Reproduce
Steps to reproduce the behavior:

  1. Use pac version 1.47.1
  2. Add the following messages to your builderSettings.json file "messageNamesFilter": ["searchautocomplete", "searchquery","sample_*"]
  3. Run: pac modelbuilder build -o . -stf .\builderSettings.json
  4. See error in autogenerated files: searchautocomplete.cs and searchquery.cs
[System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.microsoft.com/xrm/2011/new/")]
[Microsoft.Xrm.Sdk.Client.ResponseProxyAttribute("searchautocomplete")]
public partial class searchautocompleteResponse : Microsoft.Xrm.Sdk.OrganizationResponse
{
	public searchautocompleteResponse()
	{
	}
	
	public string response
	{
		get
		{
			if (this.Results.Contains("response"))
			{
				return ((string)(this.Results["response"]));
			}
			else
			{
				return default(string);
			}
		}
		set
		{
			this.Parameters["response"] = value;//does not exists
		}
	}
}
[System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.microsoft.com/xrm/2011/new/")]
[Microsoft.Xrm.Sdk.Client.ResponseProxyAttribute("searchquery")]
public partial class searchqueryResponse : Microsoft.Xrm.Sdk.OrganizationResponse
{
	public searchqueryResponse()
	{
	}
	
	public string response
	{
		get
		{
			if (this.Results.Contains("response"))
			{
				return ((string)(this.Results["response"]));
			}
			else
			{
				return default(string);
			}
		}
		set
		{
			this.Parameters["response"] = value;//does not exist
		}
	}
}

Error Screenshots

Image Image Image

Expected behavior
Autogenerated classes should not throw any errors, similar to PAC version 1.40.4 as seen below

Expected Behavior Screenshots
Image

Image

Desktop (please complete the following information):

  • OS: Microsoft Windows 10 Business
  • Browser: Chrome

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions