Skip to content
+1-888-319-3663

COMMUNITY FORUM

Replace account number string in GL Map

BethZK asked 9 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 
 
 
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
lorren answered 9 years ago
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
BethZK replied 9 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.