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:

No comments:

Post a Comment

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...