on 02-19-2008 7:57 AM
Hi all,
Im trying to add a CFL with multiple conditions. The two conditions do work when they are on their own, but when I try to have the conditions together, no values are retrieved. I need to retrieve the OACT WHERE GroupMask > "3" and Postable = "Y"
This is the code that ive used.
Thanks
'Adding CFL3 for Line GL Account Name.
oCFLCreationParams.MultiSelection = False oCFLCreationParams.ObjectType = "1" oCFLCreationParams.UniqueID = "CFL3"
oCFL = oCFLs.Add(oCFLCreationParams)
' Adding Conditions to CFL3
oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "GroupMask"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_GRATER_THAN
oCon.CondVal = "3"
oCon = oCons.Add()
oCon.Alias = "Postable"
oCon.Operation = BoConditionOperation.co_EQUAL
oCon.CondVal = "Y"
oCFL.SetConditions(oCons)
HI Noor MC Jooma ,
You have a Condition relation property for Conditions object
this is the way to add multiple conditions
dsa_Condition = dsa_Conditions.Add
dsa_Condition.BracketOpenNum = 2
dsa_Condition.Alias = "CardCode"
dsa_Condition.Operation = BoConditionOperation.co_GRATER_EQUAL
dsa_Condition.CondVal = "abc"
dsa_Condition.BracketCloseNum = 1
dsa_Condition.Relationship=BoConditionRelationship.cr_AND
dsa_Condition = dsa_Conditions.Add
dsa_Condition.BracketOpenNum = 1
dsa_Condition.Alias = "CardCode"
dsa_Condition.Operation = BoConditionOperation.co_LESS_THAN
dsa_Condition.CondVal = "abd"
dsa_Condition.BracketCloseNum = 2[/code]
You better have a look at the sample in SDK Help file that will help you
Regards
Vishnu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think you forgot at least the relationship between the conditions before the last add (if the brackets for two conditions are really needed you must test by yourself):
....
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
...
Cheers,
Roland
PS: Vishnu was faster...
Edited by: Roland Toschek on Feb 19, 2008 9:14 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
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.