Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

get email id's from case/incident

Posted on by Microsoft Employee

hey guys.

i want to get the email id's (or other identifier, i'm still exploring the EmailSet entity) regarding the case/incident i'm working on, via Javascript.

my first idea was to make a ODATA/REST call to the CRM API, searching for all emails that have a "regardingobjectid" to my case/incident, but i think that would be too heavy for my database.

any idea on this?

thanks in advance

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: get email id's from case/incident

    hey Alex.

    what i meant was, i don't just want to get the "description" field of the email, i want to send it as a whole, including attachments, etc.

    i considered the possibility of the database having a varchar(max) (equivalent to CLOB in Oracle) or something like it, but i guess there isn't such thing?

    i guess workflow can't achieve what i'm looking for, hence my idea of querying the database directly through the API.

    thanks in advance

  • Karsten Wirl Profile Picture
    Karsten Wirl 4,477 on at
    RE: get email id's from case/incident

    Hi tiagosh.

    I'm a little bit confused. Why do you mean that it's to heavy for your database?

    In terms of the amount of possible data?

    Kind regards,

    Karsten

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: get email id's from case/incident

    It's an email entity - open customizations screen and have a look at the attributes.. there is some sample code here if you need it:

    nishantrana.me/.../sample-code-to-use-templates-content-while-sending-mail-using-sendemailreuquest-in-crm-2011

    (it's "early-bound" there, but you can always convert to late-bound: entity["description"])

    You might try using a plugin.. or a custom workflow activity.. Just keep in mind there is 2 minute limitation in the sandbox, but, since you seem to be on-prem, you don't have to register in sandbox.

    Although, it might be better to just have a plugin to call the web service and leave it to the web service to go back to CRM, query the emails, and send them.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: get email id's from case/incident

    hey Alex.

    yes you're probably right, i think i'll go with what you suggested, searching directly through the email entity. do you have any idea how can i get a "whole" email from the database, to grab and send it through a external application WebService, though?

    it's what i want to achieve, when closing a case/incident, send all the emails through a WebService. note i don't want to forward the emails, that would be the a last-resort thing.

    thanks in advance, any help appreciated!

    regards

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: get email id's from case/incident

    hey there Rawish.

    what i want to do is, when closing a case/incident, send all the emails (including attachments/etc) regarding that case through a external application WebService. i still don't know how i will achive that, since i'm not sure how can i get a "whole" email from the database, wich i assume i will get using CRM API, like Alex Shlega wrote here.

    Any thoughts on how i should do that?

    Thanks in advance

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: get email id's from case/incident

    Agree with Rawish that the tool you should be using depends on what you want to achieve, although, performance-wise, I'm not sure why would it be a problem for WebAPI:

    /api/data/v8.2/emails?$select=activityid&$filter=_regardingobjectid_value%20eq%205e57551a-e7dd-e711-8118-005056816790

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: get email id's from case/incident

    Hi there!

    what exactly you would like to do with the ids.

    one simple solution is to create a view get all emails where regarding is "case".

    export the data with email id column.

    basically it depends what you are doing achieve.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans