Please wait, loading...

 

Error : The property is of type EntityReference but doesn’t contain the ReferenceTarget attribute

July 9, 2020

If we are getting below error while registering a custom Workflow

The property from is of type EntityReference but doesn't contain the ReferenceTarget attribute

Then we are missing Reference Target Parameter

While registering a custom Workflow Activity we can get below error if we are missing Reference Target entity

The property lookup from Configration Entity is of type EntityReference but doesn’t contain the ReferenceTarget attribute

  • Code with missing reference Target or Code with Error

  using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.Xrm.Sdk;
    using Microsoft.Xrm.Sdk.Workflow;
    using System.Activities;
    using Microsoft.Xrm.Sdk.Query;

    public class ViolationCreateOppProductandSalesOrde : CodeActivity
    {
    
        #region InputParameter
        /// <summary>
        /// Opportunity LookUp as an input parameter
        /// </summary>
        [RequiredArgument]
        [Input("Lookup Schema Name")]
        public InArgument<EntityReference> Configration{ get; set; }

------------------------------
---------
-------------------------------
  • Code Corrected and Added Reference Target ( Tat will contain Target entity name)
  using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.Xrm.Sdk;
    using Microsoft.Xrm.Sdk.Workflow;
    using System.Activities;
    using Microsoft.Xrm.Sdk.Query;

    public class ViolationCreateOppProductandSalesOrde : CodeActivity
    {
    
        #region InputParameter
        /// <summary>
        /// Opportunity LookUp as an input parameter
        /// </summary>
        [RequiredArgument]
        [Input("LookUP")]
        [ReferenceTarget("opportunity")]
        public InArgument<EntityReference> Configration { get; set; }

------------------------------
---------
-------------------------------

Hope this was Help Full.

Thanks

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/Microsoftdynamics365.png?fit=640%2C651&ssl=1
Microsoft Dynamics Community Profile

Learn more