Skip to main content
Solved

Simple SelectFrom but getting 'Single row was requested' error.

  • November 27, 2023
  • 4 replies
  • 230 views

Forum|alt.badge.img

I have a simple SelectFrom where I am getting all of the AMBomMatl items (joining them with the Operation and BomItem tables) who’s ItemClassID equals ‘811’, but for some reason I am not getting any results. When I look through the var object results I only noticethe ‘Single row was requested’ error which to be honest I don’t know what it means.

I have been following this documentation but with no luck. I have done other SelectFrom’s before with success but not this for some reason. Any ideas?

 

Best answer by manley75

Sorry I have been busy the last few days and only just got back to this problem.

It turns out this is indeed a rookie mistake. I forgot to join in the INItemClass table with the InventoryItem table to be able to use the ItemClassCD reference. Instead I was using the ItemClassID and trying to pipe in the user friendly CD 811 number.

It works now that I have made those changes. Thanks for making suggestions though!

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

4 replies

Patrick Chen
Jr Varsity III
Forum|alt.badge.img+2
  • Jr Varsity III
  • 51 replies
  • November 27, 2023

I can’t see the entire ‘<in>’ clause of your Foreach loop, but my guess is that it is returning multiple lines based on the where criteria of the code that starts with “bomResults.Cast….” instead of one PXResult item


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 629 replies
  • November 27, 2023

@manley75 it is because the Selects in Acumatica are ‘Lazy’, that is they will be only executed when the result is used. 

I’d say if you want to see what’s being selected, convert it into List right away where you do your select. 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 15 replies
  • Answer
  • November 30, 2023

Sorry I have been busy the last few days and only just got back to this problem.

It turns out this is indeed a rookie mistake. I forgot to join in the INItemClass table with the InventoryItem table to be able to use the ItemClassCD reference. Instead I was using the ItemClassID and trying to pipe in the user friendly CD 811 number.

It works now that I have made those changes. Thanks for making suggestions though!


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2750 replies
  • December 1, 2023

Thank you for sharing your solution with the community @manley75!


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