Monday, November 29, 2021

How to Set Non-Users in To Field in Email - Dataverse or MSCRM


Introduction:

In this Blog, we will see how to Set TO/CC/BCC with Non CRM Users through JavaScript

Implementation Steps:

 

1. Navigate to https://make.powerapps.com

 

2. Click Gear Icon at the Top

 

3. Click Advance Settings

 

4. Click Administration 

 

5. Select System settings, it will open a Popup (Select EMAIL tab)

 

6. Set (Allow messages with unresolved email recipients to be sent) to YES

 

rampprakash_0-1638126337594.png

 

Once the Above setting done write the below script in your code

 

 

 

function setUnResolvedusers(formContext, getEmailId) {
    if (getEmailId != null) {
        var obj = new Object();
        obj.name = getEmailId;
        obj.entityType = "unresolvedaddress";
        obj.id = "{00000000-0000-0000-0000-000000000000}";
        var toField = formContext.getAttribute("to");
        var toValue = toField.getValue();
        if (toValue != null) {
            toValue.push(obj);
            toField.setValue(toValue);
        }
        else {
            var value = new Array();
            value[0] = obj;
            toField.setValue(value);
        }
    }
}

 

 

 

Triggering method:

 

 

 

setUnResolvedusers(executionContext,"ramprakashdemo@live.com"

 

 

 

That's it :slightly_smiling_face:

1 comment:

  1. Great post! Very informative and clearly explained. Thanks for sharing such valuable content. If anyone is looking to upskill in Microsoft Dynamic CRM, we offer comprehensive Microsoft Dynamics CRM Online Training with hands-on experience. Feel free to check it out!

    ReplyDelete

How to Add Static Text to CRM or Dataverse Using HTML Web Resources

 Introduction: In this Blog, we will see how to Add Static Text to CRM or Dataverse Using HTML Web Resources   Implementation Steps :  ...