create an email using the Xrm.WebApi in Dynamics 365 using JavaScript

 


  var emailData = {
    subject: "Sample Email",
    description: "Email body content",
    to: [{
      partyid_emailaddress: "email@example.com",
      partyid_type: "systemuser"
    }],
    // Add any other desired fields and values
  };
  Xrm.WebApi.createRecord("email", emailData).then(
    function success(result) {
      console.log("Email created successfully. Email ID: " + result.id);
    },
    function error(error) {
      console.log("Error creating email: " + error.message);
    }
  );
 
 

Comments

Popular posts from this blog

Power Automate - Update Child record when parent record is updated by using power automate in MS Dynamics CRM

Create Folder On Share Point by using Power Automate In Dynamics CRM

Duplicate Detection Plugin code for Microsoft dynamics CRM