Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

formRun.updateWorkflowControls(); Object reference not set to an instance of an object.

(0) ShareShare
ReportReport
Posted on by 469

Hi,

We have created a customization to enable workflow in the periodic journals screen. We are using the standard Daily journal workflow for the periodic journals.

We are receiving the error "Object reference not set to an instance of an object." only for periodic journals where the workflow is completed and the logged in user is not the user who created the journal.

The error is coming at the function formRun.updateWorkflowControls(); 

The workaround I have is to ask the user to click show user-created only check box to make this error disappear. 

This error doesn't show for me as a system admin, hower this error will show to other system admin users. The only difference is that I have created the Daily journal workflow

pastedimage1676225773528v1.png

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: formRun.updateWorkflowControls(); Object reference not set to an instance of an object.

    Hi Hossam,

    Seems you already debugged the code and find out the method that is causing the issue. There is a variable named "workflowControl" on the method. Have you checked whether the buffer is having values or it is null?

    workflowControl variable is assigned a value in init method of FormRun class.

    Debug that method and find out what causing this issue.

    Thanks,

    Girish S.

  • Suggested answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: formRun.updateWorkflowControls(); Object reference not set to an instance of an object.

    Hi Hossam,

    We don't have your custom code, and we can't reproduce this issue, so that we cannot investigate the cause of the error. It is recommended that you contact your develop colleague to debug the code and analyze the root cause.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans