rpaterick Posted June 20, 2012 Posted June 20, 2012 I'm not grasping the external data setup. I've tried the sample file and still can't figure how it works. 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
ThomasLewis Posted June 21, 2012 Posted June 21, 2012 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"); }
rpaterick Posted June 21, 2012 Author Posted June 21, 2012 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!
ThomasLewis Posted June 21, 2012 Posted June 21, 2012 If you add return HotelOffer; to the end of the rule it should return a value.
rpaterick Posted June 21, 2012 Author Posted June 21, 2012 If you add return HotelOffer; to the end of the rule it should return a value. Interesting. I think I'm onto something now..... I'll get back to you. Thanks Thomas!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.