Help needed regarding insert a record

Hi,
I have designed a page to insert employee records.
After pressing the "Apply" button is giving the following error :
The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example). If the browser's navigation buttons were not used, this error could have been caused by coding mistakes in application code. Please check Supporting the Browser Back Button developer guide - View Object Primary Key Comparison section to review the primary causes of this error and correct the coding mistakes.
Cause:
The view object CreateAM.EMP_Create_VO1 contained no record. The displayed records may have been deleted, or the current record for the view object may not have been properly initialized.
Please help me in resolving this error.
Thanks,
Swaroop

Hi shiv,
I have created a EO attached it to EMP table. Created VO, atteched to that EO.
and My controller code is :
|
package oracle.apps.OPI.setup.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.webui.OADialogPage;
import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
import oracle.apps.fnd.framework.webui.OADialogPage;
import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
import oracle.jbo.domain.Number;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
* Controller for ...
public class CreateCO extends OAControllerImpl
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
// Always call this first.
super.processRequest(pageContext, webBean);
// If isBackNavigationFired = false, we're here after a valid navigation
// (the user selected the Create Empoyee button) and we should proceed
// normally and initialize a new employee.
if (!pageContext.isBackNavigationFired(false))
// We indicate that we are starting the create transaction (this
// is used to ensure correct Back button behavior).
TransactionUnitHelper.startTransactionUnit(pageContext, "empCreateTxn");
// This test ensures that we don't try to create a new employee if
// we had a JVM failover, or if a recyled application module
// is activated after passivation. If these things happen, BC4J will
// be able to find the row that you created so the user can resume
// work.
if (!pageContext.isFormSubmission())
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("createEmployee", null);
else
if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "empCreateTxn", true))
// We got here through some use of the browser "Back" button, so we
// want to display a stale data error and disallow access to the page.
// If this were a real application, we would probably display a more
// context-specific message telling the user she can't use the browser
// "Back" button and the "Create" page. Instead, we wanted to illustrate
// how to display the Applications standard NAVIGATION ERROR message.
OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
pageContext.redirectToDialogPage(dialogPage);
} // end processRequest()
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Apply") != null)
am.invokeMethod("apply");
pageContext.forwardImmediately("OA.jsp?page=/oracle/apps/OPI/setup/webui/DisplayPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
else if (pageContext.getParameter("Cancel") != null)
am.invokeMethod("rollbackEmployee");
pageContext.forwardImmediately("OA.jsp?page=/oracle/apps/OPI/setup/webui/CreatePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
My AM code is:
package oracle.apps.OPI.setup.server;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.jbo.Row;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.jbo.Transaction;
// --- File generated by Oracle ADF Business Components Design Time.
// --- Custom code may be added to this class.
// --- Warning: Do not modify method signatures of generated methods.
public class CreateAMImpl extends OAApplicationModuleImpl {
/**This is the default constructor (do not remove)
public CreateAMImpl() {
/**Container's getter for CreateVO1
public CreateVOImpl getCreateVO1() {
return (CreateVOImpl)findViewObject("CreateVO1");
/**Sample exportable method.
public void sampleCreateAMImplExportable() {
/**Sample exportable method.
public void sampleCreateAMImplExportable2(String testParam1) {
/**Sample main for debugging Business Components code using the tester.
public static void main(String[] args) {
launchTester("oracle.apps.OPI.setup.server", /* package name */
"CreateAMLocal" /* Configuration Name */);
* Creates a new employee.
public void createEmployee()
OAViewObject vo = (OAViewObject) getEMP_Create_VO1();
if (!vo.isPreparedForExecution())
vo.executeQuery();
Row row = vo.createRow();
vo.insertRow(row);
// Required per OA Framework Model Coding Standard M69
row.setNewRowState(Row.STATUS_INITIALIZED);
} // end createEmployee()
* Executes a rollback including the database and the middle tier.
public void rollbackEmployee()
Transaction txn = getTransaction();
// This small optimization ensures that we don't perform a rollback
// if we don't have to.
if (txn.isDirty())
txn.rollback();
} // end rollbackEmployee()
public void apply()
getDBTransaction().commit();
/**Container's getter for EMP_Create_VO1
public EMP_Create_VOImpl getEMP_Create_VO1() {
return (EMP_Create_VOImpl)findViewObject("EMP_Create_VO1");
}

Similar Messages

  • Help needed regarding insertion of data into oracle

    Hi,
    I am student currently trying to do a project to up a semantic database using oracle. Have set up the semantic technologies for oracle 11gr2 and used the jena adapter to load an owl into oracle.
    But i am not sure how do i insert sample data that could reference the owl.
    Tried searching but unable to find any simple tutorial and have also looked through the developer's guide and also jenaadaptor guide.
    Is there any tutorials available that could help? thank you

    Hi,
    Please go to the OTN site for more information:
    http://www.oracle.com/technology/tech/semantic_technologies/index.html
    There you can find some training info (try the NCI Oracle By Example, it's a good tutorial):
    http://www.oracle.com/technology/tech/semantic_technologies/htdocs/semtech_training.html
    Regards,
    Vladimir

  • Need to insert selected records from PROD into TEST

    I am trying to insert all records (for a specific region only) from production to test.
    I'm a little confused about how the pl/sql would look for this.
    Note that as I insert into the table in test, I also have a key field that is auto incremented by 1 each time.
    The problem that I am having is I need to link two tables in PROD together to determine the region:
    So in test, I want to do something like:
    INSERT INTO ACCOUNT_PRICE
    (select * from ACCOUNT_PRICE@PROD, MARKETER_ACCOUNT@PROD
    where substr(MARKETER_ACCT_NO,1,1) = '3'
    and MARKETER_ACCOUNT_NO = PRICE_ACCOUNT_NO);
    However, i'm not sure if this is correct or if I should be using a BULK insert.
    Note that I cannot just load the whole table as I need to restrict it to only one region of data.
    Any help would be appreciated.
    Sean

    Direct load (BULK) is irrelevant to what you are asking. I would strongly suggest that you read the docs about this feature before considering it for any purpose.
    As to your question what you are asking is unclear and, for reasons known only to you, you did not include a version number.
    So given that I get to invent your version number I have decided you have 10g and therefore you have DataPump so my recommendation is to use
    DataPump to extract and export the records you wish to move.
    http://www.morganslibrary.org/reference/dbms_datapump.html

  • Help needed regarding Segment Qualifiers

    Hi,
    In my process of implementing Apps R12 afresh, we just created the segments and assigned them their flexfield qualifiers today. In that, the one assigned towards alancing segment shows the value qualifiers like that of natural accounting segment, unlike the bal. segment value qualifier.
    I mean, when we try to insert a a value in the bal.segment it asks for qualifiers such as nature:expense/revenue/liability/asset, instead of going for the allow posting and allow budgeting alone. This is crazy, and I need your support.
    Thanks,
    Mukunthan L

    Hi Amit,
    Thanks alot for your reply. Its really helpful for me.
    So,we usually enter these relationships manually only, right? Before going ahead with the custom program, could you please let me know whether there is any SAP note related to this.Once again thanks alot for you help.
    Regards,
    Kishore.

  • Help needed regarding the updation of "Relationships" in BP

    Hello Guys,
    This is to request you to kindly help me regarding the following.
    We have a scenario where all the employees assigned to an Organizational unit (in PPOMA_CRM) are not showing in the "Relationships" ("Has Employee")in the BP transaction of that Organizational Unit.
    Could anyone let me know whether there is any update program that updates the "Relationships" from the Organizational asssignment. Or we need to enter the employees manually in BP "Relationships". Please help. Thanks in anticipation.
    Regards,
    Kishore.

    Hi Amit,
    Thanks alot for your reply. Its really helpful for me.
    So,we usually enter these relationships manually only, right? Before going ahead with the custom program, could you please let me know whether there is any SAP note related to this.Once again thanks alot for you help.
    Regards,
    Kishore.

  • Urgent help : how when insert new record navigation off

    hi master
    Sir
    when i insert new record by mistake press down key and curser move to next record and my need is
    When I insert new record or change any record that time my form navigation musht be off and no move to next record how I restrict to navigation please give me idea which event and what code I use
    Thanking you
    aamir

    If u want the cursor not to move ahead from a particular field when the records are inserted or updated on that field then u can just write null to the
    key-next-item trigger of that particular item.
    ie IN key-next-item
    null;
    Hope this is what you wanted.

  • Help Needed regarding SQL Loader Error

    Hi,
    I am trying to insert some records into two tables using same control file.
    I am using the follwing command to load data
    sqlload "$ORAUSER" CONTROL="$LDRFILE" DATA="$DATA_PATH/$DATA_FILE" BAD="$BAD_FILE" LOG="$LOG_FILE" DISCARD="$DISCARD_FILE" ERRORS="$MAX_ERRS"
    I am getting the error: SQL-LOADER - 350: Illegal combination of non-alphanumeric characters
    #!/bin/ksh
    Please suggest me what I need to do.
    Thanks,
    Srinivas.

    it appears that you are using this line code in your korn shell script. if you try to do a manual run on the unix command line do you still get the same error?
    also can you post a sample value for all the parameters you have.

  • Help needed Regarding Project Server - 2013 Workflow

    Hi All,
    I am new to Project server 2013 Workflow, hence please help me regarding this. Pardon me if this question is too trivial. 
    I have created a project type associated with a workflow and my workflow is as follows :
    So I am not doing anything here, I am just testing the workflow as mentioned by technet site : http://technet.microsoft.com/en-us/library/dn458865(v=office.15).aspx
    But it is mentioned that, after a minute or 2, the workflow state will change, also they have mentioned to press the Submit button.
    But in my case, the workflow is not moving to next stage [It just says 'The workflow is still processing - which never changes after hours] or I am getting the submit button (Submit button is disabled on the ribbon). Below is the state of my workflow :
    PS : I have made the user added to Portfolio managers group as well. But still I am having this same issue. 
    The Workflow manager is installed properly, and it is working fine in case of List workflow. I am facing the issue only wrt Site workflow for Project server 2013.
    Please help me to solve this issue.
    Thanks,
    shanky

    Hi Kiran,
    I am now facing issue while assigning a task to a person in the workflow.
    I am having a person named say 'John' , who is included in Project Manager as well as Portfolio Manager.
    And I am using a workflow as :
    Stage : Conceptual
    Assign a task to John (Task outcome to Variable: Outcome5 | Task ID to Variable: TaskID3 )
    Transition to stage
    Go to Approval
    But this is again giving issue as :
    Workflow Internal status : Cancelled
    Details: System.ApplicationException: HTTP 401 {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have
    permission to perform this action or access this resource."}}}
    PS : I have used the same Sharepoint admin account for 'Account Name' in ‘User Profile Sync' , Is this causing the issue? Please let me know.
    Thanks,
    Shanky

  • Help needed regarding BADI.

    hi all,
    can anyone plz tell me how to define BADI and how create an interface.
    plz tell from everything regarding that, i have work with basic ABAP only.
    anykind of links and any kind of matter will be helpful and you will be rewarded with points for your help difinatly.
    regards.
    raman.

    Hi Raman,
    Please search the forum and you have lots and lots of links in it. For you to start with, try these links,
    The specified item was not found.
    BADI
    Best Regards.

  • Help needed regarding font sizes

    Iam generating pdf documents using oracle developer's report builder.
    When i generate and view those pdf's using the web previewer thay appear to be quite fine,whereas when i host them on ias the font sizes gets bigger, thus lot of text gets truncated.
    Is there any parameters that has to be set for it.Pls help

    Hi Amit,
    Thanks alot for your reply. Its really helpful for me.
    So,we usually enter these relationships manually only, right? Before going ahead with the custom program, could you please let me know whether there is any SAP note related to this.Once again thanks alot for you help.
    Regards,
    Kishore.

  • Help needed regarding replication in ds5.2sp4

    Hi ,
    I am new to ldap . I am able to establish replication between master and consumer and trying to update it is getting update but i am geting the following error
    in error log
    INFORMATION - NSMMReplicationPlugin - conn=-1 op=-1 msgId=-1 - Replication bind to consumer alpha.ad.com:19941 failed:
    [16/May/2007:13:48:26 -0700] - INFORMATION - NSMMReplicationPlugin - conn=-1 op=-1 msgId=-1 - Failed to connect to replication consumer alpha.ad.com:19941
    [16/May/2007:13:48:26 -0700] - ERROR<8318> - Repl. Transport - conn=-1 op=-1 msgId=-1 - [S] Bind failed with response: Failed to bind to remote (900).
    Please help me regarding this .
    Message was edited by:
    ap7926

    If data is getting replicated from master to consumer then the bind for that specific replication agreement is working.
    Check your timestamps and current log entries. Are the "Failed to connect to replication" messages currently being generated? As long as your replication agreement is enabled the supplier will try to keep things up and running, retrying a failed consumer regularly (and generating about 1 set of log messaages per minute on my systems). So you'll get those messages on the supplier when a good consumer is down (the nsslapd directory server process that is).
    If you don't have these messages being generated currently then this probably means that your consumer was down around "16/May/2007:13:48:26 -0700" but is ok now. In that case those messages aren't of big concern. They're just telling you that you had a problem, which you hopefully already knew about.
    If replication is working (test by making a change on the supplier and checking it on the consumer) AND you're still concurrently getting these messages regularly then you have something interesting going on, probably due to a configuration issue. Without seeing the details it's difficult say what it would be.

  • Help need on inserting system date on database

    hello every body,
    I need to insert system date into database through prepared statement.
    i wrote code :
    java.util.Date d=new java.util.Date();
    Preparestatement psmt;
    psmt.setDate(8, java.sql.Date(d));
    am getting class cast exception :
    could u please tell me how to insert system date through prepared statement..
    thanks in advance..

    Surround your code with a
    try{
    //Insert date here
    catch(Exception e){
    //handle exceptions here
    e.printStackTrace();
    Who says he didn't already?
    Try this:
    java.util.Date d=new java.util.Date();
    >
    Preparestatement psmt;
    psmt.setDate(8, new
    java.sql.Date(d.getTime()));This is correct, but can be condensed (if you want)
    psmt.setDate(8, new java.sql.Date(new java.util.Date().getTime()));
    >
    It's good idea to use the JDBC escape function
    instead of using a specific DBMS function. This way,
    your code will be portable.
    sql = "INSERT INTO USERS VALUES("
    + "'" + userName + "'" + ","
    + "'" + userPw   + "'" + ","
    + "  {fn now() }  )"; e Real's How To
    (http://64.18.163.122/rgagnon/javadetails/java-0567.ht
    ml)
    And this is only marginally applicable.  If he wishes to use the same statement for the current date, as well as other dates, he cannot make use of this.  Of course, I don't really know if I would trust or recommend a tutorial site that advocates building statements that are screaming for injection attack attempts.
    Edit:  Too slow by a mile!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Please help me regarding on missing record label

    Hello Guys,
    I'm getting frustrated on how to solve these problem I've had. The problem I had been through is, I've purchased couple of albums from itunes. When I bought it, there's a Record Label shown right under the Album name. When I restore my phone, the albums that I've purchase, the Record Label not shown. I'm really need your help guys Please do reply

    Hi vali thanks for your reply...
    I am using Windows XP sp2 Os.
    and Oracle database 11g ...
    when executing this file the follwing error is occuring
    Enter value for user_name: system
    old 2: uname VARCHAR(50) := '&user_name';
    new 2: uname VARCHAR(50) := 'system';
    **MOBILE CODE** immediate 'drop user ' ||uname;
    ERROR at line 13:
    ORA-06550: line 13, column 1:
    PLS-00103: Encountered the symbol "*" when expecting one of the following:
    ( begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    continue close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe purge

  • Help needed regarding MessageChoice...

    Hello All,
    Here's what I've done.
    1) I've created a view for the employees table where in I've added the departments_name field to it by joining both the Employees & Departments table.
    2) I've created a view page to diplay the records by dragging and placing the view on the page.
    3) I've done the same thing for creating an edit page, but in input form mode.
    Now here's what I need.
    1) In the edit/create page I don't want the Department_Id field to be displayed(I've kept it as rendered = "false"). Instead I want to use a message choice which displays the Department_Name.
    2) And after making my selection and giving commit, It must be able to Create or Update both the Department_Id and Department_Name fields.
    Is it possible ? if yes Kindly help me out on this. If there's any examples in the Oracle site regarding this Kindly specify.
    Thanks & Regards,
    Arun

    You didn't mention what is your UI technology.
    If you are using ADF Faces there is a sample of how to do it in the ADF Developer Guide (ch 11.9) you use a selectOneChoice item for that.

  • HELP NEEDED: Use a new record for a customized table as a workflow trigger

    Hi SAP Workflow Gurus,
    Good day!
    One of our requirements is to have the creation of a new record in a custom database table trigger a workflow. I read and followed the steps as indicated in this link
    http://www.****************/Tutorials/Workflow/Table/events.htm
    As a summary, here is what I did:
    1. Created a subroutine for the custom table ZPA2003 for the create event
    2. Defined this event as a trigger for the custom workflow WS90000019
    3. Maintained and activated the event linkage via SWETYPV
    Basically I tried following the instructions indicated on the link
    Note that the entries for the custom table are created via a function module.
    Now during testing of the workflow, the system was able to complete the notification message. However, when I triggered the event via creation of the entry in the custom db table nothing happened
    1. Is there a way to debug/find out whether the link between the subroutine in the table and event itself are connected?
    2. I also tried running the event trace to check the activities executed but found nothing.
    Can you guys help me check on what I may have missed out?
    Regards,

    Hi All,
    Basically these are the requirements for the work schedule substitution:
    1. Employee enters the request via ESS (custom portal transaction)
    2. Upon saving of the entry (request) in a custom  table, this should trigger the workflow at the backend
    3. The Manager should then receive a work item in his Universal Worklist at the MSS side of the portal
    4. Upon clicking on the work item, a new screen will pop up showing the work schedule substitution details as well as an interface which will allow him to enter his/her usage decision
    5. Depending on the decision, the workflow must execute the necessary notifications as well as changes in the custom and PA2003 tables
    Now, we have accomplished step 1 and I am currently in the process for step 2. Now I have some queries:
    1. For the Manager to view and approve the substitution details, I used two methods for each process (view and approve) since our ABAPer mentioned that this cannot be done in 1 function module. Is there a way to simplify this step or is it really valid that they need to be executed in 2 different methods?
    2. As per our ABAPer, function Modules only import and export variables; they do not have the facility of say having tags on the details being displayed. Hence, if the details are 10001 (Employee Number), 10/20/2011 (Start Date), 10/25/2011 (End Date) the output would be 10001, 10/20/2011, 10/25/2011. Is there a way within the function module (or dynpro interface) to show it like this: Employee Number: 10001
                               Start Date: 10/20/2011
                               End Date: 10/25/2011
    3.  Speaking of dynpro applications, do I need to still develop one to allow the Manager to view and approve/reject the request via the MSS portal upon accessing the work item via the UWL? How would the work item go about calling the dynpro application? or is this even possible?
    It would have been easier if the facility would not pass through workflows since it will be just direct web dynpro/ABAP calls. Having to include it as a work item in the UWL puts a certain twist to it
    Your inputs are well-appreciated.
    Regards,

Maybe you are looking for

  • Wake on LAN/Keyboard wake for a K8N Neo Platinum - how do I use this?

    I've got a K8N Neo Platinum motherboard that I am using in my home theater PC and I was hoping to enable either the wake on lan or keyboard wake functions so that they could be controlled via a remote control. For now disregard what the overall outco

  • VGA Splitter issue

    Hi there, new to this forum and am after some guidance. .. I have recently purchased a Mac Mini and wanted to connect it to two displays, one standard monitor and one LCD TV in the next room via a 5m VGA cable. I purchased a powered VGA splitter and

  • Crazy, unfixable error...  The dreaded icon of death.

    Alright, so I'm listenin' to my iPod yesterday, and everything's goin' all jolly as I'm doin' a little jig in my chair to Low Rider. Then, out of no where, the music stops playing. Curiousity consuming me, I switch my attention to my iPod, and attemp

  • Expression Tranformation in ODI

    Hi, I am trying to develop an existing informatica mapping in ODI. my informatica ETL mapping design is like this: Source Qualifier ----------->1st Exp Tranformation ---------------->2nd exp trnsf --------> lookup ------> insert/update in the above d

  • UDF help required.

    Hi, <data> ..<Person> ....<Contact> ............<Telephone> ...................<Number>984574123658</Number> .............</Telephone> ......</Contact> ....<Contact> ............<Telephone> ...................<Number>984574123658</Number> ...........