01-20-2023 10:02 AM - last edited on 05-02-2023 09:51 AM by JackLacava
I want to update the parameter of my dictonary . How can i achieve it? .add adds the value in the dictonary. Is there any update function to update the value of that key in dictonary
Dim params2 As New Dictionary(Of String, String)
params2.Add("Entity_param_db","E001" )
For Each MemberOfList As MemberInfo In Nonstreamproduct
params2.Add("Entity_param_db",MemberOfList.Member.Name)
BRApi.Utilities.StartDataMgmtSequence(si,dataMgmtSeq2, params2)
Next
Solved! Go to Solution.
01-20-2023 11:26 AM
Two ways:
' Explicit
myDict.Item("myKey") = newValue
' Shortcut
myDict("myKey") = newValue
For more help, have a look at the official documentation from Microsoft.
01-20-2023 11:26 AM
Two ways:
' Explicit
myDict.Item("myKey") = newValue
' Shortcut
myDict("myKey") = newValue
For more help, have a look at the official documentation from Microsoft.
01-23-2023 04:50 AM
Thanks for this. I eneded up using removing the key value before iterating next loop and then adding it back.
01-27-2023 04:55 PM
Hi, to handle duplicated or non-existing keys, I would suggest you to use a couple of nifty extended dictionary methods available in OneStream: XFGetValue and XFSetValue.
Dim params As New Dictionary(Of String, String)
params.XFSetValue("sameKey", "A")
params.XFSetValue("sameKey", "AB")
Dim sValue As String = params.XFGetValue("noKey", "defaultValue")
11-17-2023 03:47 PM
Hi OS, Can you please share how you did the setup for dictionary, i am trying to do below by adding cost centers from "mCostCenter As MemberInfo In listCCs" to a dictionary. It looks like you were creating the list as well.
I need the values out of cube view selection to use in the business rule in api.data.calculate. Need is to capture and save the values before applying in the calculations. Idea is to use dictionary to add "mCostCenter As MemberInfo In listCCs" to dictionary and loop thru the list in the dictionary to reduce BR processing time.
Appreciate sample code to add memberinfo to the dictionary.