on 05-12-2008 1:16 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.