BIP_EMAIL_DATA Class Methods

The methods in this section are described in alphabetical order.

Syntax

BIP_EMAIL_DATA()

Description

Implement the BIP_EMAIL_DATA class constructor to initialize the BIP_EMAIL_DATA object with a custom message set number.

Parameters

None.

Returns

None.

Example

method BIP_EMAIL_DATA
   
   &m_errorStr = "";
   &m_ErrorMessageSet = 235;
end-method;

Syntax

getEmailAddressArray()

Description

Implement the getEmailAddressArray method return an array of external email addresses to BI Publisher for PeopleSoft.

Note: This is an abstract method.

Parameters

None.

Returns

An array of String.

Example

In the following example, DEPTID is used as the burst field. The email addresses corresponding to the specified DEPTID burst value are retrieved from the PS_EMPL_MD_EMAIL table and returned in the array.

method getEmailAddressArray
   /+ Returns Array of String +/
   /+ Extends/implements IPT_BIP_EXT_EMAIL_INT:BIP_EMAIL_DATA.getEmailAddressArray +/
   Local array of string &aEmailAddressArray = CreateArrayRept("", 0);
   Local string &sql;
   Local string &sEmail;
   Local string &sDeptId;
   Local SQL &SQLObj;
   Local number &i;
   
   
   If &ReportName = "" Or
         &ReportName = " " Then
      &m_errorStr = "No Report Name is specified";
      Return Null;
   End-If;
   try
      
      Evaluate Upper(LTrim(RTrim(&ReportName)))
      When "CQ_EMAILS_MD"
      When "CQEMAILNB_MD"
         
      When-Other
         &m_errorStr = "Incorrect user email data application class is used for the report - " | &ReportName;
         Return Null;
      End-Evaluate;
      
      
      If &BurstFieldName <> "" Then
         WriteToLog(%ApplicationLogFence_Level1, "App Plugin - BurstFieldName: " | &BurstFieldName);
         WriteToLog(%ApplicationLogFence_Level1, "App Plugin - BurstFieldValue: " | &BurstFieldValue);
      End-If;
      
      If &BurstFieldName <> "" Then
         If Not (Upper(&BurstFieldName) = "DEPTID" Or
               Upper(&BurstFieldName) = "A.DEPTID") Then
            &m_errorStr = "&BurstFieldName is not equil to DEPTID (A.DEPTID)";
            Return Null;
         End-If;
      End-If;
      &sDeptId = &BurstFieldValue;
      
      If &BurstFieldName <> "" Then
         &sql = "SELECT A.EMAILID FROM PS_EMPL_MD_EMAIL A WHERE A.EFFDT = ( SELECT MAX(B.EFFDT) FROM PS_EMPL_MD_EMAIL B WHERE A.EMPLID = B.EMPLID AND A.DEPTID = B.DEPTID AND B.EFFDT <=%CurrentDateIn) AND A.DEPTID =  '" | &sDeptId | "'";
      Else
         &sql = "SELECT A.EMAILID FROM PS_EMPL_MD_EMAIL A  WHERE A.EFFDT = ( SELECT MAX(B.EFFDT) FROM PS_EMPL_MD_EMAIL B WHERE A.EMPLID = B.EMPLID AND A.DEPTID = B.DEPTID AND B.EFFDT <=%CurrentDateIn)";
      End-If;
      
      &SQLObj = CreateSQL();
      &SQLObj.Open(&sql);
      &SQLObj.ReuseCursor = True;
      While &SQLObj.Fetch(&sEmail)
         If All(&sEmail) Then
            &aEmailAddressArray.Push(&sEmail);
         End-If;
      End-While;
      
      
      If &SQLObj.IsOpen Then
         &SQLObj.Close();
      End-If;
      Return &aEmailAddressArray;
      
      
   catch Exception &Err
      Local string &sSub1, &sSub2, &sSub3, &sSub4, &sSub5;
      Evaluate &Err.SubstitutionCount
      When > 4
         &sSub5 = &Err.GetSubstitution(5);
      When > 3
         &sSub4 = &Err.GetSubstitution(4);
      When > 2
         &sSub3 = &Err.GetSubstitution(3);
      When > 1
         &sSub2 = &Err.GetSubstitution(2);
      When > 0
         &sSub1 = &Err.GetSubstitution(1);
      End-Evaluate;
      &m_errorStr = MsgGet(&Err.MessageSetNumber, &Err.MessageNumber, &Err.ToString(), &sSub1, &sSub2, &sSub3, &sSub4, &sSub5);
      Return Null;
   end-try;
   
   
end-method;

Syntax

getErrorString()

Description

Implement the getErrorString method to return a detailed error message to BI Publisher for PeopleSoft. The detailed error message should be internal to your implementation of the getEmailAddressArray method.

Note: This is an abstract method.

Parameters

None.

Returns

A String value.

Example

During execution of the getEmailAddressArray method, the &m_errorStr instance variable is set to a literal string in some cases or to the message catalog entry. For example:

   &m_errorStr = MsgGet(&Err.MessageSetNumber, &Err.MessageNumber, &Err.ToString(), &sSub1, &sSub2, &sSub3, &sSub4, &sSub5);

Then, this &m_errorStr instance variable is set as the return value for the getErrorString method:

method getErrorString
   /+ Returns String +/
   /+ Extends/implements IPT_BIP_EXT_EMAIL_INT:BIP_EMAIL_DATA.getErrorString +/
   
   Return &m_errorStr;
end-method;