Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 8th, 2019, 08:26 AM
dml1280 dml1280 is offline
Forum n00b
 
Join Date: Apr 2016
Posts: 8
Default Format Phone from External Data File

How do I apply a phone format (ie. 123.456.7890) to a phone number being pulled from an external data file?

I have rules for each, but can't figure out how to combine them.

Thank you.

Here is the rule that pulls the phone number from the external data file:

Code:
returnStr = '';

if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true)
{
    Rule("OnJobStart");
}

numRecsExtDF = externalDF.recordCount;

for (recordWalker=1; recordWalker <= numRecsExtDF; recordWalker++)
{
    if (externalDF.GetFieldValue(recordWalker, 'Location') == Field("Location"))
    {
        returnStr += externalDF.GetFieldValue(recordWalker, 'Phone');
    }
}

return returnStr;

Last edited by dml1280; January 8th, 2019 at 08:51 AM..
Reply With Quote
  #2  
Old January 9th, 2019, 05:51 AM
dml1280 dml1280 is offline
Forum n00b
 
Join Date: Apr 2016
Posts: 8
Default Re: Format Phone from External Data File

Answering my own question...I totally overthought this.

The answer is to have the phone set with the proper formatting in the external data file. Since I have control over the data file, I can make sure it's consistent every time.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:21 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.