- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 04:12 AM
Hi All,
Currently i'm populating cmn_location table using Scheduled job & transform map.
The incoming data some times having unwanted space at the end (eg, loc1 ,loc 2 ,loc3 like wise).
I just need to trim this blank space & insert the correct value into target table.Though it can be done from Business Rule, I have been asked to specifically do with Transform script.
I have tried the below in 'onBefore' Transform Script but its not working.
if(source.u_site_code != '' && source.u_site_code != null && source.u_site_code != 'n/a')
target.u_site_code = (source.u_site_code).toString().trim();
if(source.u_street != '' && source.u_street != null && source.u_street !='n/a')
target.street = (source.u_street).toString().trim();
if(source.u_city != '' && source.u_city != null && source.u_city != 'n/a')
target.city = (source.u_city).toString().trim();
Any idea would be appreciated. Thanks in advance
Prici
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 07:06 AM
Thank you all for your responses.
Actually am able to achieve the same by writing script on field rather onBefore script.
Just clicked on the source field & checked 'Use source script'
Its working as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 07:06 AM