Quickbooks Maintains the address fields different from Salesforce.
In order to Split the address from Salesforce Text area field based on the new line character, we have to make use of Java script.
In DBSync, you can either write the Java script in the mappings or make use of Functions where you can develop or write user defined functions.
I am providing an example of a Java script that can be written in the maps.
In Order to get the first line, You can implement the below script
{return VALUE(“
This will split the text area data and return only the first line.
For the second line, use the below script
{String ST = VALUE(“-1));int SL = ST.length(); if (SL>L1E & L2E>L1E) { String L2x = ST.substring(L1E+1,L2E); String L2 = L2x.substring(0,((L2x.length()>41)?(41):(L2x.length()))); return L2; }else if (SL>L1E & L1E>-1) { String L2x = ST.substring(L1E+1,SL); String L2 = L2x.substring(0,((L2x.length()>41)?(41):(L2x.length()))); return L2; }else { String L2 = “”; return L2; }}
And for the third line, use the below script
{String ST = VALUE(“-1));int L3E = ((L2E>-1)?(ST.indexOf(“n”,L2E+1))
-1));int SL = ST.length(); if (SL>L2E & L3E>L2E) { String L3x = ST.substring(L2E+1,L3E); String L3 = L3x.substring(0,((L3x.length()>41)?(41):(L3x.length()))); return L3; }else if (SL>L2E & L2E>-1) { String L3x = ST.substring(L2E+1,SL); String L3 = L3x.substring(0,((L3x.length()>41)?(41):(L3x.length()))); return L3; }else { String L3 = “”; return L3; }}