Skip to content
+1-888-319-3663

COMMUNITY FORUM

Is Not Declared

Evan M. asked 8 months ago
I have a calculation in one of my maps that I am unable to get to work.  I keep getting LEFT and RIGHT is not declared.I have tried to add dim LEFT(_BATCHID,6) as string and dim RIGHT(_BATCHID,2) as string but I end up with a document error.return _GPCONTRACTORCODE & LEFT(_BATCHID,6) & RIGHT(_BATCHID,2)
Answers
Lorren Zemke Staff answered 7 months ago
Evan,
Right and Left are not vb.net nor C# commands when creating a calculated field. In .NET you need to use Substring commands and/or InStr commands to get what you need.
For example
1. Left = Get the batch id starting at the first character and the next six
2. Right  = Get the two right characters
 
return _GPCONTRACTORCODE & _BATCHID.Substring(0,6) & _BATCHID.Substring(_BATCHID.Length-2,2)
 

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