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

Fetch value from X++ for oData Filter query

(0) ShareShare
ReportReport
Posted on by 135
I am trying to find the value of Odata link:
https://F&Olink/data/Dataentityname(InventSiteIdList='inv1', dataAreaId='dat')/Microsoft.Dynamics.DataEntities.GetColorsByAvailability2
  I am using the below code :
 
 [SysODataActionAttribute(/GetColorsByAvailability2/, false),
        SysODataCollectionAttribute(/InventSiteIdList/, Types::String),
        SysODataCollectionAttribute(/return/, Types::String)]
        public static str GetColorsByAvailability2(Str _InventSiteIdList)
    {
        info(strFmt(/%1 invent/,_InventSiteIdList));
        return _InventSiteIdList;
    }
also method with parameters like:
 
  [SysODataActionAttribute(/GetColors/, true),
    SysODataCollectionAttribute(/return/, Types::Record, /CarColor/)]
    public List GetColorsByAvailability(boolean onlyAvailableVehicles)
    {
        if(onlyAvailableVehicles == noyes::Yes)
        {
            info('yes');
        }
        else
        {
            info('no');
        
        }
        List returnList = new List(Types::Record);
        // do something
        return returnList;
    }

  I wanted to find the method from where I can the value of odata. And where should I put breakpoint to debug and find the values of odata filters
I have the same question (0)
  • Martin Dráb Profile Picture
    239,124 Most Valuable Professional on at
    Neither of them will give you OData filters.
     
    GetColorsByAvailability() is an instance method, therefore it has a reference to an entity record (in a variable called this) and a single parameter: onlyAvailableVehicles. Of course, if you selected a record by a field value, you can see the value in the field (e.g. this.InventSiteIdList).
     
    GetColorsByAvailability2() is a static method and all it knows is the value of its parameter (_InventSiteIdList).
  • aayushii Profile Picture
    135 on at
     by URLHi Martin,
     
    Thank you for the quick response.
    I wanted to know how to call GetColorsByAvailability2() using  URL what will be the syntax for it.
  • Suggested answer
    Martin Dráb Profile Picture
    239,124 Most Valuable Professional on at
    As I remember, the URL should be [Organization Root URL]/data/[DataEntityCollectionName]/Microsoft.Dynamics.DataEntities.GetColorsByAvailability2.
     
    Parameters should be in a JSON object passed in the request body.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 689

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 258 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans