cancel
Showing results for 
Search instead for 
Did you mean: 

How to check a value exist in List Object on CPQ?

sbslmhmt
Participant
0 Kudos
342

Hello,

I have written this below code to check if a value exist in list object but It's always return as false. Where do I do wrong?

G = SqlHelper.GetList("SELECT Attr FROM TAGTABLE WHERE PRODUCT ='" + Product.PartNumber + "' AND ACTIVE ='X'")
if 'Pallet Capacity' in G:
   #some coding

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Mehmet,

You can use this check: (in your case)

G = SqlHelper.GetList("SELECT Attr FROM TAGTABLE WHERE PRODUCT ='" + Product.PartNumber + "' AND ACTIVE ='X'")


for attr in G:
    #Trace.Write(attr.Attr)
    if attr.Attr == 'Pallet Capacity':
        Trace.Write('Value Exists')
Stevica
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi

Try with "SqlHelper.GetFirst" instead of "GetList".

Regards