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 :
Small and medium business | Business Central, N...
Suggested Answer

Posting in another Company

(1) ShareShare
ReportReport
Posted on by 213

How can I run a codeunit for another company without using job queue
I want to approve a Purchase Invoice in another company.

so we have 5 companies
approvers will have to go into every company and approve it, which is quite annoying for few approvers.
I can display all approvals from all company into one list but when he approves it errors, even I use changecompany function.

ApprovalEntry.CHANGECOMPANY('Company 2');
ApprovalsMgmt.ApproveApprovalRequests(ApprovalEntry);



Any advise?

Thanks

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,170 Super User 2026 Season 1 on at

    Just a thought: Can you create a field in ApprovalEntry (ex: boolean) and make it to true and in OnValidate trigger of the field run the ApprovalsMgmt.ApproveApprovalRequests(ApprovalEntry);?

  • Ajay Jain Profile Picture
    213 on at

    Validate works on the same company, cannot trigger in another company

    also there are other validations , reading other tables, those should also be have change company etc.

  • Suggested answer
    Ajay Jain Profile Picture
    213 on at

    I think StartSession will do the job

  • Suggested answer
    YUN ZHU Profile Picture
    97,970 Super User 2026 Season 1 on at

    Hi, maybe SessionSettings Data Type will helps.

    More details: https://yzhums.com/13662/

    Hope this helps.

    Thanks.
    ZHU

  • Ajay Jain Profile Picture
    213 on at

    Thank you ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,161 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,046 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 932 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans