Skip to main content
Community site session details

Community site session details

Session Id :

Set Unresolved Email address through JavaScript in MSCRM / Dataverse

Ram Prakash Profile Picture Ram Prakash 2,287

Introduction:

In this Blog we will see how to set Unresolved Email address in MSCRM or Dataverse using 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

11.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"

Thats it 

Comments

*This post is locked for comments