How to generate alerts from the oaf page

hii.......
I need to generate simple alert from oaf page...........
can u suggest me sample code for this????????

Hi Nazeer,
Nazeer again and again you are replying the same answer and again and again I'm asking you the same question.
What do you mean by alert?? is it some mail that you want to send from OAF page??
sample code to send mail from OAF:
import java.io.*;
import java.net.*;
* This program sends e-mail using a mailto: URL
public class SendMail {
public static void main(String[] args) {
try {
// If the user specified a mailhost, tell the system about it.
if (args.length >= 1) System.getProperties().put("mail.host", args[0]);
// A Reader stream to read from the console
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
// Ask the user for the from, to, and subject lines
System.out.print("From: ");
String from = in.readLine();
System.out.print("To: ");
String to = in.readLine();
System.out.print("Subject: ");
String subject = in.readLine();
// Establish a network connection for sending mail
URL u = new URL("mailto:" + to); // Create a mailto: URL
URLConnection c = u.openConnection(); // Create a URLConnection for it
c.setDoInput(false); // Specify no input from this URL
c.setDoOutput(true); // Specify we'll do output
System.out.println("Connecting..."); // Tell the user what's happening
System.out.flush(); // Tell them right now
c.connect(); // Connect to mail host
PrintWriter out = // Get output stream to mail host
new PrintWriter(new OutputStreamWriter(c.getOutputStream()));
// Write out mail headers. Don't let users fake the From address
out.println("From: \"" + from + "\" <"user.name") + "@" +
InetAddress.getLocalHost().getHostName() + ">");
out.println("To: " + to);
out.println("Subject: " + subject);
out.println(); // blank line to end the list of headers
// Now ask the user to enter the body of the message
System.out.println("Enter the message. " +
"End with a '.' on a line by itself.");
// Read message line by line and send it out.
String line;
for(;;) {
line = in.readLine();
if ((line == null) || line.equals(".")) break;
out.println(line);
// Close the stream to terminate the message
out.close();
// Tell the user it was successfully sent.
System.out.println("Message sent.");
System.out.flush();
catch (Exception e) { // Handle any exceptions, print error message.
System.err.println(e);
System.err.println("Usage: java SendMail [<mailhost>]");
Regards,
Reetesh Sharma
Edited by: Reetesh Sharma on Jun 30, 2010 3:27 AM

Similar Messages

  • How to generate alert from Mapping

    Hello,
    I know how to generate alrets by configuring ALRTCATDEF, Alert Configuration.
    I want to know how we can generate alert from mapping for ex..
    If a=b then send the message
    and if a!=b then failed the message and throw and alert.
    In java or XSLT mapping
    Thnaks and Regards
    Hemant

    Hi Hemanth,
    Bhavesh Blog explied to raise alert using UDF,if you want using JAVA or XSLT converth the same code in to JAVA Map,I think it will work.
    I had done similar requirement using Mial adapter using Java Mapping.
    Regards,
    Raj

  • Generating alert from the payload

    Hi,
    We have a requirement to generate alert from payload. If the value of the particular field is 'X" than generate an alert.
    We are not using BPM. Please advice how can this be achieved without BPM
    Regards
    Edited by: XI_Fan on Aug 19, 2008 4:12 PM
    Edited by: XI_Fan on Aug 19, 2008 4:14 PM

    >>We are looking at creating alert from Alert framework using payload by checking the field.
    Generating alerts is a 2 step process.
    In first step you need to do all the configurations in ALRTCATDEF and RWB->alert configurations.
    Next step if to have some trigger mechanism via which error will be generated in the processing of message and hence alerts will be triggered.
    Normally we use UDF to validate payload and if an error occurs we can trigger the alert,but in your case since you can't use UDF,you can use a simple If-Else condition and map the result to some mandatory(occurence 1-1) field on the receiver side.
    If the If-Else condition is not satisfied,then the mandatory receiver element/node will not be generated and hence a mapping error will trigger an alert.
    Thanx
    Aamir

  • How-to Generate Script from the export dump file

    Hi all,
    Software : Oracle 10gR2/Windows 2003
    =============================
    Has anyone generated a Script from a export dump file ( exported via data pump export). I know it is possible to generate script from the regular export.
    I want to know how to generate the script for various objects or is it possible to get the counts of types of objects in the dump file and / or generate the script from the export dump file exported via data pump utility on Oracle 10g.
    Thanks,
    SS

    I want to know how to generate the script for various objects.what do you mean by scripts? Assuming the metadata definitions of various objects.
    First of all, you can generate the metadata definitions using import.
    Use, Impdp with SQLFILE parameter to generate the SQL file for the metadata definitions.
    Refer to
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_overview.htm

  • How to add Video on the OAF page like youtube ?

    Any one know how to add Video on the page?

    If you are getting HTML code from one of these slideshow.com places, you can add this code to your iWeb pages with a little bit of work. Two things to keep in mind...1. No way to do this via iWeb directly, so it involves editing the published html files, and 2. Because iWeb republishes the html files whenever you update the your webpage, you will lose your changes and have to redo them to add your slideshows back.
    The general directions are as follows...
    1. Decide where you want your slideshow and know exactly what dimensions you need.
    2. Insert a text box onto your page and adjust its size to exactly your dimensions.
    3. Type in some uniquely identifiable text like, "SLIDESHOWHERE" without changing the font or anything else...just type it in.
    4. Publish your page with iWeb.
    5. Find the html file associated with your published page (either on your iDisk or in a folder depending on how you published) and open it in any text editor (like Microsoft Word, or Textedit, or anything). You may need to set your text editor to "ignore rich text" or to "show HTML source".
    6. Scroll through the html file and locate your placeholder text, e.g. "SLIDESHOWHERE".
    7. Replace the placeholder text with your html code and save your page.
    That's it. You should see your slideshow element show up in Safari where you placed the text box in iWeb!

  • How can I recover from the new Pages

    Does anyone know how I can recover a Pages file which has become locked into the new Pages program? I never edited it with the new Pages, but now I'm told I must have the new Pages to open it. I even tried opening it with the new Pages and converting it to PDF with the plan to copy and paste it into Pages '09, but i lost control of line spacing, etc. (It is a 4-column file of data on one page (in the '09 version, that is). Appreciate any help.

    Jay,
    Surely you did edit the file with Pages 5.2, or you wouldn't be having this problem. It's an easy mistake to make since both versions have exactly the same filename and extension. They are just stored in different folders. 5.2 is in Applications and 4.3 is in Applications/iWork '09.
    Use TimeMachine to locate a clean backup file.
    Jerry

  • How to Raise Alerts from the fields of Mapping?

    HI,
    We had a very typical requirement for our client.
    Scenarios is IDOC to multiple files else consider a simple file to file scenario.
    Source structure contains some 5 fields and the target also remains the same 5 fields.
    Assume SERNO presents in both structures.
    The issue here is i need to check for a Target SERNO field  should accept only numerical value, there is a possibilty of coming alphanumeric and sometimes with specialcharacter appended  numeric. i have developed a udf which allows only numeric.
    The mapping is getting failed if alphanumeric or special character exists in that field.
    But, the client requires an alert mentioning that this mapping is failed due to the problem in Source SERNO field so that he can easily debug and resubmit those idocs.
    I want to know is it possible to raise alerts at field levels.
    Thanks,
    --Kishore

    Hi Raja,
    This is a new development and we dont hve any Alert framework right now exist, i believe even the alert category its not possibel to drill down to the field level.
    if its possible could you please elaborate.
    We have many fileds to check as similarly defined above example SERNO, so if the alerts are triggered @ filed level that are failed that will be a great..
    My Ultimate requirement is to notify client that due to this field the mapping was occured and alert should throw some light on to locate the error at the field level.
    Please suggest how to procced..
    Thanks,
    --Kishore

  • How to get the FND user_id from a  OAF page

    Hi,
    I want to get the FND user_id of the user who opened the OAF page from the controller. How can I get this. Also how to see all the attribute names that I use in the controller. I see that I can use paramOAPageContext.getParameter("attribute"). Where can I get the list of all the attribute names?
    Thanks for your help.

    What attribute name was associated to that Button to use in getParameter(?)You have to enter the bean Id, let say the PoHeaderId is a MessageStyleTextInput Bean so have to take its ID from JDev or from front end.
    String value = pageContext.getParameter("BeanID");Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How can I Fetch the error message from a OAF page

    Hi,
    A confirmation message is coming on the page,I want to catch the error message and depending on its value want to add some validation.
    Is that possible to fetch the error message from the page?

    is it a confirmation message or an error message ?
    Code in the OAF page would be raising an OAException with a message name defined in message dictionary.
    you would need to look at the code to understand where this is thrown from and add your validation there.
    Tapash

  • How do I raise a Business Event from a OAF page?

    Hello,
    I am developing a custom system using the OAF and need to raise a custom Business Event, which in turn will have a subscription to launch a workflow process.
    How do I raise a Business Event from a OAF page ?
    Can I use the classes in oracle.apps.fnd.wf.bes.* ?
    Any help would be highly appreciated.
    Best Regards,
    Andries Hanekom

    Hi,
    When I try to compile just the basic part of my class I receive the following error:
    Error(21,36): cannot access class javax.jms.TextMessage; file javax\jms\TextMessage.class not found
    Class Code:
    import oracle.apps.fnd.wf.bes.BusinessEvent;
    public class VscmsEvents
    public VscmsEvents()
    public static void main(String[] args)
    VscmsEvents vscmsEvents = new VscmsEvents();
    //Initialize BusinessEvent, Payload objects
    public void initEvent(String eventName, String eventKey, String eventData)
    //Create BusinessEvent Object
    BusinessEvent mEvent = new BusinessEvent(eventName, eventKey);
    Furthermore, when using the BusinessEvent object to raise the event I will need to provide the raise method with a java.sql.Connection parameter. In the context of a OAF page how will I perform this?
    Thanks for the help.
    Best Regards,
    Andries Hanekom

  • How do I move an icon from the second page of my home screen to the first page  and vice versa?

    How do I move an icon from the second page of my home screen to the first page and vice versa?

    Hold an icon down until they all wiggle.
    Drag it wherever you want it.

  • How can I remove the page number from the first page of the document that is the cover page?

    How can I remove the page number from the first page of the document that is the cover page?

    If you open the Pages panel, (Window>Pages) you will see thumbnails of your master pages and your document pages. In new documents, there is usually a master called A-Master and one called None. If you drag the thumbnail of the None master onto the thumbnail of a document page, it will apply that master to that page. Presumably, you have made your page numbers on A-Master, so this will usually do the trick. If you have elements on A-Master that you need on the first page, but just not the page number, you can duplicate A-Master (which, by default will give you B-Master, but you can change the names if you like) and remove the page number on the duplicate and apply that to the document page.
    It might also be worth noting that you can apply master pages in the fly-out of the Pages panel. Go to the fly-out triangle and go down to Apply Master to Pages…, then select a master to apply and the range of pages (1-8 will give you all 8, 1, 3, 5, 7 will be the odds, 1-3, 4, 6-8 if you want continuous ranges and individual pages).

  • Calling a procedure from an OAF page through a button in the screen

    problem: calling a procedure from an OAF page through a button in the screen

    CREATE OR REPLACE procedure APPS.xx_delete_dept_prc(p_id in number)
    as
    begin
    delete from xx_training_dept_tbl where td_dept_id=p_id;
    commit;
    end;
    2.     create image button for delete
    3.     set the following property to this button:
    action type : fire action
    event :DeleteDept
    parameter :
    name: DEptIdParam value: ${oa.XxTrainingDeptVO1.TdDeptId}
    4.     create Co and writing the following code on process form request
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    String actionInscreen=pageContext.getParameter(EVENT_PARAM);
    if ("deleteDept".equals(actionInscreen))
    String deptidparam=pageContext.getParameter("DeptIdParam");
    Serializable [] s={deptidparam};
    Class [] c={deptidparam.getClass()};
    OAApplicationModule am=pageContext.getApplicationModule(webBean);
    am.invokeMethod("deleteDept",s,c);
    throw new OAException("delete completed",OAException.INFORMATION);
    5.     create AM and writing the following code
    public void deleteDept(String deptid) {
    XxTrainingDeptVOImpl deptview= getXxTrainingDeptVO1();
    deptview.deleteDept(deptid); }
    6.create VO and writing the following code in view object class
    public void deleteDept(String deptid
    System.out.println("Dept ID =" +deptid);
    String s = "call xx_delete_dept_prc(:1)"; // :1 is the number of parameter to pass it to procedure
    CallableStatement cs =trx.createCallableStatement(s,1); // 1 number of record to fetch but delete always delete 1 row
    try
    cs.setString(1,deptid); // the name of the first parameter
    cs.execute();
    cs.close();
    catch (SQLException e)
    e.printStackTrace();
    }

  • How do I save documents from the new Pages into a Word Document

    How do I save documents from the new Pages into a Word Document?

    Thank you so much - so simple!  I had been using the 'share' option (worked in old Pages) and only had icloud or email as options.  I have to attach word documents to emails to send to work. I don't want to use icloud because it's too public and I don't trust it.  Also, you have to be able to access the internet and I need word documents on my USB stick for work where there's no internet.
    I love my Mac but I do wish Apple would remember those of us living in less-than-perfect computer-land.
    Thanks again
    Lindsay

  • How to determine if coming from the Error Page?

    Version 4.1.1.00.23
    Hello,
    I have a manually created tabbed form with a collection.
    I've added a validation and set the error message to display on the Error Page to preserve the information entered into the form.
    One of the Select Lists is a cascading list. That list does not populate when returning from the Error Page.  The parent list is populated and does show the value selected before the error was thrown. It's just the list that is based on the parent that isn't populated.
    If I refresh the page the Select Lists are reset and I can access the values normally.
    So, what I think I want to do (and I'm not sure here) is to refresh the page when returning from the Error Page.
    How can I determine if I'm coming back from the Error Page?
    Is there a better solution?
    Please let me know if this isn't clear or there are questions.
    Thanks,
    Joe

    Hello,
    I'm hoping someone can help me with this.
    Thanks,
    Joe

Maybe you are looking for

  • ACTIONS ON ALV REPORT FOR CHECKBOX?

    hi All, i have to display ALVreport with one of the columns has checkbox.whenever user presses any checkbox,in repected row values have to be validated and updated in DataBase. My First Doubt is,How can i get the column of checkBoxes in ALV Report.?

  • Assign logical systems

    hi, why we have to assign client to logical system

  • Change date on PES8 Organizer and file properties

    Hi, I change the date of the vue in the metadata of a photo with PES8 Organizer and update it with the option in the "file" menu (write the.... and properties in the photo). The problem is : The date in the properties (right clic on windows on the ph

  • TiBook G4 400 - Continuous Freezing

    Hi Everyone, I recently acquired a 2nd hand G4 400 TiBook, I have found that it has a freeze problem, when I first got it I did a fresh install of tiger, all seemed fine, the reboots began to fail, now I find that I cannot get to the desktop at all,

  • Excpetion "You did not specify the transaction currency burden amount".

    Hi, When I am running "PRC: Interface Supplier Costs" then its firing another Program i.e., "AUD: Supplier Costs Interface Audit". In the second Program's output I am getting a message "You did not specify the transaction currency burden amount". I c