cancel
Showing results for 
Search instead for 
Did you mean: 

Choose From List Muliple Conditions

Former Member
0 Kudos

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)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Sweeeet...Thanks Guys (Vishnu)

mardi_mangun
Explorer
0 Kudos

My problem solve...thanks visnu

Answers (1)

Answers (1)

Former Member
0 Kudos

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