Forum Discussion

Irina's avatar
Irina
Contributor
18 days ago
Solved

Text field of Entity dimension in cube view

Dear all, Could you please advise how to show content of certain Text field of Entity dimension in cube view?  
  • BenEppel's avatar
    BenEppel
    16 days ago

    If your using text2 then you would need to change it. It is, you will just need logic to clean the string. Something like this should work.

    Dim textVal As String = api.Entity.Text(EntityID, 1, False, False)
    Dim taxRateStr As String = ""
    
    If Not String.IsNullOrEmpty(textVal) Then
        Dim startIndex As Integer = textVal.IndexOf("CIT=")
        Dim endIndex As Integer = textVal.IndexOf(",", startIndex)
    
        If startIndex >= 0 AndAlso endIndex > startIndex Then
            taxRateStr = textVal.Substring(startIndex + 4, endIndex - (startIndex + 4))
        End If
    End If
    
    Dim TaxRate As Decimal = taxRateStr.XFConvertToDecimal() / 100D