How can I set a value in a field before create when a New button is clicked

Hi,
I am using
JDeveloper 10.1.3.1.0.3984 and
JHeadstart 10.1.3.1 release 10.1.3.1.26
I have one group and there is a detail group under that group.
From main group to detail group there are 3 field relating those groups.
field1
field2
fieldSEQ (auto-generated by database trigger)
These 3 fields are PK.
In the detail group, there is a New button. So, when the New button is clicked, it tries to create the record with those 3 fields value as those are coming from main group. As a result it's giving the duplicate error as that record already exists in the table.
But I don't want to create the record with that SEQ as that will be created in the trigger.
How can I set the SEQ temporarily any no. (-1) before create when the New button is clicked?
Can anybody help?
Thanks
Syed Jabbar
University of Windsor
Windsor, ON, Canada

Hello Syad,
What I would suggest is setting the sequence number at the creation of the entity object (so in the create() method) by using the database sequence. This way it will always be unique.
So something like:
protected void create(AttributeList AttributeList) {
super.create(AttributeList);
SequenceImpl sequence =
new SequenceImpl("KCP_SEQ", getDBTransaction());
setFieldSeq( sequence.getSequenceNumber());
If this still does not solve it: please go to the ADF Forum since this problem is an ADF problem, not a JHeadstart problem.
Regards,
Evert-Jan de Bruin
JHeadstart Team.

Similar Messages

  • How can I set default value in a field based on a LOV?

    Here's the LOV:
    select txtName, ID
    from FAC_LK_PROJECT_PRIORITY
    order by 1
    I tried:
    select id from FAC_LK_PROJECT_PRIORITY priority where txtname = 'Medium';
    and set the default value type to be PL/SQL function body but that didn't work - I get this error:
    ORA-06550: line 2, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
    Error ERR-9131 Error in PLSQL function body for item default code, item=P19_PRIORITYID
    OK
    The item is a select list w/ db column as source: PRIORITYID

    Hi Scott. thanks for answering. I get from your post that I need to declare a variable and then return something. I changed it to this
    declare v_id number := null;
    begin
      select id into v_id
          from FAC_LK_PROJECT_PRIORITY priority
          where txtname = 'Medium';
      return v_id;
    end;and it works.
    Why do you use a loop? In case there's >1 row returned by the query?

  • How can I set a value of column in SSIS by using Replace

    How can I set a value of a column in SSIS using a Replace in Derive columns. I have here NameCode and I need to Set = 1 Where NameCode like LIKE '____99____'
    eg. 1006993010... if 5th and 6th characters are 99
    Else 0
    Hope to hear from someone soon and I appreciate great help here.

    If NameCode column is integer then you have to cast it correctly to String.
    I am adding that to the expression provided by Rajen.
    SUBSTRING((DT_WSTR,20)ProductCode,5,2) == "99" ? 1 : 0
    -Vaibhav Chaudhari

  • How can I set the value to a session bean from backing bean

    Hi Experts,
    How can I set the value to a session bean from backing bean where I have created getter and setter
    methods for that variable.
    Basically I am using ADFUtils class where I am able to get the value from session bean
    using following expression
    String claimType =
    (String)ADFUtil.invokeEL("#{ClaimValueObj.getClaimType}");
    Thanks
    Gayaz

    Gayaz,
    Wrong Post !!
    Post in JDeveloper and ADF
    Thanks
    --Anil                                                                                                                                                                                                                               

  • How can I set default values for Allocate Mode in AO config?

    Hi, How can I set default values for allocate mode in AO config. To be specific, in the attached vi, I need to set the Allocate Mode in AO Config to 'Use FIFO Memory (6)' if the value inside my case structure is false and to 'no change (0)' if the value inside the case strusture is true.
    Solved!
    Go to Solution.
    Attachments:
    generateWaveformFIFO.vi ‏15 KB

    Create two constants for the Allocate Mode input (right click > create > constant). Place one in the true case of the case structure, and place the other one in the false case. Wire them to the same tunnel (border of the case structure), then wire the tunnel to the Allocate Mode terminal of the AO Config. I don't have Traditional DAQ installed, but that should do it.
    Misha

  • How can i Set ArrayList values to selectOneListbox

    Please Let me know How can i Set ArrayList values to selectOneListbox dynamically from the managed bean

    Note: beanList is a list of selectItems
    ArrayList<SelectItem> beanList;

  • How can I set a gap in a JTextField, before the active Textfield starts?

    Hi,
    how can I set a gap in a JTextField, before the active Textfield starts?
    I'll avoid, that the input text starts immediately after the border of the JTextField.
    Btw, how can I set the height of the JTextField in a BoxLayout?
    Thx.
    Hans

    Yes, that was also my thinking, but nothing happens.
    Maybe You have an idea :-)
    Thx, Hans
    Here a part of my code:
      private JPanel createEntry(String label, JTextField jtf, String initJtf, boolean editable) {
        jtf.setColumns(15);
        if (editable) {
          jtf.setEditable(true);
          jtf.setBackground(new Color(191, 191, 255));
        else {
          jtf.setEditable(false);
          jtf.setBackground(SystemColor.control);
        jtf.setText(initJtf);
        jtf.setForeground(Color.black);
        jtf.setBorder(BorderFactory.createLoweredBevelBorder());
        jtf.setMargin(new Insets(50, 20, 50, 40));   // <-  The PROBLEM
        JPanel panel = new JPanel();
        GridLayout gl = new GridLayout(1, 2);
        gl.setHgap(1);
        panel.setLayout(gl);
        panel.add(BxpCdmUtils.Utils.createLabel(label, Color.darkGray, Font.BOLD, 11));
        panel.add(jtf);
        JPanel superpanel = new JPanel();
        superpanel.setLayout(new BoxLayout(superpanel, BoxLayout.X_AXIS));
        superpanel.add(panel);
        superpanel.add(new JLabel(" "));
        return superpanel;
      }

  • How can I set default value to a transient parameter  in the VO

    I have created a transient parameter in the VO, which is type of boolean.
    When I try to input the "true" or "True" or "Y" in the 'default value',
    and then running the programm, but all failure.
    so I don't know how can i do.
    Genuinely waiting for you help, thanks in advance.

    Hi Sumury,
    First of all you could check if this transient attribute is read only. to check this, edit the VO and select the transient attribute under the Attributes tab. Then verify if it is marked as "Updateable Always" on the right-hand section.
    If it is updateable, then try setting the default value on the VO Implementation class: open the xxxVOImpl class, go to the transient attribute's setter (setxxx()) and change it to:
    <code> if (getXXX() == null) setAttributeInternal(XXX, "Y");
    else setAttributeInternal(XXX, value);</code>
    This might work. If it does not, then please post the exact message you are receiving when running the app.
    Hope this helps!
    Thiago

  • How can i set the values to text box by selecting from drop down list.

    hi ,
    i am using struts and jsps. i have a dropdown list of names(getting the values of names from database), i want to get address and phone number of that selected one.how can i get that?

    Hi swarupa,
    Well My advice in this senario wud Be
    Either U can make Use of XmlHttp Object through javascript(AJAX way).
    Or U need to Maintain the State of the entire form and then refresh the page to get those results....
    just for U r reference i am attaching a link which was programmed using ASP @ server side and which made use of XmlHttp Object.....
    http://www.w3schools.com/ajax/ajax_database.asp
    Just try to simulate the samething in your own way....
    REGARDS,
    RAHUL

  • How can we set default value within html:file

    Hai,
    To set default value to text box i use the following code. It works well.
    <html:text property="modifyserverdesc" value="<%= serverDesc%>" styleClass="text" size="38"/>But for file i use the code
    <html:file styleClass="file" property="modifyserverimgfile" value="<%= serverImage%>" size="40"/>It doesn't display value. What is problem here?

    Hi,
    guess that one option in a RowImpl would be to check if the attribute is null or if the attribute value can be found in the VO that populates the list. If first is true or seconds false (cannot be found) you return the first value of the VO, making it the current attribute value
    Frank

  • How can I set a value to an Object Array

    I am declaring an object variable like this:
    final Object[][] data = {
    {"Mary", new Integer(5)},
    {"Alison", new Integer(3)},
    {"Kathy", new Integer(2)},
    {"Sharon", new Integer(20)},
    {"Angela", new Integer(4)}
    And I would like to declare it like this:
    final Object[][] data = new Object [6][3];
    But the matter is that when I try to set a value like this:
              data[0][0] = "Hola";
    I got the next Errors.
    TableEditDemo.java:95: ']' expected
              data[r][c] = "Hola";
    ^
    TableEditDemo.java:95: <identifier> expected
              data[r][c] = "Hola";
    ^
    TableEditDemo.java:95: cannot resolve symbol
    symbol : class data
    location: class TableEditDemo.MyTableModel
              data[r][c] = "Hola";
    ^
    3 errors
    Could Somebody Help me please???? Thank you very much.

    I don't see problem for your declaration. Is it possible you forgot to cast data back to whatever class?
    PC

  • How can I reference a Value in a Field?

    Here is my problem. I have a two fields, say F_2 & F_3, defined in the layout editor. One field has a defined source of Page Number and the other field has a defined source of Total Pages. Each of these fields page numbering properties have been set so that the page numbers reset at a repeating group level. Within the report I have a program unit where I want to be able to use the values stored in these fields for calculations inside the program unit. How can this be done?

    I have actually tried putting a ':', :F_2, in front of the field name. Doing this returns an error saying that I have a bad bind variable. I have also tried to put an '&', &F_2, in front of the field name. This also returns an error. This time the error is, encountered the sysbol '&' when expecting ...
    Thanks for the suggestion. Any ideas, tips, and/or suggestions would be appreciated.

  • How can I set the focus to a field on a Portal form?

    Can anyone tell me if it is possible to set the focus to a particular field on a form which was created in Portal and is based on a PL/SQL procedure?
    The form contains a mixture of field types and also takes parameters from another form and displyas them.
    I have managed to set the focus on a form which is defined dirdctly in a PL/SQL procedure, using Javascript, but this doesn't seem to work for a Portal form.

    Hi,
    look at the discussion on May 25:th 2001, subject "How to get the cursor into a specific field", it might give you an idea.
    To give you some hint right now:
    In the "Additional PL/SQL Code" tab, "Before displaying the page", add following code:
    htp.p('<BODY onLoad="document.forms[0].elements[6].focus();">');
    forms[0] if you only have 1 form, and elements[the number of the item you want to be in focus]
    I hope this could help you
    /Sara

  • How can i set mouse cursor location in a vi at a particular control button

    If there are many string controls on a vi front panel,I want to set my cursor at a particular string control.
    Whenever i will give an input ,It should be typed in that string control only.
    How can I do that ?
    Solved!
    Go to Solution.

    Hi,
    there is a property node which called Key focus, you can use it for the string you want to be enabled.
    when you run the vi, the curser goes to the selected string control
    check the attached vi.
    Attachments:
    Untitled 9.vi ‏8 KB

  • How can I set or reset the page that is loaded when I open a new tab using Ctrl t ?? by

    I recently downloaded a program that has, as an undesired additional action, apprently setup Yahoo as the page that opens by default when I open a new tab using <Ctrl> <t> (or the <+> symbol on the tab bar). This is aggravating to me, particularly as I have not been able to find a way to stop it occurring.
    I expect that it is buried somewhere in my profile, but I also have not found a way to explore or edit the contents of my profile.
    There is a JScript script file called "user" in ...\profiles\4g4vpust.default that I suspect is associated with the behaviour, but renaming it achieved nothing.
    Prior to this, my new tabs used to open as blank pages, i.e. did not load any URL and I was happy with that. How can I get back to that state?

    Did it add the freeze net assistant add-on? That add-on is known to do this. If you have that add-on you can uninstall it Firefox should revert to the default behavior.
    If you do not have that add-on, another add-on will be causing this, you can use the procedure in the following link to identify what one - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • Error message in accessing a PDF file, using AR V.9.2.0

    When I run the following code,  I get the error message as in the attached file.  The PDF file was created using ScanSoft PDF Professional. Personally, I am getting rather fed with AR - the last version crashed my Internet Explorer V8 (and V7), but i

  • Integrate flash on my site, help

    Hello First please can we excused my english because I am from french. I am here because I will want knowing if I can surely integrated my website with a flashplayer already in the configuration to play a file rgar is on my computing systems? My webs

  • Error msg. page "Adobe Reader not allowed"

    When I attempt to use any thing in  Adobe on line I get a message that says "Adobe Reader not allowed".  What's that mean?

  • Why is it so difficult to setup SAP J2EE Server compared to others ?

    In the past I have setup JBoss, Weblogic and others without any problem. Why is it so hard with SAP ? I have lost a whole week ( see here Software Downloads ) trying to setup SAP J2EE Server for a client who asked to evaluate it. It seems I'm not alo

  • Arrangement of column in MIGO

    Hi All. I want the material field to be displayed in first column in item details instead of scrolling far to the right, i found  this same requirement posted by another person in this thread - Screen Layout for MIGO and MIRO , i tried that ,but i co