OAF Learning notes-java Entity Object Create data (in-depth EO series) ____java

Source: Internet
Author: User

In <your eo Name>eoimpl.java, if you chose to generate Create method in the wizard that establishes the EO, then it should already contain the standard methods create (). This method is called for new records above page.

public void Create (AttributeList attributelist)

{

Super.create (attributelist);

}

In this method you can add a field initialization statement, but it must be appended to the Super.create (attributelist).

Because the CO call am,am call Vo,vo, we need to implement the Add-record feature on the page as follows:

1. A method of creating new records in Vo.

2. The method of calling Vo in AM.

3. The method of calling AM in Co.

Because Voimpl provides a way to add records, the first step can be omitted. We can call Vo's method directly in AM to add records (this method is called EO's Create ()).

Pseudo code is as follows:

Am:

Import Oracle.jbo.Row;

Import Oracle.apps.fnd.framework.server.OAViewObjectImpl;

public void Createdata ()

{

Oaviewobjectimpl vo1 = This.getorderlinevo1 ()//To obtain the instance of VO

Row row = Vo1.createrow (); New records

Vo1.insertrow (row);//Insert Record

The above two sentences can be merged into one sentence: Vo1.insertrow (Vo1.createrow ());

Row.setnewrowstate (row.status_initialized)//The status of the EO Row

}

The last sentence in the code above is important. Explain:

The status of the EO row is as follows:

status_new– New Record status

status_deleted– Record has been deleted

status_modified– Record has been modified

status_unmodified– records have not been modified or modified but not submitted

status_dead– new records are deleted without committing

status_initialized– Initialization State

Several other states, temporarily do not look, here only said Status_new and status_initialized.

When the Execute EO create () method is executed, the status of the EO default row is Status_new, at which point the row is added to the oaf checkout queue, which means that oaf will validate the record. If you have a required entry in your record, you will not have to fill in the value when you add it. , this calibration failed, OAF will return the error message, of course, the new action will fail. Therefore, we can add row.setnewrowstate (row.status_initialized) to set the state of the record to initialize, so that This record will no longer enter the checkout queue, so it can be set up correctly and enter a value.

Please note: If your records have no required entries, or must be filled with an initial value, this sentence adds no matter ...

Cond...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.