+ Start a Discussion
Somesh_11Somesh_11 

Hi all, I am getting an error Id and Pricebook2Id not found

Hi all, I am getting an error Id and Pricebook2Id not found. Can anyone help please.
I am doing devlopment in Scratch Org. Below is the code and Error snippet.
User-added image
Best Answer chosen by Somesh_11
Abhishek BansalAbhishek Bansal
Hi Somesh,

The query at line 111 will return a list so either use LIMIT 1 in query or use the below code:
order[0].PriceBook2Id;
order[0].id;

Let me know if you need any other help on this.

Thanks,
Abhishek Bansal.

All Answers

Abhishek BansalAbhishek Bansal
Hi Somesh,

The query at line 111 will return a list so either use LIMIT 1 in query or use the below code:
order[0].PriceBook2Id;
order[0].id;

Let me know if you need any other help on this.

Thanks,
Abhishek Bansal.
This was selected as the best answer
Somesh_11Somesh_11
Thanks, Abhishek