Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Notification at field change

Highlighted
Phanishwar
Collector

Notification at field change

What is the trigger point at which notification is sent ? is that selecting value like we have rule or One has to click save after value change.


On dev instance I am able to set notification for field BC ACtual. For the same field i am not getting this field as option on STAGE instance. Is there setting for the same?.

On dev I can set notification under Notification TAB. But I am not fetting notification for my email address. IT's strange.

Thanks in advance!!
9 REPLIES
Mahen M
Honored Contributor

Re: Notification at field change

Hanishwar,
The Request Type notification works for a ser of predefined 10 fields, It does not work for custom fields(I am not sure about PPM 8.0)

RT Mail triggers upon save, The mail triggering event occurs first and then the field value saving event.

If you want to add the field value in your notification, the new value will not be sent in your email, only the Old value goes.

Regards,
Mahendran M
Phanishwar
Collector

Re: Notification at field change

Thanks for the update!!. You are correct , it woks only for OOTB fields.

I am using PPM7.1 and now i am trying only OOTB fields : Project manager(KNTA_PROJECT_MANAGER) , Now when I select a value that time notification would go??..On my instance i am not getting notification for OOTB, seems there is some problem..
Mahen M
Honored Contributor

Re: Notification at field change

Can you paste the snap of the RT Notification here?

Regards,
Mahendran M
Phanishwar
Collector

Re: Notification at field change

I am in PPM7.1 version. On dev instance we have changed the validation setting so that customized fields could be used . The list of standard fields which PPM by default support are 10 fields in number . IN those fields This OOTB Project Manager field is not included. SO That's the reason it is not working I think. All OOTB fields is not supported for field level notification by PPM .Only for given set of fields has been included in the product package.

Pls find the attached screenshot.
avinash_k
Occasional Advisor

Re: Notification at field change

Hi,

 

I am adding a custom field in my request type having date as value and I want to send the email notifications to the users if mentioned date crosses the system date. But when I go to set the field level notification then I am not getting custom field in the list. Only predefined field are listed.

 

 So can anyone suggest me how can i implement this and what changes and where needs to be done?

 

Reply soon.

 

Thanks in Advance!!!

Utkarsh_Mishra
Honored Contributor

Re: Notification at field change

You can create a trigger or field change rule (using PRAGMA AUTONOMOUS_TRANSACTION) and call below Oracle SMTP utiltiy.

 

UTL_SMTP utility is provided by Oracle to send email on any DB event.

 

 

More deyails can be found on below link

 

Source:

 

http://www.orafaq.com/wiki/Send_mail_from_PL/SQL

 

DECLARE
  v_From      VARCHAR2(80) := 'oracle@mycompany.com';
  v_Recipient VARCHAR2(80) := 'test@mycompany.com';
  v_Subject   VARCHAR2(80) := 'test subject';
  v_Mail_Host VARCHAR2(30) := 'mail.mycompany.com';
  v_Mail_Conn utl_smtp.Connection;
  crlf        VARCHAR2(2)  := chr(13)||chr(10);
BEGIN
 v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
 utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
 utl_smtp.Mail(v_Mail_Conn, v_From);
 utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
 utl_smtp.Data(v_Mail_Conn,
   'Date: '   || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
   'From: '   || v_From || crlf ||
   'Subject: '|| v_Subject || crlf ||
   'To: '     || v_Recipient || crlf ||
   crlf ||
   'some message text'|| crlf ||	-- Message body
   'more message text'|| crlf
 );
 utl_smtp.Quit(v_mail_conn);
EXCEPTION
 WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
   raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
END;
/

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
avinash_k
Occasional Advisor

Re: Notification at field change

Thanks Utkarsh for your response.

 

This is possible only in case of plain text but I am sending email in html format and I believe this html formatting can not be done through pl/sql.

 

I am storing data through table component. Getting data from table entries is not as easy as getting it from request table. And also, we can't get table entry data simply in notifications as per my understanding of tool.

 

Can you please suggest some other way to send the notification in html format and getting the data from table entries?

Utkarsh_Mishra
Honored Contributor

Re: Notification at field change

I got this on net, and I think you can send HTML email as well. You just need to set the MIME_TYPE and content type, below is the sample.

 

Apart for Oracle, these are other not recommended suggestions.

 

  1. Create a trigger to populate PPM notification tables, so that the notitifaction service can pick these entires and send the emails.
  2. Create UI rules with Ajax, which is expensive solution and not recommended.

 

DECLARE
--
v_from VARCHAR2(80)  := 'noreply@abc.com';
v_recipient VARCHAR2(180) := 'abc.edf@acx.com';
v_recipient2 VARCHAR2(180) := 'asd5@gmail.com';
v_subject VARCHAR2(180) := 'Test Email using UTL_SMTP';
v_mail_host VARCHAR2(80):= 'localhost'; --SMTP host name
v_mail_conn utl_smtp.connection;
crlf VARCHAR2(2) := chr(13)||chr(10); --can be replaced by utl_tcp.crlf
v_body VARCHAR2(10000);
v_msg varchar2(1222) := '<html><head><meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
</head><body>
Test Message from <a href="http://www.google.com" target="_blank">www.google.com</a>
This Test Email is sent using <span style="color: #0000ff;">UTL_SMTP API</span>
</body></html>';
--
BEGIN
--
v_mail_conn := utl_smtp.open_connection(v_mail_host, 25); --25 is SMTP Port Number
utl_smtp.helo(v_mail_conn, v_mail_host);
utl_smtp.mail(v_mail_conn, v_from);
utl_smtp.rcpt(v_mail_conn, v_recipient);
utl_smtp.rcpt(v_mail_conn, v_recipient2);
--
v_body :=  'Date: ' || TO_CHAR(sysdate, 'dd Mon yy hh24:mi:ss') || crlf ||
'From: ' || v_From || crlf ||
'Subject: '||v_Subject || crlf ||
'To: ' || v_Recipient || crlf ||
'CC: ' || v_Recipient2 || crlf ||v_msg|| '';
--
utl_smtp.DATA (v_mail_conn, 'MIME-Version: 1.0' || crlf || 'Content-type: text/html' || crlf || v_body );
utl_smtp.quit(v_mail_conn);
--
EXCEPTION WHEN OTHERS
THEN
--
dbms_output.put_line(SQLCODE ||' - '||SQLERRM);
--
END;

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
AlexSavencu
Honored Contributor

Re: Notification at field change

Hi,

I have created html notifications with UTL_SMTP, definitely it works. Check the Oracle documentation fur the same.

Cheers
Alex

--remember to kudos people who helped solve your problem
//Add this to "OnDomLoad" event