web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Organization Admin Email Template, how to get it from code ?

(2) ShareShare
ReportReport
Posted on by 552
Hi,
 
In D365 FO, we have setup Org Admin > Setup > Organization Email Template. The EmailID is basically the only Email ID for this template. 
Question is, is there a function to get this by default. I currently using this function : var messageTable = SysEmailMessageTable::find(_emailId, _languageId);
 
But find it odd, since I need to specify the Email ID in my code, it is like "hardcoded" which I try to avoid. I mean can we just take whatever Email ID specified, since it is the only Email ID setup. If harcoded, lets say like I put SysEmailMessageTable::find("Workflow", _languageId);. IF someone setup with different name, my code will not working.
 
Thanks
 
 
Categories:
I have the same question (0)
  • Ken Manhattan Profile Picture
    552 on at
    It looks like we can add new Email ID, because there is New button in the Email setup like appear in the picture :
    But the screen is not in Grid like, so will only show 1, unless we go to Filter then we can understand we have other EmailId.
    It quite confusing as no one know except the person who maintain this Email Templates.
     
    Is there probably some setup parameter that able to record which one then will be the default for certain function or module or anything like ?
     
    My intention is only when I need to retrieve this email template in my code, I don't have to "hardcoded" the Email Id, but to retrieve this in some parameter.
     
    Thanks
     
     
     
  • Suggested answer
    Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at
    Click the Show list button to see the list of templates and to navigate between them.
     
     
    If you have ten templates and you want to get one of them in code, you'll either need a parameter where you select a default one, or a decision logic in code.
  • Ken Manhattan Profile Picture
    552 on at
    Hi Martin,
     
    Thanks again. I'm not noticing that there is a Show list button. 
    And for the parameter, yes, I've been thinking of that too, but means it will need customization.
     
    It's only just want to make sure there isn't such for standard OOTB.
    Also wondering why there is no such parameter.
     
    Thanks.
  • Verified answer
    Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at
    There are many parameters where you can select an email template ID; each of them for a particular business scenario.
     
    For example, here is one for project timesheets:
     
    I don't know anything about your business scenario, therefore I can't tell you whether there is a parameter suitable for you.
     
    You can use cross-references to see all the places where SysEmailId is used.
     
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 471 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 423 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans