cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer Combobox (selected) item to Parameter value? (VB api)

Highlighted
Participant

How to transfer Combobox (selected) item to Parameter value? (VB api)

I'm trying to get an selected item from a ComboBox to an specific Parameter value:


ComboBox1.text=ComboBox1.SelectedItem.Value   

parameter(12) = mdl.GetParam("Parameter1")

pvalue(12) = (New CMpfcModelItem).CreateStringParamValue(ComboBox1.Text)

CType(parameter(12), pfcls.IpfcBaseParameter).Value = pvalue(12)


Now I'm getting the following Toolkit Error:

ComboBox1_error.JPG


Tags (2)
1 REPLY 1
Highlighted

Re: How to transfer Combobox (selected) item to Parameter value? (VB api)

Without seeing any declerations of your objects and variables the error can pretty much be anything.

parameter(12) indicates some type of array but i can not see the type

Try something like this...

Dim CBText as String = ComboBox1.text

Dim parameter As IpfcParameter

Dim paramValue As IpfcParamValue

parameter = mdl.GetParam("Parameter1")

' Get param type
Dim type As String = PDUtils.getTypeFromParam(CType(parameter, IpfcBaseParameter).Value)

' Create param value
paramValue = PDUtils.createParamValue(CBText, type)
 
' Set param value
CType(parameter, IpfcBaseParameter).Value = paramValue

Announcements