workflow Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/workflow/ Microsoft Dynamics CRM . Microsoft Power Platform Thu, 09 Jul 2020 16:47:33 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 workflow Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/workflow/ 32 32 176351444 Error : The property is of type EntityReference but doesn’t contain the ReferenceTarget attribute http://microsoftdynamics.in/2020/07/09/error-the-property-is-of-type-entityreference-but-doesnt-contain-the-referencetarget-attribute/ Thu, 09 Jul 2020 16:47:33 +0000 http://microsoftdynamics.in/?p=3879 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

The post Error : The property <name> is of type EntityReference but doesn’t contain the ReferenceTarget attribute appeared first on Microsoft Dynamics 365 Blog.

]]>

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

The post Error : The property <name> is of type EntityReference but doesn’t contain the ReferenceTarget attribute appeared first on Microsoft Dynamics 365 Blog.

]]>
3879
Insert Hyperlink in Email using workflow in ms crm 2013 , mscrm , Microsoft Dynamics CRM http://microsoftdynamics.in/2015/11/16/insert-hyperlink-in-email-using-workflow-in-ms-crm-2013-mscrm-microsoft-dynamics-crm/ Mon, 16 Nov 2015 16:00:00 +0000 http://microsoftdynamics.in/2015/11/16/insert-hyperlink-in-email-using-workflow-in-ms-crm-2013-mscrm-microsoft-dynamics-crm/ Below are the steps to add hyperlink in Email using workflow in ms crm . 1. open workflow add Send Email Step 2.  Now click on ICON to add details url etc.  Now hyperlink URL will be available in Email. SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Insert Hyperlink in Email using workflow in ms crm 2013 , mscrm , Microsoft Dynamics CRM appeared first on Microsoft Dynamics 365 Blog.

]]>
Below are the steps to add hyperlink in Email using workflow in ms crm .

1. open workflow add Send Email Step

2.  Now click on ICON to add details url etc. 

Now hyperlink URL will be available in Email.


SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Insert Hyperlink in Email using workflow in ms crm 2013 , mscrm , Microsoft Dynamics CRM appeared first on Microsoft Dynamics 365 Blog.

]]>
2786
ERROR : The specified user is either disabled or is not a member of any business unit in Microsoft Dynamics CRM while activating workflow or saving a record ( The System Could not log you on. This could be because your user record or the business unit you belong to has been disabled in microsoft Dynamics CRM ) http://microsoftdynamics.in/2015/11/16/error-the-specified-user-is-either-disabled-or-is-not-a-member-of-any-business-unit-in-microsoft-dynamics-crm-while-activating-workflow-or-saving-a-record-the-system-could-not-log-you-on-this-cou/ Mon, 16 Nov 2015 15:24:00 +0000 http://microsoftdynamics.in/2015/11/16/error-the-specified-user-is-either-disabled-or-is-not-a-member-of-any-business-unit-in-microsoft-dynamics-crm-while-activating-workflow-or-saving-a-record-the-system-could-not-log-you-on-this-cou/ While activating one draft workflow,  i was getting an error . The System Could not log you on. This could be because your user record or the business unit you belong to has been disabled in Microsoft Dynamics CRM  This happened because of following  : 1. Workflow owner user is deactivated , change the user or activate the one and...

The post ERROR : The specified user is either disabled or is not a member of any business unit in Microsoft Dynamics CRM while activating workflow or saving a record ( The System Could not log you on. This could be because your user record or the business unit you belong to has been disabled in microsoft Dynamics CRM ) appeared first on Microsoft Dynamics 365 Blog.

]]>
While activating one draft workflow,  i was getting an error .

The System Could not log you on. This could be because your user record or the business unit you belong to has been disabled in Microsoft Dynamics CRM 

This happened because of following  :
1. Workflow owner user is deactivated , change the user or activate the one and activate the workflow .
2. If error is coming while saving a record , the plugin or workflow might be executing under user context and that user is no longer enabled , either change the context to organization ( for workflow) 


SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post ERROR : The specified user is either disabled or is not a member of any business unit in Microsoft Dynamics CRM while activating workflow or saving a record ( The System Could not log you on. This could be because your user record or the business unit you belong to has been disabled in microsoft Dynamics CRM ) appeared first on Microsoft Dynamics 365 Blog.

]]>
2787
Share A Record With Read Only Access Using Custom Workflow IN MS CRM 2011 , MS CRM 2013 , MS CRM 2015 http://microsoftdynamics.in/2015/01/05/share-a-record-with-read-only-access-using-custom-workflow-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Sun, 04 Jan 2015 20:00:00 +0000 http://microsoftdynamics.in/2015/01/05/share-a-record-with-read-only-access-using-custom-workflow-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Share a Record to a user without Assigning the record and with out giving Read access to that user , its a Custom Workflow to share a record with read only access , ( NOTE : You can not give read only access to owner of that record so , first we have to change...

The post Share A Record With Read Only Access Using Custom Workflow IN MS CRM 2011 , MS CRM 2013 , MS CRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Share a Record to a user without Assigning the record and with out giving Read access to that user , its a Custom Workflow to share a record with read only access , ( NOTE : You can not give read only access to owner of that record so , first we have to change the owner and then we can share it to created by user with read only access )


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


namespace Readonlyaccess_sharerecord
{
    public class Class1 : CodeActivity
    {
        #region input parameter
        // In set property : give the user to whom record will be shared
        [ Input( “User_to_Share” )]
        // look up field of system user “Entity Name”
        [ ReferenceTarget (“systemuser” )]
        public InArgument <EntityReference > _User_to_Share { getset; }
        #endregion

        #region Output parameter
        //
        [ Output( “condition” )]
        public OutArgument <string > _condition { getset; }

        #endregion
        protected override void Execute( CodeActivityContext context)
        {

            IWorkflowContext workflowContext = context.GetExtension<IWorkflowContext >();
            IOrganizationServiceFactory serviceFactory = context.GetExtension<IOrganizationServiceFactory >();
            IOrganizationService service = serviceFactory.CreateOrganizationService(workflowContext.UserId);
            #region paramters
            EntityReference User_to_Share = _User_to_Share.Get<EntityReference >(context);

            #endregion
            try
            {
                Entity Obj_entity = (Entity )service.Retrieve(workflowContext.PrimaryEntityName, workflowContext.PrimaryEntityId, newColumnSet (true ));

                try
                {
                    //no delete access
                    GrantAccessRequest grant = new GrantAccessRequest ();
                    grant.Target = new EntityReference (workflowContext.PrimaryEntityName, workflowContext.PrimaryEntityId);

                    PrincipalAccess principal = new PrincipalAccess ();
                    principal.Principal = User_to_Share;
                    principal.AccessMask = AccessRights .ReadAccess;
                    grant.PrincipalAccess = principal;
                    GrantAccessResponse grant_response = (GrantAccessResponse )service.Execute(grant);
                    _condition.Set(context, “1” );

                }
                catch ( Exception ex)
                {
                    _condition.Set(context, “0” );
                    throw new Exception( “Enable to Grant Read Access i.e.” + ex.Message);
                }

            }
            catch ( Exception ex)
            {
                throw new Exception( “Error Due To Master User Share i.e.” + ex.Message);
            }

        }
    }
}

1. Add Step to your Workflow.

2. Set Property and provide the user whom to share the record.

3. Forms become readonly after execution of record

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Share A Record With Read Only Access Using Custom Workflow IN MS CRM 2011 , MS CRM 2013 , MS CRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2805