Skip to Content
0

How to get multiple Tables in the result of a query in SDK?

Apr 15 at 10:02 PM

35

avatar image

I have written Query to get the Tax Numbers from Account to Sales Quote BO. The problem is that the "resultData" of the Query returns a single Table even though there are multiple tables maintained for the Selection Parameter. Code below:

var selectionParams = query.CreateSelectionParams(); selectionParams.Add(query.InternalID, "I", "EQ", BuyerPartyID);

// Result

resultData = query.Execute(selectionParams);

var TaxTypeCode;

if(resultData.Count()>0)

{

foreach (var TCode in resultData)

{

if(TCode.TaxNumber.GetFirst().CountryCode == "IN" )

{

if(!TCode.TaxNumber.GetFirst().TaxTypeCode.IsInitial())

{

TaxTypeCode = resultData.TaxNumber.GetFirst().TaxTypeCode.content;

if( TaxTypeCode == "12")

{

if (!resultData.TaxNumber.GetFirst().TaxID.IsInitial())

{

this.GetFirst().AccountGSTNo = resultData.TaxNumber.GetFirst().TaxID.content; } } } } } }

In My case there should be 3 tables inside ResultData, but it returns only 1

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Lewis Peters 6 days ago
0

Swagi,

Which BO is the variable 'query' querying? If it's the CustomerQuote BO then you'll receive as many results as there are quotes for that customer ID. However, from the looks of it you're possibly querying the Customer BO? In which case you'll only ever receive 1 result as you can't have multiple accounts with the same ID.

Lewis

Share
10 |10000 characters needed characters left characters exceeded
s sin 4 days ago
0

Hi Swagi,

It seems that you did your query on InternalID of account, so it is correct that it returns you just 1 raw.

I think you are expecting to have 3 tax numbers just for one account.

Are you sure you have three Accounts with the same InternalID?

Sepide

Share
10 |10000 characters needed characters left characters exceeded