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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to play a sound in D365

(0) ShareShare
ReportReport
Posted on by

I need to play a sound in certain conditions; i.e when an error or a warning is thrown.

Can I make that in Ax 365 ? 

 
the following code did not work. I belive the reason is that the code was executed on the server side instead of the client side, so I could not hear the sound. 
[ExtensionOf(formStr(WHSPack))]
final class REVClass_WHSPack_Extension
{
    /// <summary>
    /// MEC_EXT-00027_LandedCostChargesAutomation
    /// Peiqing Jia on 01/29/2023
    /// </summary>
    [FormControlEventHandler(formControlStr(WHSPack, ItemId), FormControlEventType::Modified)]
    public static void ChangeRequestedBy_OnClicked(FormControl sender, FormControlEventArgs e)
    {
        InventInventItemSearchResult result = inventItemSearch.search(this.valueStr());
                
        if (!result ||
            !result.parmItemId())
        {
            ret = checkFailed(/@WAX758/);
            
            System.Media.SoundPlayer YourMPlayer;
            YourMPlayer= new System.Media.SoundPlayer();
            YourMPlayer.set_SoundLocation(https://download01.fangcloud.com/download/a23675d5fba24dbf9d20b50efbf8e629/acfb0471b29cc9eb3bd0f2dd81482dc772eb8aaa36696b11eb50ef4070acae6f/Alarm03.wav/);
            YourMPlayer.Play();
        }
    }
}
  • Suggested answer
    Martin Dráb Profile Picture
    241,637 Most Valuable Professional on at
    Moved from D365 general forum to the Finance forum, because it's clearly about F&O and not about D365 in general.
     
    You're right. The code can't work as you want because X++ us executed on server, not in a browser on client's machine.
     
    You'd have to use client-side JavaScript to do such a thing, which in F&O means creating an extensible control. But it doesn't sound to me like what you want to in this case.
     
    If you want to change the way how error and warning notifications work in F&O, you can also log it as an idea for Microsoft.
  • André Arnaud de Calavon Profile Picture
    308,227 Super User 2026 Season 2 on at
    Hi Peiqing,
     
    You got a valuable reply from Martin. Can you tell us what is the benefit and business value of playing a sound?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 271 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 217

#3
Subra Profile Picture

Subra 200 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans