Sending emails for each record from tabular form

I currently have a requirements management tabular form that used to update or set job requirements inactive and/or covered.
We're a staffing agency and have salesmen across the country that will use this tabular form to quickly manage their requirements to mark them as covered or inactive if the position has been filled.
The multi-row update works fine since the form was built using the wizard, but I need to be able to send out an email for each record that's been marked as covered in the tabular form.
How can this be accomplished?
I'm running Oracle 12c and Apex 4.2.0 on a windows 2008 R2 server.
Thanks again.

Greg,
I took a different approach from what I originally suggested.  Since the tabular form is displaying only reqs that eligible to be covered, I chose to construct a process that would read the database after the reqs table was updated.  The code should find recent reqs covered by the salesman and then send out an email for each covered req.
Since I cannot see the data structure of your reqs table, I guessed the data type and size for the local variables in the DECLARE section, you many need to adjust these.
Give this code a shot and let's see where we get.  By the way, the naming conventions of your database are in need of naming standards.
The process needs to occur After Submit and after the Automatic Row Processing (DML) process that is updating the reqs table.  Make sure that the process sequence number is greater than the Automatic Row Processing (DML) sequence number.
DECLARE
   l_id           NUMBER;
   l_index        NUMBER;
   l_vc_arr2      apex_application_global.vc_arr2;
   lc_message     VARCHAR2 (4000);
   l_pkey         NUMBER;
   l_date_wrote   DATE;
   l_sales        VARCHAR2 (100);
   l_client       VARCHAR2 (100);
   l_job          VARCHAR2 (100);
   l_1or2         VARCHAR2 (100);
   l_rate         NUMBER;
   l_notes        VARCHAR2 (4000);
BEGIN
   FOR c1
      -- Retrieve reqs primary key that have been covered
      -- in the last 2 seconds by the salesman
   IN (SELECT pkey
         INTO l_pkey
         FROM reqs
        WHERE     SYSDATE < (date_wrote + 1 / 46200)
              AND active = 'Active'
              AND reqs.sales = :p12_sales
              AND covered IS NOT NULL)
   -- Send an email for each req that has been covered
   LOOP
      SELECT c1.date_wrote,
             c1.sales,
             c1.client,
             c1.job,
             c1.notes,
             c1.who,
             c1.1or2,
             c1.rate
        INTO l_date_wrote,
             l_sales,
             l_client,
             l_job,
             l_notes,
             l_who,
             l_1or2,
             l_rate
        FROM reqs
       WHERE pkey = l_pkey;
      lc_message := 'Date Written   :' || l_date_wrote || CHR (10);
      lc_message := lc_message || 'Sales          :' || l_sales || CHR (10);
      lc_message := lc_message || 'Client         :' || l_client || CHR (10);
      lc_message := lc_message || 'Position       :' || l_job || CHR (10);
      lc_message := lc_message || '#1 or #2       :' || l_1or2 || CHR (10);
      lc_message := lc_message || 'Rate           :' || l_rate || CHR (10);
      lc_message := lc_message || 'Notes      :' || l_notes || CHR (10);
      l_id :=
         apex_mail.send (
            p_to     => '[email protected]',
            p_from   => 'DO_NOT_REPLY@REQS',
            p_subj   =>    ''
                        || l_who
                        || ' Has Covered '
                        || l_job
                        || ' at '
                        || l_client
                        || CHR (10),
            p_body   => lc_message);
      COMMIT;
      apex_mail.push_queue ();
   END LOOP;
END;
Jeff

Similar Messages

  • Did iTunes send email for us to complete new form to validate account?

    Received an email dear iTunes customer you have 48 hrs to validate account. Click link and a form comes up wanting us to complete all personal info, credit card # and cvs #....

    What he said!
    Here's more of the same : https://discussions.apple.com/message/24132205#24132205

  • SSRS 2008 R2 - Separate report for Each record?

    Hi,
    How do I create new pdf reports for each records from a table? The pdf files should be named as customerid.pdf and needs to be delivered in email or share path? 
    Each record has enough content for 5 page of pdf report.
    How do we achieve this?
    Thanks
    Raj

    You can create a data driven subscription to loop through records in the table and create pdf based on number of customerid.
    Have a look at this for DD subscriptions :
    http://msdn.microsoft.com/en-us/library/ms169673.aspx
    Kind Regards, Vikram Kansal Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker

  • Create single message in receiving side for each record in the sender file

    Dear Experts,
    My Interface is from FILE to MQ (JMS)..
    I have a specific requirement in my project, I have multiple files in sender directory ( /tmp)
    Ex: FILE_20090202.TXT
    FILE_20090203.TXT
    FILE_20090204.TXT
    FILE_20090205.TXT
    And each file has couple of records just shown below:
    ABC   123     WER    SER
    BCD   345     WEDR    SER
    CDE   567     GHTE   DDGG u2026. Etc..
    I have to process all the files at a time ( may be I can use file masking by FILE*.txt) , one message has to be created in MQ for each record of the file..
    Ex:
    Message 1: ABC   123     WER    SER
    Message 2: BCD   345     WEDR    SER
    Message 3: CDE   567     GHTE   DDGG
    Valuable inputs are appiciated !!
    Cheers,
    Kumar

    As already suggested, multi-mapping can be used
    You need to set target root node occurrence to unbounded and map root node accordingly
    you will have to use enhanced interface determinaion
    For detail refer:
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

  • To create 5 different files in target for each record in the sender file

    Hi SapAll,
    i have got a a requirement where pi need to create 5 different files with data of each record from the sender side.
    Its an file to file scenario
    suppose there are 5 rows in a file , then in target side i need to create 5 diff with each one record in it.
    Can we do it without using 3 comm channels
    Thanks&regards,
    Sai

    Hey,
    As a more generic solution, can you try using MultiMapping. It is supposed to generate multiple instances of messages on receiver side.
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    You just need to put a simple logic in Message Mapping to generate new Node for every occurence of source field.
    Thanks
    Aamir

  • From XML (import) for each record automatic new page creation?

    Hello,
    I'm playing around with XML.
    Can someone tell me where to look and help me?
    I load variable data via XML.
    Example content xml:
    <pages>
         <page>
             <id>1</id>
             <article>title page 1</article>
             <info>Info page 1</info>
             <price>price page 1</price>
         </page>
         <page>
             <id>2</id>
             <article>title page 2</article>
             <info>Info page 2</info>
             <price>price page 2</price>
         </page>
         <page>
             <id>3</id>
             <article>title page 3</article>
             <info>Info page 3</info>
             <price>price page 3</price>
         </page>
    </pages>
    I have 1 page classified (ie 3 text boxes). The idea is that for each record in the xml (in this case 1, 2 and 3) a new page is created (Qua layout identical to the page that I had prepared, but with the corresponding data in each box)
    How do I do this?
    Thanks!

    If you need to keep the three parts of your page in separate text frames, you are probably out of luck.
    I can't tell from your question whether you know how to tag frames and import XML content into them. If you don't, the manual is fairly clear on it. However, it states more than once that "InDesign flows merged XML content into existing frames only."  That means that it won't add frames or pages for you -- you can only load XML into tagged frames on the first page and will have to add extra ones by hand.
    If you could rework your design so that all the elements could be accommodated in a single text frame, using paragraph styles to keep them apart, you could just import the XML and map tags to styles, then drag it into a frame on the first pages. If your article style was set to start in a new frame,  everything but the first would go into overset text, which you could deal with in the usual way -- shift-click on the in port of a new frame and InDesign will add the pages you need.

  • Send Email after Insert Record

    I am by no means a coder so please be gental. I have a
    contact page that I have insert into a database, but I am also
    trying to send an email after it inserts into the db. But I cant
    seem how to make it work. Dreamweaver wrote the code for the insert
    and I am not sure were to go from here. I am using asp vb.
    thnaks

    On 11 Mar 2007 in macromedia.dreamweaver.appdev, jeremy12345
    wrote:
    > I am by no means a coder so please be gental. I have a
    contact page
    > that I have insert into a database, but I am also trying
    to send an
    > email after it inserts into the db. But I cant seem how
    to make it
    > work. Dreamweaver wrote the code for the insert and I am
    not sure
    > were to go from here. I am using asp vb.
    See all those Request.Form("nameSuffix") and similar? They
    contain the
    information posted from the form, and are still available to
    you after
    the database has been populated.
    What you need to do:
    - Find out from your hosting provider what mail component(s)
    are
    available on your server.
    - Create an email using the information from the form:
    <%
    DIM MyEMailBody, MyEMail
    MyEMailBody = "Name: " & Request.Form("nameFirst") &
    MyEMailBody = MyEMailBody & Request.Form("nameMiddle")
    MyEMailBody = MyEMailBody & Request.Form("nameLast")
    & VBCrLf
    ' VBCrLf is a CarriageReturn/LineFeed (ie a new line)
    ' Details Below will vary depending on the mailer component
    MyEMail = CreateObject("CDONTS.NewMail")
    MyEMail.From = "[email protected]"
    MyEMail.To = "[email protected]"
    MyEMail.Subject = "Inserted Record"
    MyEMail.Body = MyEMailBody
    ' Send the email
    MyEMail.Send
    ' Get rid of the email on the server
    SET MyEMail = nothing
    %>
    Joe Makowiec
    http://makowiec.net/
    Email:
    http://makowiec.net/email.php

  • Mapping issue: FCC: Idoc for each record in file

    Hi,
    I have file to Idoc scenario.
    I receive csv file with multiple records.
    The requirement is to create an Idoc for each record.
    For eg.
    source file
    A1,B1,C1
    A2,B2,C2
    A3,B3,C3
    After FCC
    <MT>
    <TRANS>
    <ROW>
    <A>A1</A>
    <B>B1</B>
    <C>C1</C>
    </ROW>
    <ROW>
    <A>A2</A>
    <B>B2</B>
    <C>C2</C>
    </ROW>
    <ROW>
    <A>A3</A>
    <B>B3</B>
    <C>C3</C>
    </ROW>
    </TRANS>
    <MT>
    I have first tested it with only 1 record to test end to end connectivity. It works as expected and Idoc is posted to target system.
    Now when I am trying to send multiple records, I am getting some issues.
    Below are the steps that I have taken to process multiple records:
    1. Changed the cardinality of ROW (child of RecordSet) from 1 to Unbounded.
    2. Changed the occurance of Idoc to Unbounded.
    3. Mapped ROW to Idoc root.
    I have tested the mapping in IR and it generates multiple IDOCs.
    When I send the test file, it fails with error Tag found instead of tag IDOC BEGIN=
    I can see the xml message created with multiple ROWs in XI by File adapter in sxmb_moni.
    When I do Test Configuration in ID, with the XML message extracted from sxmbmoni, the result that I got was:_
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1></ns0:Message1></ns0:Messages>
    This means that idoc was not created while mapping.
    But the same sample message works OK in IR!
    Pls help where I have missed.
    Regards,
    Anirudh.

    Sudhir,
    Thanks for your response.
    FCC is working fine. I have taken the XML message in XI created after FCC from csv sample message.
    I have tested this message in IR by placing it between
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
    </ns0:Message1>
    </ns0:Message>
    It is working fine and Idocs are created in mapping in IR.
    But the same sample message is creating below output ID!
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1></ns0:Message1></ns0:Messages>
    Regards,
    Anirudh.

  • How to have a unique value for each record??

    could any 1 help me out in this...
    I want to have a column name 'Order No' which should be unique.
    How to generate a unique value for each record.??

    could any 1 help me out in this...
    I want to have a column name 'Order No' which should be unique.
    How to generate a unique value for each record.?? If you are using SQL PLUS to create the table try something like
    this:
    CREATE TABLE ORDER_TEST (
    ORD_NO NUMBER (8) NOT NULL PRIMARY KEY,
    ORDERDATE DATE,
    CUSTID NUMBER (8) NOT NULL,
    SHIPDATE DATE,
    TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
    (TOTAL >= 0),
    CONSTRAINT ORD_FOREIGN_KEY FOREIGN KEY (CUSTID) REFERENCES
    CUSTOMER (CUSTID),
    CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
    -- or a simpler table example
    DROP TABLE ORDER_TEST;
    CREATE TABLE ORDER_TEST (
    ORD_NO NUMBER (8),
    ORDERDATE DATE,
    CUSTID NUMBER (8) NOT NULL,
    SHIPDATE DATE,
    TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
    (TOTAL >= 0),
    CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
    note: ORD_NO can also be a primary key
    If you are doing the INSERT during runtime from a form first
    create a sequence in SQL PLUS to handle the ORD_NO value:
    Create SEQUENCE ORDERNO_UNIQUEVAL_sqnc
    START WITH 000001
    NOMAXVALUE
    NOCACHE;
    and reference it as the ORD_NO parameter in your INSERT
    statement:
    ORDERNO_UNIQUEVAL_sqnc.NEXTVAL
    note: to maintain data integrity you must use the sequence
    everytime you insert a new order to table. To start a new
    sequence drop the sequence and re-create it with whatever "START
    WITH" value you want.
    Hope this helps
    Kevin

  • Insert records from user form to multiple tables in same database

    Hi Experts, I need your help. I have a form that has multiple text fields that I need to insert the records to their each respective table. For example: The first name field needs to go the the name table, address goes to a seperate table, phone goes to a seperate table and so on.
    Is this possible to do?
    Thanks Much
    Sham

    The same for ASP, JSP or PHP.  Just the code syntax is different for each language.  Are you using MySQL, Access or ?
    In any case, create the three recordsets on the database and use insert queries.  If you don't know what one is, google insert query and you will see the syntax. 
    Here is a good example out on the web
    http://www.stardeveloper.com/articles/display.html?article=2000032601&page=1
    In your case you would get the values for the inserts from the form data and only need to open the database connection once.
    Good luck.
    Walt
    B & B Photography

  • Where can I find the user key precedence hierarchy for each record type?

    Example: I want to update contact records through the CRMOD web service API.
    So I'm looking at the "Oracle Web Services On Demand Guide, Version 6.0 (released August 2010)", page 316, and it lists 3 user keys for Contact.wsdl v2.0 in the following order:
    1. FirstName and LastName
    2. Id
    3. ExternalSystemId
    From what I can see, this order does not seem to reflect the precedence hierarchy of these 3 user keys.
    I've send in a test update where I supplied a FN, LN, and EUID, ... and the contact that matched the EUID got updated.
    (I'm glad it did, because EUID really needs to take precedence over FN+LN, otherwise you could never change a contact's last name without knowing the contact's Row Id.)
    Does anyone know where I can find the precedence hierarchy for each record type's user keys (other than doing the obvious and time consuming "try+error")?

    Hi,
    we experienced similar problems with the account object and asked the oracle support about this. This was their answer:
    "[...] thank you for contacting CRM On Demand Customer Care. Regarding your question, please note the below: when perfoming a query, the user key fields are looked for in this order: - Row id - External System Id - AccountName and Location. Basically, the search will be performed by AccountName and Location only when the other fields are missing. This is an expected behavior because, the Row Id is the strongest filter as it is always unique. The external system Id comes second, as it is supposed to be unique in another system."
    So, I guess the order is always
    1) Row Id
    2) External System Id
    3) specific field combinations...
    kind regards
    Kai
    Edited by: Kai Hartmann on 28.04.2011 07:10

  • Unable to send email to the users from Project Server Workflow

    Hello all,
    I am facing issues in sending emails to the users from the workflow in SharePoint Designer 2013.
    I am trying to send emails to valid users in a Project server 2013 Workflow by Email action.
    I have set up the SMTP server successfully, I have configured SMTP server successfully in IIS manager 6.0
    I have configured the outgoing e-mail settings in Central Administration successfully,
    I have configured the SMTP email settings for my web app in IIS manager as well.
    I have configured and synced the User Profile App with the eMail addresses from Active Directory as well.
    I have configured the Alerts and Reminders in Operational Policies of PWA settings as well.
    I can send the emails to the users successfully through Powershell.
    But when I am trying to Start a Task Process with a user in the workflow, the task process starts but it never sent an email notification. So I tested by using the Action Email, that also the user is unable to receive any email. But the Workflow is not giving
    any error also. The email sending is successful, but the user is unable to receive it. The workflow succeeds to next phase without any errors.
    So to cross verify I tried 'Alert Me' option on a list, but that also is not sending(or might be sending but the user is not receiving) the mail.
    What else should I do to solve this issue.
    Please help me.
    Thanks,
    Shanky

    Hello Paul,
    I tried editing the PWA instance as you said, but that also didn't help :(
    I even restarted the Project Server Service, but nothing is changed. 
    I tried creating a new workflow for a List and used send email there, but that also is not sending the mail :(
    How do I check where the issue is from ? I mean, whether the workflow is sending the mail and the mail server is not receiving? or whether the workflow is not sending the mail itself? how do I check this? Is there any way to log these details?
    Please help me regarding this issue, I am totally clueless how to proceed.
    Thanks,
    shanky

  • Table cntrol field to be display/Change only For each record

    Hi all,
    How to set a particular Field in table control either as display only or
    change only for <b>each row</b> based on certain condition.I need to set this property for each record in table control not for the entire coloumn?.I know the procedure for setting up an entire coloumn in table control either as diplay or change only using <b>Loop at screen</b> statement.
    Conditions:
    If Material is batch managed:
    itab-batch field has to be <b>Display only</b> mode.
    if material is not batch managed:
    itab-batch field has to be <b>change mode</b>.
    <b>O/p of Table Control :</b>
    Material     Batch
    1000         Display only
    2000        Change only
    8000        Change only
    3500        Display only
    3600        Display only

    Hi Ravi,
              Thanks for your reply.I have put the code as u said. It is modifying the whole coloumn insted of  modifying Current row of the coloumn.
    I have tried to modify the screen property using  Table control attributes (TC-COLS).The following commented code is that logic.Even that also doing the same thing.Can yoy please tell me how to do it.
    MODULE tc_get_lines OUTPUT.
    LOOP AT SCREEN.
        IF screen-name = 'X_ZPINV-CHARG'.
          IF fg_batch = ' '.
            screen-input = 0.
          ELSE.
            screen-input = 1.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    LOOP AT tc-cols INTO tc_wa
      WHERE screen-name = 'X_ZPINV-CHARG'.
       IF x_zpinv-matnr IS NOT INITIAL.
         CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
           EXPORTING
             input  = x_zpinv-matnr
           IMPORTING
             output = v_matnr.
         SELECT SINGLE * FROM marc WHERE matnr = v_matnr
         AND werks = w_plant.
         IF marc-xchar IS INITIAL.
           tc_wa-screen-input = 0.
         ELSE.
           tc_wa-screen-input = 1.
         ENDIF.
         MODIFY tc-cols FROM tc_wa INDEX sy-tabix."    transporting screen-input
       ENDIF.
    ENDLOOP.
    ENDMODULE.                    "TC_GET_LINES OUTPUT

  • Graphical mapping question - need to create 2 nodes for each record

    The mapping is from flat to nested, i.e. flat file to FIDCC2 idoc. Each record has to go to 2 repeated IDoc segments, each one with different posting key. Right now, I have it working for each record to a segment(for one segment) by using splitByValue (value change). How can I repeat the creation of another but with slightly different constant.
    Also, how do I add line numbers? I remember seeing a posting on this a while ago - cannot locate it.
    Will be Rewarded WELL.
    Thanks,
    Pam

    Hi, Pam
    Using the following example to store it as global variable
    SetParameter from GloabalContainer:
    container.getGlobalContainer ().setParameter ("COUNTER", "0");
    GetParameter from GloabalContainer:
    String myCounter = (String) container.getGlobalContainer().getParameter ("COUNTER");
    When you map to your constant, store it in global variable, then you map other field, get current global variable, check its value, based on the value, you do proper mapping.
    Hope it helps
    Liang

  • How to append parameter with URL for each record in table control?

    Hi,
    I have one table control which contains 5 columns.
    (tripno, startdate, destination, reason, activities)
    In 5th column, i need to display URL for each record.
    for ex:
    www.abc.com/test?tripno=1
    www.abc.com/test?tripno=2
    www.abc.com/test?tripno=3
    when user clicks a particular hyperlink, it navigates to another page/component thru URL with one key field(tripno) to retrieve related records in next page.
    1) i am not able to assign tripno to each record. when i assign tripno, its taking the last value which i assigned. ie. tripno=3 only.
    How to assign URL to Reference field of LINK_TO_URL element at run time?
    OR
    2) we can do like this.
    Simply assign url to reach record without key field.
    www.abc.com/test
    www.abc.com/test
    www.abc.com/test
    when user clicks a particular link, we can assign corresponding key field to the URL.
    Where should i write this event? Bcoz, LINK_TO_URL doesnot have event.
    how to do?

    Hi MOg.
    Not sure whether I understand you .. but in the 5th column you want to have the reference URL. Is this the activities columen from you example?
    Nevertheless, you need a attribute (String) in your context node which contains the URL. Bind this to the reference filed of linktourl. If you can not extend the structure you can create a sub node (cardinality 1:1)  which contains the refernce attribute.
    Then loop over all elements and concatenate www.abc.com/test?tripno= with the tripno of the current element into the reference field.
    Hope tis helps,
    Sascha.
    Bind the

Maybe you are looking for

  • Display array data in one row

    Hello --- I have an array of data, I would like to be displayed all the data in one row.<tr></tr>, how to do this? If I use <h:table> <column></column></h:table>, it will display different rows. Thanks! Ben

  • Help required on jdbc 2.0 driver for oracle 8.0.4

    Hi all, I wanted to know whether any oracle/Third party jdbc 2.0 driver is available to connect to oracle 8.0.4 enterprise server. Any help would be kindly appreciated.... Regards, Sudhakar

  • Steps to create a rule

    Hi Experts,    can any one please help me with creation of rules in payroll. step by step procedure will be appriciated and complex once will be really great. thanks.

  • Mail not letting me add new mailbox

    For some reason I don't understand Mail just recently stopped letting me add mailboxes. When I ctrl-click on an existing mailbox (or use the menu) to add a mailbox under it, it plays a "clonk" sound and that's is. No error message of any kind. I've b

  • Ical automatically starts when I boot up but I don't have it set to autostart. Why ?

    ical automatically starts when I boot. I have nothing set to auto start. Any ideas?