Skip to content
+1-888-319-3663

EONE BLOG

Tech Tuesday: SmartConnect – Calculated Fields and Strings



Our Senior Consultant, Chris Hanson, is up for this week's Tech Tuesday on SmartConnect:

One thing I run across a lot is what happens when using calculated fields to manipulate strings within SmartConnect. Most of the time everything works as expected, but occasionally it’ll appear that the calculated field isn’t doing what it is supposed to when trying to run compare, concatenate, index, etc. commands.

What I am referring to is the situation where the string has padded characters on the end of it, so the data doesn’t stop where you expect it to. The biggest culprit is actually GP, almost any field you pull out of GP that is a string will have white spaces padded to the end due to the data types GP uses to store the data.

The easiest example is pulling out a first name and a last name from GP and trying to concatenate them together to send to another system or out to a file. If your source fields are named FRSTNAME and LASTNAME this is what your calculated field might look like if you are not aware of the additional spaces:

Return _FRSTNAME & " " & _LASTNAME

That calculated field would return something close to this result:

Chris                                                               Hanson


What should be done is a Trim statement should be applied to each field:

Return _FRSTNAME.Trim() & " " & _LASTNAME.Trim()

That would give us the expected space between the names without all the additional characters. The Trim statement should be used anytime you are not sure if there are trailing white spaces on the fields you are going to be using within a map or calculated field to ensure you are working with just the data you want.


Have something you'd like to see featured on our next Tech Tuesday? Email us at sales@eonesolutions.com!

Leave a Comment





RECENT POSTS


Connect with us at Directions EMEA 2021 in Milan!
eOne at Summit North America 2021
Employee Spotlight: Megan Tripp, Business Development Representative
eOne is now compatible with Microsoft Dynamics GP October 2021 Release
October 2021 Releases of Extender, SmartList Builder, SmartView, SmartPost, and Flexicoder are Now Available

POPULAR POSTS


2016 SmartConnect Integration Bootcamps
Tech Tues: Automatically refreshing Pivot Tables in Excel Refreshable Reports
Happy Thanksgiving from the eOne team!
2017 SmartConnect Integration Bootcamps
New Releases of Extender and SmartList Builder

CATEGORIES

TAGS

Business Central CRM D365 Business Central Dynamics 365 dynamics crm Dynamics GP Dynamics NAV Econnect Employee Spotlight eone eOne News error Error Message Events Excel Excel Report Builder Extender Flexicoder GP integration Map Meet the Team Microsoft dynamics crm Microsoft Dynamics GP Navigation List Builder Office Relationships partners Popdock release Reporting SalesForce SalesForce.com SmartConnect SmartConnect.com SmartConnect Bootcamp SmartConnect Maps SmartConnect Office Hours SmartList SmartList Builder SmartPost SmartView SQL Tech Tuesday Templates training

Integrate & Automate without Any Code.

SmartList Data has Never Been Faster.

The Easiest Way to Report on GP Data.