Skip to content


Replace account number string in GL Map

BethZK asked 7 years ago
Hi there:

I have a GL map that i am trying to replace the last three characters of an account if it meets certain criteria to '000'  I created a calculation column but it seems to not be returning the right value.  It is returning false instead of the newstring value.  Here is the script – can you help me?

'———————————– CONFIGURATION ————————————-
Dim sourceValue As String = _ACCTNUM
Dim mapInterface As Integer = GBL_MANUAL
Dim newValue As String 
If  fn.LEFT(_ACCTNUM,4) = "2100" Then
Return newValue = "2100-000"
    Return newValue = sourceValue
End If
'System.Windows.Forms.MessageBox.Show(newValue, "Test Message")
Catch ex As Exception
If (mapInterface = 1) Then
Messagebox.Show(ex.Message, "ParseString Script Error")
End If
End Try
Return newValue
Best Answer
lorren answered 7 years ago

When you say Return newValue=sourceValue you are actually telling .NET to return the comparison of newValue to sourceValue which will return true or false.

Set the returns to 

Return = "2100-000"


Return sourceValue

where you have them in your code
BethZK replied 7 years ago

excellent!  that worked!  thanks so much!

If you would like to submit an answer or comment, please sign in to the eOne portal.