Skip to main content

I am calling the JournalTransaction endpoint and expanding Details (as shown below).

{{BaseURL}}entity/Default/22.200.001/JournalTransaction?$expand=Details

I would like to apply the $filter param to the field Details/BranchID. In other words, I would like to return all the Detail lines that have a certain BranchID.

  1. A simple filter query:
    $filter=Details/BranchID eq 'SOFT'

    This returns the error “The parent value for a property access of a property 'BranchID' is not a single value. Property access can only be applied to a single value.”
    This is likely because Details to BranchID is a one-to-many relationship.

  2. I have looked into other syntaxes and found that you can use Lambda Operators:
    $filter=Details/any(d: d/BranchID eq 'SOFT')

    This returns the error “The method or operation is not implemented.”

  3. Another option is passing the $filter directly in the $expand parameter (also shown in the OData v3 Documentation):

    $expand=Details($filter=BranchID eq 'SOFT')

    This returns the error "Term 'Details($filter=BranchID eq 'SOFT')' is not valid in a $select or $expand expression."

The Lambda Operator seems like it is the most applicable for this use case but I cannot get it to work. I’m not sure if this method is supported by Acumatica or not, but it is present in OData v3.

 

Please let me know if anyone else has tried to achieve something similar and how to go about doing so.

Hi @Jonah 

in REST API  filtering by details is not supported. 

 

You can try 

{{BaseURL}}/ODatav4/GLTran?$filter=BranchID eq 'SOFT'


You can try 

{{BaseURL}}/ODatav4/GLTran?$filter=BranchID eq 'SOFT'

Hi @Dmitrii Naumov 

I have tried this but receive a 404 error. Please advise if I am doing something wrong.


@Jonah if you have multitenant site you should have the following URL structure:

{{BaseURL}}/ODatav4/{{TenantName}}/GLTran?$filter=BranchID eq 'SOFT'

 

See the following help link for additional details:

https://help.acumatica.com/(W(3))/Help?ScreenId=ShowWiki&pageid=642945d9-df36-429b-8784-0f1bcf0e5495

 

 


Reply