JS alert in PL/SQL on Update

Hello there,
I'm trying to make one of my forms work a bit better by adding a javascript alert message to a conditional PL/SQL statement on the Update action of a submit button, rather than sending the user to an error page.
Here's the code that I'm currently using:
declare
l_ordr_date DATE;
l_ship_date DATE;
l_url VARCHAR2(250);
begin
l_ordr_date := p_session.get_value_as_DATE(
p_block_name => 'DEFAULT',
p_attribute_name => 'A_DATE_OF_ORDER');
l_ship_date := p_session.get_value_as_DATE(
p_block_name => 'DEFAULT',
p_attribute_name => 'A_DATE_SHIPPED');
if l_ship_date >= l_ordr_date then
     doUpdate;
     l_url := 'portal30.home';     
     portal30.wwa_app_module.set_target(l_url, 'CALL');
else
     l_url := 'POS.INVALID_SHIPDATE_DYN.show';
     portal30.wwa_app_module.set_target(l_url, 'CALL');
end if;
end;
Within the 'else' actions, I'd like to remove what I have and just have an alert window open to tell the user to fix the problem. I've tried to use the htp.p tag, but no luck.
Any help/suggestions would be greatly appreciated.
Thx!

Hi Joshua,
I do not think that you can put the javascript in the else section where you wish it to be as that is the code which will get executed at the server side ans therefore there will be no use of javascript there.
I will explain you how to use javascript in the form and then I'll explain you what I ment by "l_form variable" in my earlier code.
see there are two aspect of javascripting
1)
You should be able to write javascript into the form.For doing that what you can do is that write a simple javascript like this,
in the additional pl/sql block "before displaying the ...".
htp.p('
<script>
function myFunc()
alert("hello world");
</script>
2)You should bea ble to invoke this function based on some event say button click.For that yo uhave to include a call like this from the button (or any event for that matter).
myFunc();return;
Now second part for you question.
"I don't know what the "var l_form = ele.form;" is supposed to do nor do I know why you have 2 extra "}"s below that " ?
Those 2 } were a mistake as it was just a code to give u a feeling of how to put javascript in the form.The purpose of the var l_form =ele.form;
was to get the form object and then iterate along it to get the value of your text fields(or any element) from which you wish to get the values for comparsion.
Now after getting the form object what you have to do is something like this.
//this is your logical block for javascript.
var l_DATE_OF_ORDER;
var l_DATE_SHIPPED;
for (var i = 0; i < l_form.length ; i++){  //itereate trough all the elements.
if (l_form.elements.name == "<YOUR FORN NAME>.DEFAULT.A_DATE_OF_ORDER.01"){
l_DATE_OF_ORDER = l_form.elements[i].value;
if (l_form.elements[i].name == "<YOUR FORN NAME>.DEFAULT.A_DATE_SHIPPED.01"){
l_DATE_SHIPPED = l_form.elements[i].value;
//once you get both the values compare and get the control back into the
return;//do not submit the form and let the user fill the new date then if the condition is full fill then only let it be submitted for the update.
Please aply this as per your actual requirement.
Hope this helps.
rahul

Similar Messages

  • I have a question regarding my txt/alert tones. I recently updated my iPhone 5's software without first backing it up on iCloud or my computer (oops). After my phone finished updating, i lost the new ringtones and txt/alert tones i had bought.

    I have a question regarding my txt/alert tones. I recently updated my iPhone 5's software without first backing it up on iCloud or my computer (oops). After my phone finished updating, i lost the new ringtones and txt/alert tones i had bought. I connected my iPhone to my computer and sync'd it hoping that it could download my purchases from the itunes store and then put them back on to my phone but no such luck. When i look at my iphone on my computer and look at tones, they do not show up at all. However, if i click on the "On This iPhone" tab and click on "Tones" the deleted ringtones and altert tones show up...they are just grey'd out and have a dotted circle to the left of them. I also tried to go to the iTunes store on my phone and redownload them and it tells me that i have already purchased this ringtone and asks me if i want to buy it again. I press Cancel. I know when i do that with music it would usually let me redownload the song without buying it again but it wont let me with the ringtones...so how do i get them back? any help would be greatly appreicated

    Greetings,
    I've never seen this issue, and I handle many iPads, of all versions. WiFi issues are generally local to the WiFi router - they are not all of the same quality, range, immunity to interference, etc. You have distance, building construction, and the biggie - interference.
    At home, I use Apple routers, and have no issues with any of my WiFi enabled devices, computers, mobile devices, etc - even the lowly PeeCees. I have locations where I have Juniper Networks, as well as Aruba, and a few Netgears - all of them work as they should.
    The cheaper routers, Linksys, D-Link, Seimens home units, and many other no name devices have caused issues of various kinds, and even connectivity.
    I have no idea what Starbucks uses, but I always have a good connection, and I go there nearly every morning and get some work done, as well as play.
    You could try changing channels, 2.4 to 5 Gigs, changing locations of the router. I have had to do all of these at one time or another over the many years that I have been a Network Engineer.
    Good Luck - Cheers,
    M.

  • How to create event alert for particular column get updated

    Hi every one.... plz help me
    How to create oracle event alert when particular column is update. plz help me.... Acutually i need email alert when ever list price for an item column in pricing table get updated+... plz. Its urgent.

    Oracle Event alert is based on update of specific table and not on specific column in table.
    However you can create a trgigger on table which is based on updat of column. And in this trigger you can send a mail using plsql.
    HTH

  • How to get changes of a custom PL/SQL package updated in ISG?

    Hi All,
    I need some help on how to change a custom PL/SQL package in ISG integration repository:
    I already uploaded my custom PL/SQL package to the integration repositoy some time ago. Now I have made some changes to PL/SQL record/table types defined in the package (added some fields and removed some others). These changed record/table types are used by a procedure I already uploaded to the integration repository. When regenerating the WSDL for my PL/SQL package in integration repository I get an error that the wrapper for respective procedure can't be found. When checking up the SQL types that were automatically generated (by JPublisher) for corresponding PL/SQL types, these generated SQL types are invalid...
    So it seems that in one case JPublisher generated an empty SQL type (with no attributes). In another case JPublisher generated the SQL type with old attribute list, so it didn't adopt the changes of corresponding PL/SQL type in the package...
    Can anybody tell me how to get the changes of a cusotm PL/SQL package updated in ISG? Or is there any possibility to first remove a whole PL/SQL package from the ISG integration repository (and getting rid of all old automatically generated SQL types), so that I can newly upload my PL/SQL package afterwards?
    Thanks
    Konrad
    Edited by: Konrad on 24.10.2011 10:51

    Thanks Daniel, for your reply...
    (-> for info: I'm a colleague of Konrad...)
    Yes, we used a higher version number - and the upload of iLDT file works fine...
    But, the problem occured when generating the WSDL...
    However, I think we have found an approach of how to get the changes of a custom PL/SQL package updated correctly in ISG:
    1. Save a copy of PL/SQL package and then delete it in the database
    2. Regenerate the WSDL for PL/SQL package in ISG (seems that all atutomatically generated JPub wrappers and SQL types are also deleted)
    3. Restart all processes
    4. Create the changed version of PL/SQL package in the database again
    5. upload of iLDT
    6. Regenerate the WSDL for PL/SQL package in ISG
    Best Regards
    Carolin

  • SQL to update two columns in TABLE2 from TABLE1

    I know this is a simple question for some of you, but I am new to SQLs, so please help...
    I have two tables TABLE1 & TABLE2 as below, both tables contains more then 50million records:
    SELECT * FROM TABLE1.
    ID                        BUS_FID                WORKID                  STATIONID                 
    28400000117234         245                    13461428.25           16520877.8            
    28400000117513         403                    13461428.25           16520877.8            
    28400000117533         423                    13461428.25           16520877.8            
    28400000117578         468                    13461428.25           16520877.8            
    28400000117582         472                    13461428.25           16520877.8            
    SELECT * FROM TABLE2.
    BUS_FID                    ID                 TRPELID                RELPOS                 WORKID                 STATIONID               
    114                    28400000117658         28400000035396         23.225                                                              
    115                    28400000117659         28400000035396         23.225                                                              
    116                    28400000117660         28400000035396         23.225                                                              
    117                    28400000117661         28400000035396         23.225                                                              
    118                    28400000117662         28400000035396         23.225                                                              
    119                    28400000117663         28400000035396         23.225                                                              
    120                    28400000117664         28400000035396         23.225                                                              
    121                    28400000117665         28400000035396         23.225                                                              
    122                    28400000117666         28400000035396         23.225                                                              
    123                    28400000117667         28400000035396         23.225                                                              
    124                    28400000117668         28400000035396         23.225                                                              
    125                    28400000117669         28400000035396         23.225                                                              
    126                    28400000117670         28400000035396         23.225    Now I tried to use following SQL to update WORKID & STATIONID columns in TABLE2 but failed. BUS_FID in both tables have been UNIQUE indexed and they can be used as primary keys to join these two tables.
    UPDATE (
      SELECT  p.WORKID px,
              p.STATIONID py,
              p.BUS_FID pid,
              temp.WORKID tempx,
              temp.STATIONID tempy,
              temp.BUS_FID tempid
        FROM  TABLE1 temp,
              TABLE2 p
        WHERE pid = tempid
      SET px = tempx,
          py = tempy;
    COMMIT;with above code, Oracle returned following errors:
    SQL Error: ORA-00904: "TEMPID": invalid identifier
    00904. 00000 -  "%s: invalid identifier"Can anyone help me to correct it? Thanks~~~
    BTW, both two tables contains over 50 million records. So, if you have a better SQL to perform the same task, please let me know!
    Appreciated your help at advance.

    Hi,
    984210 wrote:
    Tried to change to
    p.bus_fid = temp.bus_fidit start running.
    Can anyone please explain to me why this is happening? Thanks!!Column aliases (such as pid and tempid in your statement) can't be used in the same query in which they are defined (except in an ORDER BY clause). Elsewhere, you have to refer to the columns by their actual names.

  • How to set alert mail contain SQL text activities

    How to set alert mail contain SQL text activities.
    In "Notification Templates" topic have no Available Tags about sql text. Can I send mail alert with SQL text?

    it should be text/plain, for a complete list refer
    http://www.freeformatter.com/mime-types-list.html
    Regards.

  • Xi JDBC Adapter - Query SQL Statement & Update SQL Statement

    Hi!
    I configure the JDBC adapter sender (XI) to take data from Oracle database.
    I set the Query and Update SQL Statement in the Processing parameters of the communication channel in this way:
    Query SQL Statement :
    SELECT * FROM XI_TABLE WHERE STATUS = 'WAIT' ORDER BY ROW_NUM
    Update SQL Statement :
    UPDATE XI_TABLE SET STATUS = 'DONE', DATE = SYSDATE WHERE STATUS = 'WAIT'
    My question is :
    If a new record with the field STATUS = 'WAIT' is added to the table (xi_table) during the time between the execution of the query statement and the start of the update statement, what will happen to that record during the update?
    There is a way to avoid the update of that record? or to pass to the update statement only the record selected in the query statement?
    Please, may you give me some example?
    Thanks,
    Francesco

    hi,
    did you check "Isolation Level for Transaction"
    for the sender jdbc adapter?
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    michal

  • Execute SQL Task - UPDATE or Data Flow Data Conversion

    Good Morning folks,
    I want to know which is more fast to convert data type.
    I want to convert nvarchar(255) to datetime2,
    using t-sql (execute sql task)
    UPDATE TBL
    SET  FIELD1= CAST(FIELD1AS DATETIME2)
    GO
    or data conversion(data flow)
    Thank..

    Itz Shailesh, my t-sql have only UPDATE, not many UPDATES... so it's one batch, no 2,3,4... So.. it's Only one update.. ex: update table set field1 = cast(field1 as datetime2), field2 = cast(field2 as datetime2). not : update table set field = cast(field
    as datetime2) go    update table set field2 = cast(field2 as datetime2) go.... understand?
    Yeah, I understand that you have to update just 1 field. What I am saying, if you have to update millions of rows then you must update rows in batches ( lets say batch of 50k). This way you will only touch 50k rows at a time and not all rows from table.
    I see that your rows are less however I would still prefer the option of data conversion transformation over update statement.
    If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

  • Is there a way to remove installed updates from the App Store update window? I keep getting an alert that I have an update for Apple Remote Desktop. It says its installed, but the alert and the app keep showing up. Annoying!!

    Is there a way to remove installed updates from the App Store update window? I keep getting an alert that I have an update for Apple Remote Desktop. It says its installed, but the alert and the app keep showing up. Annoying!!

    Spotlight: How to re-index folders or volumes
              http://support.apple.com/kb/ht2409
    Mac App Store: Cannot update App Store purchases or updates do not seem available
              http://support.apple.com/kb/TS4236
    If re-indexing the spotlight doesn't fix it,we can try a few other tricks.

  • SQL Dev Update Center Down?

    Sue,
    Is the SQL Developer update center down? As of now the link:
    http://www.oracle.com/technology/software/products/sql/center.xml
    Doesn't return valid XML according to firefox...
    David Rolfe

    SQL Developer 1.2.1 Build MAIN 32.13 (Windows XP)
    We can't Update SQL Developer with Times Ten in-Memory DB Extension 1.2.1.1.0 :-((
    We did the same actions as described in tutorial
    http://www.oracle.com/technology/products/timesten/viewlets/tt703_sqldev_install_ext_viewlet_swf.html
    In addition to tutorial we have "Log In" window
    "To download Oracle Times Ten in-Memory Database Extension
    you must enter your Oracle Web Account user name and password"
    This window was not displayed in tutorial...
    We try to use three our OTN accounts and the result
    was the same - we was asked with "User name" and "Password"
    again, again, again and again,,, :-(
    Is it a bug or a feature?
    Mayby we didn't understand something or did something wrong?

  • IS IT POSSIBLE TO INVOKE AN ORACLE ALERT FROM PL\SQL ?

    Is it possible to invoke an Oracle Alert from PL\SQL and, if so, could you
    provide me with some references to any relevant notes that you may have on
    Metalink ?

    If you want to fire an Alert programatically the best way is to define a Business Event that will fire a notification. The Notification Emailer (if running) will convert this into an email.
    Notifications are preferable to Alerts because you can use HTML for formatting.

  • Page Life Expectancy Alert with value 0, after Updated SQL Server 2005/2008/2012 MP (6.4.0.0)

    After updating to the new SQL management pack in my lab I start to see Critical alerts for some of my SQL instances, but not all. When looking at the Alert Context the Value is 0. If I open SQL Management Studio and connect to the Instance and run a query
    to get the Page Life Expectancy, I get a high value like 494012, the query I use is:
    SELECT [object_name],
    [counter_name],
    [cntr_value]
    FROM sys.dm_os_performance_counters
    WHERE [object_name] LIKE '%Manager%'
    AND [counter_name] = 'Page life expectancy'
    Could this be an error in this Management Pack, perhaps I should disable this monitor? I also get the same for the monitor Buffer Cache Hit Ratio, also with a Value of 0 in Alert Context.

    Hi Aleksandr,
    That is what I do with the SQL query above.
    Using perfom gives the exact same result. When doing this on one of my servers I see the value is constantly increasing with 1 for each second, currently displaying a value of 335261.
    I think this has to do with improper permissions. I have assigned a dedicated domain user with sysadmin on SQL servers to all the SQL runas profiles. This I did before importing the new SQL Management Pack, and everything was fine. However, after installing
    this new Management Pack I started to see these alerts, and that the Alert Context had a value of 0. I also noticed that my Default Action account needed access to the SQL database. I did not verify it when I looked at it but I believe that the Default Action
    account did not have any rights to the instances where the alerts came from. So, perhaps some of the probing is not properly configured to use the right RunAs accounts.
    Anyways, I will look in to this a bit further when I have some more time... Posting back the results when I have.

  • Oracle Alert: Access before and after update values of a table column

    We have a requirement where a notification needs to be sent when 'END_DATE' attribute (column in a table X) is set, in an Oracle Applications form.
    I have defined an Event based Oracle Alert which fires 'On Update' of the table X.
    Could anyone please let me know as how to access the value of 'END_DATE' before and after update (i.e :new.END_DATE and :old.END_DATE) in the sql query of the alert.
    The need to use the before update and after update values of the attribute 'END_DATE' is that if we add the condition END_DATE is not null, the alert is sent even if any other attrbutes are updated in the Oracle form which is not the intended behavior.
    Appreciate any help.
    Thanks

    Hi
    use selectionlistener for your first table then add clientlistener and serverlistener so that you will get the rows on click in back bean.
    then get second table vo and and create and add row for that view object. add partial target to refresh your second table from back bean.
    on click of save call commit operation.

  • Dynamic sql and updating cursors

    hi to anyone,
    we use few temporary global tables which will be created on the fly if not present ( the reason is - they are not created by power designer ).
    addressing theses tables is only possible by using dynamic sql via "execute immediate" because they may not be known to the compiler as they are not created yet.
    Now I defined a cursor to walk through the table - using cursor reference "ref cursor". Using this cursor works, but i found no way using this cursor for update. i.e. declaring as .. for update of and later putting it into an execute immediate like " execute immediate 'update ' || w_temp_table || ' set f1 = :1, f2 = :2 where current of ' || w_cursor using w_1, w_2;" It doesnt work if I block this command using "begin / end".
    Does naybody know a solution ?
    thanks in advance
    wilko

    Thanks todd,
    my main purpose has been just using the dynamic cursor for update as I know that this is quite easy and also fast. I didnt concern about locking all rows I walk through. But you are right - at end you will use the most easy way. So what I did because of another cursor problem ( with analytical functions ) - I defined the temporary table before compiling and everything is much more convenient.
    thanks for help
    wilko

  • Is there a simple way to refresh a SQL Query (Updatable report) region

    I have a page in APex 4.1 that has many regions. I would like to be able to refresh a single region.
    Currently, I have the following
    Region (sql query updateable report).
    STATIC ID = LANDINGS
    in the region footer, I have:
    <script type="text/javascript">
    $s('P110_LANDINGS_REGION_ID','#REGION_STATIC_ID#');
    </script>
    P110_LANDINGS_REGION_ID is a hidden field.
    I use javascript to refresh....but it does not seem to be working. Previously, we had hard-coded the region id ( $a_report('1363338167540162011','1','100','100');) ...but that ID was somehow corrupted, which has lead me to the 'OMG...there must be an easier way!' lament.
    the javascript is:
    $a_report('P110_LANDINGS_REGION_ID','1','100','100');
    thanks!
    Karen
    ps. could I just directly reference the static id in my javascript...
    $a_report('LANDINGS','1','100','100');

    Karen,
    First off: please post code in &#123;code&#125;...&#123;code&#125; tags!
    function AddFavoriteSpecies()
    get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=favorite_species_collection',0);
    gReturn = get.get();
    rowCount = rowCount + parseInt(gReturn);
    pHMS_add = '&G_HMS_FLAG.';
    $a_report('1363338167540162011','1','100','100');
    //$a_report($x('P110_LANDINGS_ID').value,'1','15','15');the statement:
    $a_report('1363338167540162011','1','100','100'); works, but the statement $a_report($x('P110_LANDINGS_ID').value,'1','15','15'); does not.
    Can anyone help.
    I am assigning the page field P110_LANDINGS_ID in the footer of a region with a static id = LANDINGS.
    <script type="text/javascript">
    $s('P110_LANDINGS_ID','#REGION_STATIC_ID#');
    </script>
    Well, let's start by dumping $a_report. This is undocumented code, and it has long been replaced by triggering a refresh.
    Next, don't use $x(pNode).value to retrieve a value. Rather use $v(pNode) to do this.
    function AddFavoriteSpecies()
       get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=favorite_species_collection',0);
       gReturn = get.get();
       rowCount = rowCount + parseInt(gReturn);
       pHMS_add = '&G_HMS_FLAG.';
       //get the region id from the item
       //use it in a jQuery selector to get the region
       //trigger the refresh event on this object
       $("#" + $v('P110_LANDINGS_ID')).trigger('apexrefresh');
    }Now if you want to make sure that P110_LANDINGS_ID contains a value, add an alert with its value before you use it.
    alert('P110_LANDINGS_ID value: '+$v('P110_LANDINGS_ID'))

Maybe you are looking for

  • How to convert Web app into a channel?

    To whom it may concern, Does anyone know how to convert a Web app into a channel inside the Portal server 6.0? I developed the web app and tried to create a provider and a channel for it, but the Portal server did not recognize the WEB-INF folder and

  • Application not listed in iOS- Settings- "Use Cellular data for"

    Hello, When i install the IPA of my application, it is not listed in the "Use Cellular data for" list in Cellular data Settings. I would like to know how to add my application to this list. Also, is it possible to get the Enabled/Disabled status of t

  • Using SD Card or ExpressCard for Scratch Disk?

    On my old laptop, I know that the patch for Photoshop CS3 allowed using scratch disks on removable media. But on my new computer, I've updated all the software and cannot get these drives to show in the list of scratch disks. The expresscard and SD r

  • Dual 30" Displays

    Hi all, Is anyone using a G5 with dual 30" ACD's? If so, what video card(s) are you using, and how is the monitor response? Thanks, Chad

  • No "Windows 8 touch" button in any version of FF.

    I use Asus Transformer T100TA with a touchscreen and Windows 8.1 on board. I really want to try Metro mode for Firefox, but I can't find the necessary button in the menu as described in the article: https://support.mozilla.org/en-US/kb/quick-guide-fi