of_processnotify


pfcapsrv.pbl   >   pfc_n_cst_error   >   of_processnotify   

Full name pfc_n_cst_error.of_processnotify
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_processnotify()

Name Datatype
No Data

Name Datatype
li_addresscount Integer
li_count Integer
li_i Integer
li_rc Integer
lmm_mMsg mailMessage
lmrc_mRet mailReturnCode
ls_notesubject String
ls_notetext String

protected function integer of_processnotify ();//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_ProcessNotify
//
//	Access:  		protected
//
//	Arguments:  	none
//
//	Returns:  	integer
//					 1 if it succeeds
//					 0 No Mail Connection or Notification receipients have been set up.
//					-1 if it fails.
//
//	Description:	This function is used to notify the passed in users of the message.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
// 5.0.03 Enhanced to populate the address in addition to the Receipient's name.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

String				ls_notesubject
String				ls_notetext
Integer				li_i
Integer				li_count
Integer				li_addresscount
Integer				li_rc
mailReturnCode		lmrc_mRet
mailMessage  		lmm_mMsg

// Check for a mail connection.
If IsNull(ims_mSes) Or Not IsValid(ims_mSes) Then
	Return 0
End If

// Get count of users to notify.
li_count = upperbound(is_notifywho)
li_addresscount = upperbound(is_notifyaddress)
If li_count <= 0 Then
	Return 0
End If

// Create the Notify information.
li_rc = of_CreateNotifyText(ls_notesubject, ls_notetext )

// Populate the Message Subject.
lmm_mMsg.Subject = ls_notesubject

// Populate the Message Text. 
lmm_mMsg.NoteText = ls_notetext

// Populate the Message Recipients.
For li_i=1 to li_count
	lmm_mMsg.Recipient[li_i].Name = is_notifywho[li_i]
	
	// When available, populate the address.
	// The address is not needed for Names that are unique.  The address is
	// needed for names that are not unique and therefor cannot be resolved 
	// without the assistance of the address.
	If li_addresscount >= li_i Then
		If Len(Trim(is_notifyaddress[li_i])) > 0 Then
			lmm_mMsg.Recipient[li_i].address = is_notifyaddress[li_i]
		End If
	End If
Next

// Send the mail.
lmrc_mRet = ims_mSes.mailSend ( lmm_mMsg )

// Check for a succesful Send Mail.
If lmrc_mRet <> mailReturnSuccess! Then
	Return -1
End If

Return 1
end function

     
Name Owner
pfc_n_cst_error.of_processmessage pfc_n_cst_error

     
Name Owner
mailsession.mailsend mailsession
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_error.of_createnotifytext pfc_n_cst_error

     
Full name
No Data

     
Name Scope
No Data