Jump to content

Need help on a external data file


Recommended Posts

I'm not grasping the external data setup. I've tried the sample file and still can't figure how it works.:o

 

Attached is the actual external data file(should be formatted correctly). Master Tier is the main lookup from the mail file. MT is the column header from the mail file that points to Master Tier in extern.

 

1st.

On Record Start

//Link to the external data file.  
//The '\t' is used to indicate TAB delimited data in this external data file
externalDF = new ExternalDataFileEx('Formatted.txt', '\t');

if(externalDF.valid != true)
{
   Print('Failed to link to the external data file in OnJobStart');

 

2nd.

Then to create the individual fields from the external data file(very basic), I get lost in the Rules.

How would you create the HotelOffer from the external data file? If I can get that to work, I can then create the rest. I'm just not getting my current code to "validate" the HotelOffer.

 

Also, does the mailing file and the external data file need to be in the same root as the Fusion Pro Template?

 

Thanks for any direction on this.:)

external proof file.txt

Link to comment
Share on other sites

This is the way I learned how to do it and I haven't had any issues with it. It is a little different than the example found in the forums though.

 

OnJobStart

externalDF = new ExternalDataFileEx('external proof file.txt', '\t');
return externalDF.valid;

 

Rule

if (FusionPro.inValidation)
   Rule("OnJobStart");

i = externalDF.FindRecord("Master Tier", Field("MT"))

if (i>0 && Field("MT") != "")
{
   HotelOffer = externalDF.GetFieldValue(i, "HotelOffer");
}

Edited by ThomasLewis
Link to comment
Share on other sites

This is the way I learned how to do it and I haven't had any issues with it. It is a little different than the example found in the forums though.

 

Thanks Thomas. I got an error when trying to just validate the HotelOffer though. Function doesn't return a value.

 

Any ideas? suggestions?

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...