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

Custom Workflow Info message

(0) ShareShare
ReportReport
Posted on by 55

Hello All, 

I created new custom workflow I want to have info message when the workflow status changed to approved in d365 application. I added my code to completed method in workflow event handler class. but the info message doesn't show up on the screen when I debug my code the if condition met. but the info message doesn't show up on the screen.

    public void completed(WorkflowEventArgs _workflowEventArgs)
    {
        TableName trans;
        select trans where trans.RecId == _workflowEventArgs.parmWorkflowContext().parmRecId();
      
        if(trans.WorkflowState == xxx::Approved)
        {
            info("@sys1231");
        }

    }

  • GirishS Profile Picture
    27,843 Moderator on at

    Hi yousef,

    Can you try like below and check.

    Message::addMessage(MessageSeverity::info,"labelId");

    Thanks,

    Girish S.

  • yousefsuli Profile Picture
    55 on at

    Thank you for your response I tried it, but it doesn't work.

  • GirishS Profile Picture
    27,843 Moderator on at

    You have a table method like updateWorkflowStatus which will update the approval status field in table. 

    In that method check if the statue is approved, if yes add the info message and check.

    Thanks,

    Girish S.

  • NoobGamer Profile Picture
    2 on at

    Hi Girish,

             Even I have tried this info method before , This method didnt work for the WorkflowEvent Handler class .But It has worked only for the Submit Manager/Resubmit Action Manager Class.

    Even the debugger didnt hit the breakpoint of the EventHandler Class . Since this EventHandler works based on the Batch Job .If you have any idea about this can you please explain ?

  • GirishS Profile Picture
    27,843 Moderator on at

    I am not sure about this.

    But you can try one think. Try setting the notifications on workflow configuration form for completed status.

    Thanks,

    Girish S.

  • yousefsuli Profile Picture
    55 on at

    Hello

    isn't worked updateWorkflowStatus  for my method that update the workflow status and that's weird why the info message doesn't show up in all cases.  

  • GirishS Profile Picture
    27,843 Moderator on at

    Are you saying that adding code in updateWorkerStatus method doesn't fix the issue?

    Thanks,

    Girish S.

  • yousefsuli Profile Picture
    55 on at

    Hello

    Yes, doesn't fix the issue.

  • GirishS Profile Picture
    27,843 Moderator on at

    I am not sure what may be the issue - But I found similar thread which talks about notification is not sending which is setup in workflow configuration form after the workflow is completed. That thread also doesn't have verified answers.

    You need to debug the code and find out whether they have cleared messages from info log.

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at

    Hi, Don't know your business requirement but Instead of Displaying an infolog, is sending a notification to Approver or Submitter (when workflow is completed) fulfils your requirement?

    If yes, then you can try configuring it in Workflow under Basic Settings-->Notifications (For Completed Event)

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

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 515 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
CU10121822-0 Profile Picture

CU10121822-0 360

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans