Home » Dynamics (Page 2)

Category Archives: Dynamics

Fixed – ‘The attachment cannot be saved. Either specify activityId or ObjectTypeCode & ObjectId’ error while processing Email Attachment using SSIS

Introduction:

While performing data migration most of the time, we need to migrate Email and Email Attachments, where we first migrate the Emails and then migrate the Email Attachments.

However, when we did a run for this, we were facing the below error.

‘The attachment cannot be saved. Either specify activityId or ObjectTypeCode & ObjectId.’

We had done the mapping for the Email attachments in the Destination CRM as shown in the screenshot below;

'The attachment cannot be saved. Either specify activityId or ObjectTypeCode & ObjectId' error while processing Email Attachment using SSIS

'The attachment cannot be saved. Either specify activityId or ObjectTypeCode & ObjectId' error while processing Email Attachment using SSIS

After investigating into this error, we found that we need to map either of the below fields.

ActivityId OR ObjectId and ObjectTypeCode

So, when we removed the mapping of the fields ‘ObjectID’ and ‘ObjectTypeCode’ from the mapping in the target CRM component, we did not get any error!

'The attachment cannot be saved. Either specify activityId or ObjectTypeCode & ObjectId' error while processing Email Attachment using SSIS

This time the attachments migrated successfully to the Target CRM.

'The attachment cannot be saved. Either specify activityId or ObjectTypeCode & ObjectId' error while processing Email Attachment using SSIS

Email in Source CRM:

'The attachment cannot be saved. Either specify activityId or ObjectTypeCode & ObjectId' error while processing Email Attachment using SSIS

Email in Destination CRM:

'The attachment cannot be saved. Either specify activityId or ObjectTypeCode & ObjectId' error while processing Email Attachment using SSIS

Conclusion:

While either migrating or creating an attachment to CRM you need to map either ‘ActivityId’ Or ‘ObjectId’ and ‘ObjectTypeCode’.

Get started with QuickBooks and Dynamics 365 Integration

from Microsoft Dynamics 365(CRM) Tips and Tricks http://bit.ly/2f8KEaU
via IFTTT

Populate the details from the Parent record to Child record in Resco

Introduction:

Recently we had a business requirement to populate some of the details on the Child record from the Parent record when the child record is created by clicking the ‘+’ button on the child record sub-grid in Resco.

We can achieve the above-said functionality easily in Dynamics CRM simply by adding the attributes mapping in the parent child (1:N) relationship. However, we wanted to do this in Resco.

After some research and playing around in Resco, we found an effortless way to achieve the requirement.

Steps to populate the details from parent to child record in Resco:

1. First, we would need to add the attributes in the mapping of the Parent to child relationship in Dynamics CRM that we need to copy over to the child record.

For Example, we have a 1:N relation between the account and the contact, and we need to populate some of the account details on the child contact record when the contact record is created by the clicking ‘+’ button on the contact sub-grid. For this, we would need to add the attributes mapping in Account to contact relationship in Dynamics CRM.

2. Once we have added the attributes mapping to the relationship in the Dynamics CRM, the next step is open the Mobile project in Resco and navigate to the ‘Configuration’ section as shown in the screenshot below;

Populate the details from parent to child record in Resco

3. Now search ‘Use Entity & Attribute Map’ in the search box, and set the value as ‘True’ as shown in the screenshot below;

Populate the details from parent to child record in Resco

4. After this, you can quickly populate the details from the Parent record to the Child record.

Conclusion:

Users can easily populate the details on the child record in Resco by first adding the attributes mapping to the relationship in the Dynamics CRM and then setting the value of ‘Use Entity & Attribute’ in Resco as ‘True’.

Improve the user adoption of Dynamics 365 by monitoring user activity within CRM

from Microsoft Dynamics 365(CRM) Tips and Tricks http://bit.ly/2eDcuii
via IFTTT

Make the Business Process Flow fields to be required conditionally

Introduction:

Recently, we had a business requirement to make some fields, present in the Business process flow stage, to be required conditionally based on the value selected in one of the fields in the BPF stage.

First, we tried to achieve this by writing a client side JavaScript code to make the Business Process fields required based on the value selected in particular field.

But JavaScript won’t work! We tried to use ‘setRequiredLevel’, but this method doesn’t work for the fields present in the Business Process Flow even though we use ‘header_process_’ to get the fields.

Using the Branching functionality of Business Process Flow:

Finally, we decided to use the branching functionality of BPF which was introduced in Dynamics CRM 2015.

The logic is to have two stages with the same structure. The only difference would be that one stage will have the fields as required & another stage will have the fields as optional and switch these stages based on the value selected in the particular field.

We have a condition to check the value selected in field 1 of stage 1. If the field value is true then show Stage2 with Field 2 as required else show Stage 2 with Field 2 as optional, as seen in the image below;

Make the Business Process Flow fields to be required conditionallyHere, we have two stages for Stage 2. Everything will be a same, i.e., the name of the stage, number of fields, etc. except one will have the field as required and other will have the field as optional.

Below is the example of the Business Process flow designer where you can see that we are conditionally showing the same stages but with different field requirement levels.

To create the same stage we just copied the stage.

Make the Business Process Flow fields to be required conditionally

Note:

Each stage in the BPF has their own unique GUID. So in the above case where we have two same stages, the stage name would be the same, but the GUID of two stages would be different.

Integrate Intuit QuickBooks & Microsoft Dynamics 365 with InoLink

from Microsoft Dynamics 365(CRM) Tips and Tricks http://bit.ly/2wIQutt
via IFTTT

Tip – Composite Name field in Dynamics 365

Introduction:

Recently we had a requirement to show the middle name in the Composite Name field in Dynamics 365.

Currently, the composite name field on the fly out only shows the First Name and the Last Name as shown in the screenshot below;

Tip – Composite Name field in Dynamics 365_1

However, the requirement was to show the middle Name too. There are two ways to achieve this.

1. The first option to achieve this is to remove the composite Name field and add all the fields; First Name, Middle Name and Last Name on the form.

Tip – Composite Name field in Dynamics 365_2

2. There is another option to achieve this, and it can be found in System Settings. Navigate to Settings -> System Administration.

In System Administration, under the General tab, there is ‘Set the full-name format’ where you can select the Name format to be ‘First Name Middle Name Last Name’.

Tip – Composite Name field in Dynamics 365_3

A pop-up alert that these changes will not be seen on the existing records as shown in the screenshot below;

Tip – Composite Name field in Dynamics 365_4

After the settings are applied, we can see the changes in the composite field on the Lead form as shown in the screenshot below;

Tip – Composite Name field in Dynamics 365_5

Also, this setting is used for formatting the Name field. For example, if you want to display the Name in ‘Last Name, First Name’ format then you can simply select the format from the drop-down as seen in the screenshot below;

Tip – Composite Name field in Dynamics 365_6

Hope this helps!

Easily Export and Download or Email Dynamics 365 Reports in PDF, Word, or Excel

from Microsoft Dynamics 365(CRM) Tips and Tricks http://bit.ly/2wMXJjO
via IFTTT

Send Invite to Contacts automatically for Microsoft Portal in Dynamics 365

Introduction:

After installing/configuring the Portal for Dynamics 365 online, the first question that comes to our mind is, how will we give the Portal access/login to contacts?

In this blog, we will discuss few questions related to Portal access.

Question #1

As a System Administrator/CRM User, how can we send an invitation to Dynamics CRM contacts in order to provide access to Microsoft Dynamics CRM/365 Portal?

We can send an invitation to Dynamics CRM contacts by following few simple steps.

1. First, open the Contact record to which you want to send an invitation.

2. Then, click on Create Invitation button to create Invitation record with Invitation Code.

3. Save the Invitation record.

4. Now, run the Send Invitation

An email with the invitation link will be sent to the Contact.

Refer the following link to know more about these steps, http://bit.ly/2wmVofK

Question #2

As a System Administrator/CRM User, how can we send an invitation automatically when a contact is created in Dynamics CRM in order to provide access to Microsoft Dynamics CRM/365 Portal?

We can achieve this using a combination of manual workflow and workflow assembly. We need to create one workflow which will trigger on the creation of a contact. And then we just need to execute the steps mentioned above through the workflow.

However, generating invitation code is a bit tricky. We have to pass the Invitation code (which is unique for invitations) along with the invitation link.

Below is the screenshot of the workflow and explanation for each step;

Send Invite to Contacts automatically for Microsoft Portal in Dynamics 3651. Create an Invitation Code:

We have to call the workflow assembly that returns an auto-generated Invitation code as an output parameter.

Code that generates the invitation code (This is the same logic of generating invitation code as in OOB Invitation process.)

/// <summary>
    /// This assembly will return a randomly generated invitation code
    /// </summary>
    public class CreateInvitationCode : CodeActivity
    {
        [Output("Invitation Code")]
        public OutArgument<string> InvitationCode { get; set; }

        /// <summary>
        /// Execute the process and generate the code
        /// </summary>
        /// <param name="context"></param>
        protected override void Execute(CodeActivityContext codeactivitycontext)
        {
            #region (*Services & Context*)

            //Create Tracing Service
            ITracingService tracingservice = codeactivitycontext.GetExtension<ITracingService>();

            //Create the Workflow Context
            IWorkflowContext workflowcontext = codeactivitycontext.GetExtension<IWorkflowContext>();

            //Service Factory
            IOrganizationServiceFactory organizationservicefactory = codeactivitycontext.GetExtension<IOrganizationServiceFactory>();

            //Create the Organization Service
            IOrganizationService organizationservice = organizationservicefactory.CreateOrganizationService(workflowcontext.UserId);

            //Organization Context
            OrganizationServiceContext context = new OrganizationServiceContext(organizationservice);

            #endregion
            try
            {
                //create the code
                string code = string.Empty;// GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition();

                //Declare random class to randomly generate a number between 0and 1
                Random rnd = new Random();

                //call the GetCodePartition() 8 times to create the code
                for (int index = 0; index < 8; index++)
                {
                    code += GetCodePartition(rnd);
                }
                //check if code has value
                if (code != string.Empty && code != null)
                {
                    tracingservice.Trace("Code: " + code);
                    //set the value in output parameter
                    this.InvitationCode.Set(codeactivitycontext, code.Trim().ToLower());
                }
            }
            catch (InvalidPluginExecutionException ex)
            {
                throw new InvalidPluginExecutionException("Execute" + ex.Message);
            }
        }

        /// <summary>
        /// Generate code partitions
        /// </summary>
        /// <returns></returns>
        private string GetCodePartition(Random rnd)
        {
            try
            {
                #region(Original function used in JScript)

                //  return Math.floor((1 + Math.random()) * 0x10000)
                //.toString(16)
                //.substring(1);

                #endregion

                //Create an integer number and then convert it to hexadecimal string
                string codePart = Convert.ToInt32(Math.Floor((1 + rnd.NextDouble()) * 65536)).ToString("X").Substring(1);
                return codePart;
            }
            catch (Exception ex)
            {
                throw new InvalidPluginExecutionException("getCodePartition" + ex.Message);
            }
        }
    }

2Create an Invitation Record:

This workflow step will CREATE an Invitation entity record. Set the output parameter returned by Step 1 in the Invitation code. Then set the other required fields; Sender, Name, Type, Invite Contact, Assign to Account, etc.

3Call child workflow that runs for Invitation entity:

This workflow will create and send an invitation link. Below is the screenshot of the child Workflow;

Send Invite to Contacts automatically for Microsoft Portal in Dynamics 365 1a) Create Email:

This step creates an email record where we need to add an invitation link in the email body. Append the invitation code that we generated and saved on the Invitation record, at the end of portal invitation URL.

Send Invite to Contacts automatically for Microsoft Portal in Dynamics 365b) Call ‘Portals: Send Invitation’ assembly:

Call Microsoft Portal’s ‘Send Invitation’ custom workflow assembly that sends the email created above to invitees.

c) Update status of invitation record to Invitation sent:

The next step is to update the Invitation Record to set status reason as Sent.

4. Stop workflow:

The final step is to stop the workflow.

Hope this helps!

Clone Dynamics CRM/365 Records

from Microsoft Dynamics 365(CRM) Tips and Tricks http://bit.ly/2v5jUlI
via IFTTT

Send Invite to Contacts automatically for Microsoft Portal in Dynamics 365

Introduction:

After installing/configuring the Portal for Dynamics 365 online, the first question that comes to our mind is, how will we give the Portal access/login to contacts?

In this blog, we will discuss few questions related to Portal access.

Question #1

As a System Administrator/CRM User, how can we send an invitation to Dynamics CRM contacts in order to provide access to Microsoft Dynamics CRM/365 Portal?

We can send an invitation to Dynamics CRM contacts by following few simple steps.

1. First, open the Contact record to which you want to send an invitation.

2. Then, click on Create Invitation button to create Invitation record with Invitation Code.

3. Save the Invitation record.

4. Now, run the Send Invitation

An email with the invitation link will be sent to the Contact.

Refer the following link to know more about these steps, http://bit.ly/2wmVofK

Question #2

As a System Administrator/CRM User, how can we send an invitation automatically when a contact is created in Dynamics CRM in order to provide access to Microsoft Dynamics CRM/365 Portal?

We can achieve this using a combination of manual workflow and workflow assembly. We need to create one workflow which will trigger on the creation of a contact. And then we just need to execute the steps mentioned above through the workflow.

However, generating invitation code is a bit tricky. We have to pass the Invitation code (which is unique for invitations) along with the invitation link.

Below is the screenshot of the workflow and explanation for each step;

Send Invite to Contacts automatically for Microsoft Portal in Dynamics 3651. Create an Invitation Code:

We have to call the workflow assembly that returns an auto-generated Invitation code as an output parameter.

Code that generates the invitation code (This is the same logic of generating invitation code as in OOB Invitation process.)

/// <summary>
    /// This assembly will return a randomly generated invitation code
    /// </summary>
    public class CreateInvitationCode : CodeActivity
    {
        [Output("Invitation Code")]
        public OutArgument<string> InvitationCode { get; set; }

        /// <summary>
        /// Execute the process and generate the code
        /// </summary>
        /// <param name="context"></param>
        protected override void Execute(CodeActivityContext codeactivitycontext)
        {
            #region (*Services & Context*)

            //Create Tracing Service
            ITracingService tracingservice = codeactivitycontext.GetExtension<ITracingService>();

            //Create the Workflow Context
            IWorkflowContext workflowcontext = codeactivitycontext.GetExtension<IWorkflowContext>();

            //Service Factory
            IOrganizationServiceFactory organizationservicefactory = codeactivitycontext.GetExtension<IOrganizationServiceFactory>();

            //Create the Organization Service
            IOrganizationService organizationservice = organizationservicefactory.CreateOrganizationService(workflowcontext.UserId);

            //Organization Context
            OrganizationServiceContext context = new OrganizationServiceContext(organizationservice);

            #endregion
            try
            {
                //create the code
                string code = string.Empty;// GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition() + GetCodePartition();

                //Declare random class to randomly generate a number between 0and 1
                Random rnd = new Random();

                //call the GetCodePartition() 8 times to create the code
                for (int index = 0; index < 8; index++)
                {
                    code += GetCodePartition(rnd);
                }
                //check if code has value
                if (code != string.Empty && code != null)
                {
                    tracingservice.Trace("Code: " + code);
                    //set the value in output parameter
                    this.InvitationCode.Set(codeactivitycontext, code.Trim().ToLower());
                }
            }
            catch (InvalidPluginExecutionException ex)
            {
                throw new InvalidPluginExecutionException("Execute" + ex.Message);
            }
        }

        /// <summary>
        /// Generate code partitions
        /// </summary>
        /// <returns></returns>
        private string GetCodePartition(Random rnd)
        {
            try
            {
                #region(Original function used in JScript)

                //  return Math.floor((1 + Math.random()) * 0x10000)
                //.toString(16)
                //.substring(1);

                #endregion

                //Create an integer number and then convert it to hexadecimal string
                string codePart = Convert.ToInt32(Math.Floor((1 + rnd.NextDouble()) * 65536)).ToString("X").Substring(1);
                return codePart;
            }
            catch (Exception ex)
            {
                throw new InvalidPluginExecutionException("getCodePartition" + ex.Message);
            }
        }
    }

2Create an Invitation Record:

This workflow step will CREATE an Invitation entity record. Set the output parameter returned by Step 1 in the Invitation code. Then set the other required fields; Sender, Name, Type, Invite Contact, Assign to Account, etc.

3Call child workflow that runs for Invitation entity:

This workflow will create and send an invitation link. Below is the screenshot of the child Workflow;

Send Invite to Contacts automatically for Microsoft Portal in Dynamics 365 1a) Create Email:

This step creates an email record where we need to add an invitation link in the email body. Append the invitation code that we generated and saved on the Invitation record, at the end of portal invitation URL.

Send Invite to Contacts automatically for Microsoft Portal in Dynamics 365b) Call ‘Portals: Send Invitation’ assembly:

Call Microsoft Portal’s ‘Send Invitation’ custom workflow assembly that sends the email created above to invitees.

c) Update status of invitation record to Invitation sent:

The next step is to update the Invitation Record to set status reason as Sent.

4. Stop workflow:

The final step is to stop the workflow.

Hope this helps!

Clone Dynamics CRM/365 Records

from Microsoft Dynamics 365(CRM) Tips and Tricks http://bit.ly/2v5jUlI
via IFTTT

%d bloggers like this: