Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Apr 2016
    Posts
    0

    Open Email in new window

    Hi,
    I want to open an email activity in new window. I am creating email record using plugin and adding the attachment. I want to open email activity in new window after attachment is added.
    code:
    #region Creating Draft Email

    Entity Email = new Entity("email");
    Email.Attributes["from"] = ownerId; ;
    Email.Attributes["to"] = new Entity[] { };
    Email.Attributes["regardingobjectid"] = new EntityReference("quote", quoteId);
    Email.Attributes["description"] = signature;
    Guid EmailId = service.Create(Email);

    #endregion

    #region CreateAttachment

    //Creating Attachment
    Entity emailAttachment = new Entity("activitymimeattachment");
    emailAttachment["subject"] = subject;
    emailAttachment["filename"] = filename;
    emailAttachment["body"] = doc;
    emailAttachment["mimetype"] = mimeType;
    emailAttachment["objectid"] = new EntityReference("email", EmailId);
    emailAttachment["objecttypecode"] = "email";
    Guid Attachmentid = service.Create(emailAttachment);
    #endregion

  2. #2

    Open Email in new window

    You can't open record from plugin but what yoy can try to use a action where you can create email record and get it's ID after create and open it using XrmUtility.

  3. #3
    Junior Member
    Join Date
    Mar 2016
    Posts
    0

    Open Email in new window

    Hi,
    In order to open a record in new browser window, you need to write client side code "JavaScript". Plugin runs on server side so cannpt be used.
    The best option as also suggested above would be to use custom action to create the email and open it using javascript
    Hope this helps.

  4. #4

    Open Email in new window

    Hi Riya,
    I am not sure about your requirement , but is there any reason you have created email inside plugin?
    You can use custom Action or workflow to send email and client side after your action retrieve the email details and open new window using openentityform.
    Here is some reference you may get help -
    syednizamsyed.blogspot.in/.../create-activity-and-associated-activity.html
    bettercrm.blog/.../how-to-create-an-attachment-using-webapi-in-dynamics-365
    Hope this helps.



    Reply


































Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •