There are multiple ways that your rule could be failing.  For these
kinds of things, I like to remember that old line about "Give a man a
fish."  If I had your job to look at, I could analyze exactly why you're
not getting the results you expect.  But I'll try to give you some tips
to analyze it yourself.

Some of you who were at the User Conference might have seen my
presentation on JavaScript debugging techniques in FusionPro.  But the
gist of it is that you can use extra return statements and Print
function calls to analyze your rules, and pinpoint exactly where the
problem is.

In this case, the first thing you want to do is make sure that the
external data file is actually loaded.  The way to do this is with the
ExternalDataFileEx.valid property:

You can put some code like this at the beginning of your rule:

  if (!Courses_XDF.valid)
    return "Failed to load external file";

(Larry has a line like this in the code he posted in the "Help with
looping on external data files" yesterday.)

Once you determine that the file is loaded, the next step is to check
whether you're actually finding a record.  Insert some code to check for
that, like so:

  var RecNum = ExtDB.FindRecord("ReferenceNo", Field("ReferenceNo"));

  if (RecNum < 0)
    return "External data file record not found for reference number " +
               Field("ReferenceNo");

  return ExtDB.GetFieldValue(RecNum, "Website");

Keep adding extra checks like this in the code and you'll figure out
where the problem is.  You can also use the Print function to output
messages to your log file, so that when you do a production run, you can
easily search the log file to find the cases where something went wrong
without having to manually look at hundreds or thousands of pages of
output.

Dan


--
Users of FusionPro Desktop have unlimited free email support. Contact Printable 
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm

--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--


--
Note:  All e-mail sent to or from this address will be received or otherwise 
recorded by the e-mail recipients of this forum. It is subject to archival, 
monitoring or review by, and/or disclosure to someone other than the recipient. 
Our privacy policy is posted on www.printplanet.com
--

Reply via email to