StoredFileCountForDonor()

<< Click to Display Table of Contents >>

Navigation:  Available Functions >

StoredFileCountForDonor()

Syntax

StoredFileCountForDonor( <cFileMask> )

 

Purpose

To determine the number of stored files for a donor which match an optional file mask.

 

Parameters

<cFileMask> is a character value which must be enclosed in quotation marks. It can be used to limit the types of files which are counted, or to specify that only files beginning with a certain name be counted. For example, "*.pdf" would count the names of all PDF document files for the current donor. "Profile Picture*.jpg" would count the number of stored files for the current donor which start with the phrase "Profile Picture."

 

Returns

A number representing the count. Zero will be returned if the current donor has no stored files, or no files matching the specified file mask.

 

Usage

On reports and exports the StoredFileCountForDonor() function can be used to print the total number of stored files, or the total number of files meeting a certain file mask, for each donor. This function is also very useful in custom DonorQuest selections (queries). For example, you could create a selection of all the constituent records with any stored files at all with this one condition:

 

StoredFileCountForDonor() > 0

 

Likewise you could create a selection of all the constituents who have one or more stored PDF files using this one condition:

 

StoredFileCountForDonor( "*.pdf" ) > 0

 

Further Examples

The following examples further illustrate StoredFileCountForDonor():

 

STORED FILES FOR DONOR

Audio file of speech donor gave at city council meeting.mp3

ConstituentNotes.doc

Profile picture of donor.jpg

Picture of donor at our top donor tribute dinner.jpg

Scan of letter donor sent us praising our work.pdf

 

 

CALL

RESULT

StoredFileCountForDonor()

5

StoredFileCountForDonor( *.pdf )

1

StoredFileCountForDonor( *.jpg )

2

StoredFileCountForDonor( "Profile*.jpg" )

1