Skip to main content
Solved

Filtering Journal Transactions by Detail Branch ID


Forum|alt.badge.img
  • Freshman II
  • 12 replies

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.

Best answer by Dmitrii Naumov

@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

 

 

View original
Did this topic help you find an answer to your question?

3 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+6
  • Acumatica Moderator
  • 595 replies
  • April 24, 2023

Hi @Jonah 

in REST API  filtering by details is not supported. 

 

You can try 

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


Forum|alt.badge.img
  • Author
  • Freshman II
  • 12 replies
  • April 25, 2023
Dmitrii Naumov wrote:

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.


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+6
  • Acumatica Moderator
  • 595 replies
  • Answer
  • April 25, 2023

@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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings