get itemcodes from matrix in one string

Hi ,

i'm trying to create a link with all the itemcodes from an offer.
The links is :,A10002

this part is fixed:
But then the second part should be populated with the Itemcodes from the matrix.

I'm using similar code to open a track and trace link but this only has 1 value added in the url.

    Dim sShipping As String = TextEdit.GetFromUID(pVal.Form, "251").Value.ToString
    StatusBar.WriteSucess(" sShipping : " & sShipping)    
    Dim gls As String = ""
    Dim url As String = gls & sShipping
Catch ex As Exception
    MessageBox.Show("Probleem bij het oproepen van de Track & Trace Link: " & ex.Message, "OK")
End Try

So can someone show me how to get the Itemcode from the matrix into a string with , separation


  • Official comment

    Hi Tom,

    you need to loop through the matrix as below:

    Dim ruleName As String = pVal.RuleInfo.RuleName
    Dim errorMessage As String = "Error in Function Button Rule '" + ruleName + "'"
        Dim base As String = ""
        Dim url As String = base
        'Run trough all rows
        Dim m As Matrix = Matrix.GetFromUID(pVal.Form, "38")
        For i As Integer = 0 To m.Rows.Count - 1
            Dim itemCode As String = m.GetValue("1", i)
            If Not String.IsNullOrEmpty(itemCode) Then
                url = url + m.GetValue("1", i) + ","
            End If    
        If url.Trim().Substring(url.Length - 1, 1) = "," Then
            url = url.Trim().Substring(0, url.Length - 1)
        End If    
        MessageBox.Show(url, "ok")
    Catch ex As Exception
        customize.Messaging.StatusBar.WriteError("Error in coresuite customize Rule: " & ex.ToString())
        customize.Messaging.Debug.WriteMessage("Error in coresuite customize Rule: " & ex.ToString(), customize.Messaging.Debug.DebugLevel.Exception)    
    End Try

    Please check and feel free to customize the rule as necessary for the purpose. 


    Best Regards

    Karsten Amrein

    Comment actions Permalink
  • this works great 


    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post