cancel
Showing results for 
Search instead for 
Did you mean: 

SAPbouiCOM.Conditions - need help

Former Member
0 Kudos

hi all

how can i use brackets on 'SAPbouiCOM.Conditions'

the code below is working properly

oConds = new SAPbouiCOM.Conditions();

oCond = oConds.Add();

oCond.Alias = "CardCode";

oCond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;

oCond.CondVal = cardvalue;

oDBDataSource.Query(oConds);

but when i put more than one condition its not working. example below

oConds = new SAPbouiCOM.Conditions();

oCond = oConds.Add();

oCond.Alias = "CardCode";

oCond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;

oCond.CondVal = cardvalue;

oCond.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

oCond.Alias = "DocStatus";

oCond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;

oCond.CondVal = "O";

oDBDataSource.Query(oConds);

please any one one know why its not working

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

sap_beginer,

Please have a look at the SAP Business One SDK Help Center documentation and specifically look at the "Condition Object". There are code examples that will assist you in working with conditions and the SDK.

Eddy

Former Member
0 Kudos

Thanks,

am afraid i couldn't get.

former_member209699
Contributor
0 Kudos

Try using

BracketCloseNum And BracketOpenNum

as mentioned below...

Set oCondition = oConditions.Add

'// ((CardType = 'C') Or

oCondition.BracketOpenNum = 2

oCondition.Alias = "CardType"

oCondition.Operation = co_EQUAL

oCondition.CondVal = "C"

oCondition.BracketCloseNum = 1

oCondition.Relationship = cr_OR

Set oCondition = oConditions.Add

'// (CardType = 'S'))

oCondition.BracketOpenNum = 1

oCondition.Alias = "CardType"

oCondition.Operation = co_EQUAL

oCondition.CondVal = "S"

oCondition.BracketCloseNum = 2

Answers (0)