Quantcast
Channel: Ivanti User Community: Message List
Viewing all articles
Browse latest Browse all 12704

For Loop not checking all items in a collection

$
0
0

The calc checks the collection and returns a ‘True’ Value on the first item in the collection if it contains the string ‘CIMS 4.0’, but doesn’t seem to check the rest of the items in the collection. My intent is for it to check each item in the collection, and if ANY of them contain this value, ‘CIMS 4.0’ then it will return a value of ‘True’.

 

import System

static def GetAttributeValue(Request):

Value = 'False'

for Version in Request._EndUser.UserConfigItems:

if Version.ConfigItem._CIMSVersion._CIMSVersion == 'CIMS 4.0':

if Version.ConfigItem._CIMSVersion._CIMSVersion != null:

Value = 'True'

       return Value

 

Can you see why the calc might not be looking at all items in the collection to check for that value?


Viewing all articles
Browse latest Browse all 12704

Trending Articles