Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

using Odata4 to pass a variable *by reference* when calling a code unit

(1) ShareShare
ReportReport
Posted on by 4
Hi
 
I am converting our code to communicate with Business Central using oData rather than SOAP to call pages, code units etc.
I am struggling with code units that require passing a parameter by reference - I can't figure out how to do this. Currently I am sending the parameters as json in HttpRequestMessage object's content. This works perfectly for code units that require normal parameters. However for parameters by reference, I get the error "Resource not found for the segment 'codeunit_functionName'". There is definitely nothing wrong with the name of the codeunit/function. The same error happens with any code unit requiring params by ref.
 
Any help would be most appreciated.
 
  • SR-08010801-0 Profile Picture
    SR-08010801-0 4 on at
    using Odata4 to pass a variable *by reference* when calling a code unit
    Thanks @xgaronnat - unfortunately it is not my code unit, therefore I have no control over it
  • Suggested answer
    xgaronnat Profile Picture
    xgaronnat 35 on at
    using Odata4 to pass a variable *by reference* when calling a code unit
    Hello,

    Instead of codeunits, you should implement Bound Actions on Page API. You can see how it's done on standard General Journal API : https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/resources/dynamics_journal#bound-actions
     
     

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,883 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans