Expand my Community achievements bar.

How can I tell if no records are returned

Avatar

Former Community Member
I've got several textfields populated from a query using an Access database. I dont quite understand the sourceSet stuff yet, but I need to pop up a dialog box if there are 0 results returned by the query. something like this:



if(xfa.sourceSet.DataConnection.nodes.length == 0)

{

xfa.host.messageBox("No results found");

}



Thanks
3 Replies

Avatar

Former Community Member
Anyone have any idea on how to accomplish this? What is the XFA model for the result node set ?

Avatar

Former Community Member
Basically, when the sourceset populates the Data DOM, what is the node name to check for. is it eof, bof, etc.?

Avatar

Former Community Member
I figured out a way using a javascript try/catch block:



//open the Dataconnection

xfa.sourceSet.ConnectionName.open();



try

{

xfa.sourceSet.ConnectionName.first();

}

catch(e)

{

xfa.host.messageBox(e);

}

finally

{

xfa.sourceSet.ConnectionName.close();

}