Skip to main content

Notifications

Community site session details

Community site session details

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

Disable finished in project stage if the project have pending transactions

(0) ShareShare
ReportReport
Posted on by

Hi All,

I need to disable the finished button in project stage if the project have pending transaction for all users except system admin role.

pastedimage1626956169781v1.png

I wrote code in 

ProjProjectsListPageInteraction class in setProjectStageAction method to disable the finished option for user except system admin role

 

SELECT projUnpostedTransView JOIN Name, ProjId, Name FROM projTable
where projUnpostedTransView.ProjId == projTable.ProjId;


if(projUnpostedTransView) // check it have pending trasactions
{
while select firstonly role
exists join userRole where role.RecId == userRole.SecurityRole
&& userRole.User == curUserId()
{
if(role.Name == "System administrator")
this.showButton(ctrlReportedFinish, true);
this.enableButton(ctrlReportedFinish, projTable.Status != ProjStatus::Completed);


if(role.Name != "System administrator")
this.enableButton(ctrlReportedFinish,false);
}

}

But the projUnpostedTransView contain only sub projects id it don't have parent project id.
So for parent project the finished button is not disabled.

How to check the pending transactions for all projects in x++ code.

Thank you.

  • piyush02 Profile Picture
    60 on at
    Disable finished in project stage if the project have pending transactions
    Hi John,
     
    Did you find any solution for the same i have a similar requirement.
     
    Thanks
    Piyush Sharma
  • Suggested answer
    Michal Krejza Profile Picture
    on at
    RE: Disable finished in project stage if the project have pending transactions

    Hi John,

    If the Project is marked as Header project - it doesn't have any posted project transactions. I think you will need to chetck the Project structure in that case and check transactions on lower level projects. 

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

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

#1
Martin Dráb Profile Picture

Martin Dráb 510 Most Valuable Professional

#2
Saalim Ansari Profile Picture

Saalim Ansari 315

#3
Adis Profile Picture

Adis 312 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans