Replace account number string in GL Map
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?
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
Try
If fn.LEFT(_ACCTNUM,4) = "2100" Then
Return newValue = "2100-000"
Else
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
Answers
Best Answer
Beth,
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"
and
Return sourceValue
where you have them in your code
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"
and
Return sourceValue
where you have them in your code
excellent! that worked! thanks so much!