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