JDeveloper 10g Creating a new record with trigger sequence primary key

Hi there, I'm sorry to post this incredibly simple question and I'm sure that someone must have answered this on this forum before but the searching of this site is incredible slow and painful and after 30 mins I can't find help.
I am using a struts Data Action to create a new record in the database and then being forwarded to an edit page where I can enter the new details. Then when the details are entered I am clicking an update button and returning to a browse screen where I can either commit the change to the database or rollback. Sounds pretty simple but I am really struggling with trying to get the trigger of the number sequence to work properly.
Ideally I would like to click the create new record button and then the primary key/triggered sequence number is already displayed on the empty form...
... but if this is too tricky or not possible then I would like the user to either not enter any value in the key field (which currently causes error - JBO-27014: Attribute PoNo in PO_SYS_MODULE.PoSystemView1 is required) OR the user enters a number and the trigger overwrites this number with the next in the sequence.
I can enter a new record if I look in the manager console and see the next number in the sequence and then create the record using this number and then click commit twice, as the first time I get the error: JBO-25019: Entity row of key oracle.jbo.Key[154 ] not found in PoSystem. Or if I enter a value 5 times greater than the next in the sequence I have to click the commit button 5 extra times to get the sequence to match the input.
I hope that this lengthy explanation fills you in on my problem, there must be a simple solution to this and I will be VERY grateful to anyone who can help me.
Many thanks
Ben Sayers (clearly a newbie)

Hi,
ADF Business Components handles this for you - unless yo prefer doing this manually. In the Entity Object, set the PK attribute's type to DBSequence. Then create a database sequence and use a database trigger to add the sequence value on insert
Frank

Similar Messages

  • Create record with manual guid / primary key

    Hi All,
    Is this possible to create record in some entity in dynamics crm with set manual id / primary key / guid?
    like this:
    Entity entity = new Entity("new_test");
          entity.Attributes["new_testid"] = new Guid("688008C8-F95D-4158-BAB2-A3F695D7BEEF");
          entity.Attributes["trs_name"] = "AAAAA";
          organizationservice.Create(entity);
    is there any impact if I do that?
    please advise.
    thanks

    I have try it my development server, and it's work
    actually, this question for my requirement that need do integrate between another system to CRM, which the another system has guid as their PK (primary key) and they push their record to CRM using CRM web service and put their PK / guid value as Id in CRM's
    entity that they pushed.
    but, I have consult with microsoft support with this technique and I don't want get trouble in later time, and they said this is not recommended from microsoft, even it work as I said before.
    thanks.

  • When creating a new record in a list, I want to create a new record in another list, too, together with the ID of the first record

    OK, for anyone who has ever programmed a database, this one is easy. However, I am EXTREMELY limited. I work with SharePoint 365 (2013). I am pretty proficient in a number of programing languages, but I really don't know how to program SP. I wouldn't even
    know where to put code.
    Say, I have two lists: List A, with Items A1 (ID), A2, A3 and List B, with Items B1 (Lookup to A1), B2, B3. What I want this: When I create a new record in List A I want that also an empty record (except for the B:A1 item) is created. Is that possible without
    any major programing?

    you can create a workflow to achieve your requirement
    http://sharepoint.stackexchange.com/questions/50059/create-a-list-item-when-item-is-created-in-another-list
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • FRM-40735: WHEN-NEW-RECORD-INSTANCE trigger raised unhandled exception

    I have a form that I migrated to 10g from 6i. I have no problems with it in 6i.
    When I launch this migrated form on the web in 10g, I get the following error:
    Error: FRM-40735: WHEN-NEW-RECORD-INSTANCE trigger raised unhandled exception ORA-03127From oracle error code
    03127, 00000, "no new operations allowed until the active operation ends"
    // *Cause: An attempt was made to execute a new operation before the active
    //         non-blocking operation completed or a new operation was attempted
    //         before all the pieces of a column were inserted or fetched.
    // *Action: Execute the new operation after the non-blocking operation
    //          completes. If piecewise binds/defines were done, execute the new
    //          operation after all the pieces have been inserted or fetched.What does the above suggested action mean?
    Any suggestions.
    Thanks

    Run the debugger and see what line of code is failing.

  • Filling datarows before creating a new record  frm-40735 ora-01422

    Hello
    I want to create a user-control table where I Store in the Mastertable the user informations. in the 2 detail tables I store the programmnames of the first level, in the second table I store the name of the form and if the user is allowed to insert, amend or delete.
    I use a Master/2 Detail-Form. When I create a new record in the master block, I want to fill in the first and second detail block, informations of another user of the 2 detail tables. therefore I created a when-new-block-instance trigger with the following code:
    select programm
    into :k_zugriff.Programm
    from k_zugriff, K_benutzer
    where r_benutzer_zaehler=k_benutzer.zaehler
    and oracle_user='ROBERT';
    because this sql serves more than one row I receive the error code frm-40735 ora-01422
    so how could I solve the problem to insert 5-10 rows in :k_zugriff.Programm. I can not make an insert before I go to the block k_zugriff, because the user number is not commited known. Also I want to commit the form when all informations are filled in. in case of a mistake I want to exit the form with no commit;
    has anyone a usefull Idea?
    regards
    robert

    it works thank you. where can I get further information about this technik. are there any turtorials or something where I get information how to build this complex forms??
    right statement
    DECLARE
    CURsOR cr IS
    select programm
    from k_zugriff, K_benutzer
    where r_benutzer_zaehler=k_benutzer.zaehler
    and oracle_user='ROBERT';
    BEGIN
    FOR rec IN cr LOOP
    IF :SYSTEm.RECOrD_STATUS!='NEW' THEN
    CREATE_RECORD;
    END IF;
    :k_zugriff.Programm:=rec.PROGRAMM;
    END LOOP;
    END;

  • How to populate automatically in a when-new-record-instance trigger?

    I have a form which displays around ten rows with about 5 columns. Whenever i will create a new record, i would like to place an initial value on the first column of every record. How do I do this? If I place the value in the properties of the item, it would be replicated on all the rows. What I want is to put a different value for each row created. But the problem is there is only one item property that i can put a value on (displayed 10 times). How do i put different initial values for each record created without creating new items for each record. is this possible? Thanks a lot

    Hi Navnit,
    Yes you are right, but it can work even we not plase quotation mark in it. But Yes I forget to place semi colon so now it is
    IF :System.Cursor_Record = 1 THEN
       :Block.Col1 := '02:00';
    ElsIF :System.Cursor_Record = 2 THEN
       :Block.Col1 := '07:00';
       ------and so on
    END IF;Danish

  • No "before new record saved" trigger event in workflow definition ?

    Hello,
    I have following problem: I have to make a simple integration, where products have information about available quantity of given product . Assume we have field - it is called "Available amount" and it tells how many products are on stock. Now suppose we have created an opportunity, and we want to add Opportunity Product Revenue - we're selecting product and then quantity. I want to make OCOD to display message and prevent from adding opportunity product revenue, when its quantity is greater than "Available amount" field which is present in associated product record. I've created small C# application and used workflows to create Integration events. It works - but not exaclty how I want it - when I add a new record the workflow generates integration event - but I'd like to generate integration event before a record is created, also I'd like to show a notification from OCOD. But for "revenue" we do not have a trigger event called for example : "before new record saved" - we have only "when new record saved" and "before modified record saved".

    Hi,
    From your requirement, it seems you, want some kind of check. Did you try puting this validation on field level, i guess you would need to join fields and compare in field validation. So, whenever user creates a new record this validation kicks and user is notified of the error.

  • I have added a new field in IT0006 ,Now when try to create a new record for

    Hi Experts,
    I have added a new field in IT0006 ,Now when try to create a new record for a employee.
    1,If I give the SUBTY in the PA30 screen getting an error "Don't Specify a subty error"
    if and remove the subty and press CREATE button popup's comes and list the subty values.......It was allowing me to enter the subty in the PA30 screen prior to my new field addition in IT0006... is't a problem with the new field addition?
    2, After I choose the subty value from the pop-up I am able to see the next screen....BUT GETTING AN INFORMATION MESSAGE THAT "Assignment to feature P0006 did not take place"?
    3,, In the next screen after I have passed all mandatory fields while attempting SAVE I am getting an error called " Time constraint table in T777D is incorrect" what could be the cause?

    How are u adding fields to table using append in se11 or pm01.
    if you are adding fields using se11 delete it and add it0005 in transaction pm01 and generate object.
    add fields to structure CI_XX_R0005 and generate screen and maintain entry and screen in maintance view add entry and activate program.

  • Any BAPI/Function Module for adding new record with dates in PA0027

    Hi all,
    I am tryig to find is there any BAPI/Function module for updating new record with Start Date and End date for specified Personal Number in PA0027 Table.
    In PA0027 table i will be passing start date and end date for selected personal number, it needs to add new record with this details in the table checking the condition that this start date and end dates should not be between any of of start date and end dates for the specified personal number.
    thanks for ur time.
    Murali

    Hi Raj/Suresh thanks for ur answers.
    but i am having a problem,i gave this values.
    INFTY               -
                0027
    NUMBER              -
                00000010
    SUBTYPE             -
                010
    OBJECTID
    LOCKINDICATOR
    VALIDITYEND         -
                03/12/2006
    VALIDITYBEGIN       -
                03/01/2006
    RECORDNUMBER        -
                000
    RECORD              -
                P0027
    OPERATION           -
                CHK
    TCLAS               -
                A
    DIALOG_MODE         -
                0
    NOCOMMIT            -
                Y
    VIEW_IDENTIFIER
    SECONDARY_RECORD
    i am getting short dump saying that
    The source field is too short.
    The current program, "SAPLHRMM", tried to assign a field to a field symbo
    However, the field is shorter than the type of the field symbol, which
    is not allowed.
    The statement in question is in the form ASSIGN f TO <fs> CASTING or
    ASSIGN f TO <fs> with a field symbol that was created using the
    STRUCTURE addition.
    I tried  operation - Chage,Create (same thing for all inputs)
    is this correct funtion moduel for my requirment?
    what ever i am passing the start and end dates this should check in the table records with this personal number and if this start date and end dates are not between of any start and end dates then it should add new record with this dates.
    Thanks for ur time.
    Murali.

  • HCM PF: Create multiple new records while displaying old ones

    Hiya (cross-posted to OSS & SDN),
    I'm having some difficulties when trying to create new records to IT0014 while displaying old records at the same time, hope you can help me. The problem in brief is that existing records are removed from display when I create new ones and click on check.
    My setup is as follows:
    - SAP ERP 6.0 EhP4 SP29
    - one form scenario with the following fields set up for backend service SAP_PA (two consecutive calls, first for I0014_xxxxx and the second for fields I0014_xxxxx_NEW):
    o I0014_BEGDA Validity begin date 5 SAP_PA: Value for Effective Date Create 0014 * HCMT_BSP_PA_XX_R0014 BEGDA * PAD_BEGDA
    o I0014_BETRG Amount 5 SAP_PA: Value for Effective Date Create 0014 * HCMT_BSP_PA_XX_R0014 BETRG * PAD_AMT7S
    o I0014_ENDDA End date 5 SAP_PA: Value for Effective Date Create 0014 * HCMT_BSP_PA_XX_R0014 ENDDA * PAD_ENDDA
    o I0014_LGART Wage Type 5 SAP_PA: Value for Effective Date Create 0014 * HCMT_BSP_PA_XX_R0014 LGART * LGART
    o I0014_LGTXT Wage Type Text 5 SAP_PA: Value for Effective Date Create 0014 * HCMT_BSP_PA_XX_R0014 LGTXT * LGTXT
    o I0014_WAERS Currency Manual Default Value: EUR Create 0014 * HCMT_BSP_PA_XX_R0014 WAERS * WAERS
    o I0014_BEGDA_NEW Validity begin date Create 0014 * HCMT_BSP_PA_XX_R0014 BEGDA * PAD_BEGDA
    o I0014_BETRG_NEW New Amount Create 0014 * HCMT_BSP_PA_XX_R0014 BETRG * PAD_AMT7S
    o I0014_ENDDA_NEW New end date Create 0014 * HCMT_BSP_PA_XX_R0014 ENDDA * PAD_ENDDA
    o I0014_LGART_NEW New Wage Type 1 ZS_ACTIONS: Value Help Create 0014 * HCMT_BSP_PA_XX_R0014 LGART * LGART
    o I0014_WAERS_NEW New currency Manual Default Value: EUR 6 SAP_PA: Value Help Create 0014 * HCMT_BSP_PA_XX_R0014 WAERS * WAERS
    - the PDF layout has two table controls: one for displaying the old values (I0014_xxxxx) and one for displaying the new entries to be created (customer requirement to display the tables side by side)
    - old values are displayed all right and they get populated without any problems
    The problem is that when I try to create a new entry with fields I0014_xxxxx_NEW, the first table entry in fields I0014_xxxxx is cleared out. This same problem currently occurs also with other table type entries (I0027, I0008).
    I've looked very closely at note 1043692 and it states the following in its limitations:
    - limitation 4:
    a change to the field LGART is not allowed
    => I'm not doing a change, trying to create
    - limitation 6:
    Two front end fields mapped to the same backend (infotype) field cannot be used in the same table, though you have configured different default values and made one field as operation exclusive. The reason being that the field marked as Op-Exclusive will not be operated upon and there will be inconsistencies in the number of table lines generated.
    => could this be the reason for my problem?
    I have also given a shot at creating a generic service for the job, but as the same note suggests it didn't work (testing the process timeouts if I return fields with multiple field values with separate indexes and subtypes).
    Have you had any experiences with table controls showing both past and to-be values? Does the framework even support this kind of a requirement?
    Best regards,
    Mikko

    Hi Aravind,
    appreciate your input.
    Not sure however if I followed you completely. When you wrote "values that needed to be displayed are made as optional" did you mean optional = operation-exclusive or optional = disabled with the help of a rule? 
    Did you btw do this especially with subtype * and index * relevant infotypes? I tried your approach and upon initialization everything looks good (I didn't have the generic service in between SAP_PA:s because gs:s won't work in case of subtype * infotypes at least according to OSS and my initial tests), both the display and edit elements are populated all right.
    However when I create a new entry into the new fields, their sort order is messed up upon check & send - the last entry suddenly becomes the first and check & sending for the second time I get errors about LGART and SUBTYpe not being the same (which is natural and according to the OSS note I referred to previously).
    If you have been working with subty * related multiple fields, can you elaborate more on your solution?
    Best regards,
    Mikko

  • Populate fields when creating an new record

    Hello,
    When I create a new record from an other record type (ex: a service request from a task), I would like to pre populate some fields which are common to the task and the SR (ex: Owner, Account, Contact) and already on the task record.
    I have read that I could use the joinfieldvalue function with the post default activated.
    But the fields Owner, Account and Contact are read only picklist on the service request record and I am not allowed to use the default feature...
    Could you help? Do you have any idea?
    Thanks in advance
    Laurent

    Hi, As a service request can have multiple activities and you dont have the activity field (primary) in the service request, i dont think it is possible to acheive your requirement through JoinFieldValue. On the other hand if you like to default activity fields on basis of the associated SR to activity that is possible as the activity has the associated SR information. Hope it helps
    -- Venky CRMIT

  • Web GUI new feature - creating a new record based on the current record

    Vincent,
    We need new feature in Web GUI:
    creating a new record based on the current record with data
    from Moscow with money

    It is already enabled, in the next release.
    If you joint TAB program, the march preview build contains it. User can select 1 or multiple users and make a copy.

  • When I create a new account with same password is ...

    Over the course of inactivity it happened that I forgot my passwords. I did not request a reset but created a new account with the same e-mail. Can I have several accounts with the same e-mail? And if so, how do I request a reset of password for a specific username resp. account? I would like to keep the old user accounts for several reasons. But requesting a reset via e-mail will do so on my newest account for which I know the password.
    Am I trying to do something impossible?

    as far as I remember, accounts are tagged as inactive after 6 months of no activity.  
    In your case, I think you may need to contact customer service for further assistance.
    Just click the link below to see the instructions on how you can get in touch with the Support team ;
    https://support.skype.com/en/faq/FA1170/how-can-i-contact-skype-customer-service
    CONTACT SKYPE CUSTOMER SERVICE   |  HOW TO RECORD SKYPE VIDEO CALLS  | HOW TO HANDLE SUPICIOUS CALLS AND MESSAGES   |  WINDOWS PROBLEMS TROUBLESHOOTING   |  SKYPE DOWNLOAD LINKS  
    MORE TIPS, TRICKS AND UPDATES AT
    skypefordummies.blogspot.com

  • Need help to create a new record in mdm using java webdynpro

    hi all,
    I have to develop an application to create a new record in mdm by using java WebDynpro  . Please help me what is the process that i have to follow to do this and provide me if you have any step by step guidance for this.
    thanks & regards,
    Mahi.

    Hi,
    The below link will help u to make the application in JAVA webdynpro
    The article has code to for creating records.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/803e9e80-21f4-2a10-8cbf-bcf6a8060be3
    Hope this may help u .
    Rgds
    Ankit

  • Hi! I have 2 Apple IDs but cant log in one. Says info doesnt match. Choosing to receive email, but email is not comming too. Trying to create a new id with old email-denies becuase it is existing. How can I get into old AppleID? Have few expensive apps.

    Could it be so that I have deleted the old AppleID? All applications are still on the device, but I cant get them on new device. When I try to create a new id with an old email, it doesnt allow saying that the address is already occupied. It means the ID exists, but I cant get in... (I was trying to change address, just dont know if I succeed or not.)
    Thank you in advance

    So For everyone that is having the issue of iCloud asking for an old email there is a very simple fix, as long as its a simple switch from one email to another on one apple ID account.
    1. Sign into appleid.apple.com with your current ID.
    2. Edit the primary email to the one requested. (You DO NOT need to verify the old email.)
    3. Sign out of iCloud on any device using the old ID.
    4. Edit the primary email (on appleid.apple.com) back to the desired email address.
    5. Verify that email address.
    6. Sign into iCloud with the correct email.
    As for anyone that is unable to verify their account due to not receiving the verification email, contact apple support for further assistance.

Maybe you are looking for