Customizing DML of Entity Object

Hi,
I use Oracle ADF 12.1.3 with MS SQL Server as back-end database. Codes below demonstrate the situation.
@Override
protected void doDML(int i, TransactionEvent transactionEvent) {
super.doDML(i, transactionEvent);
if (i == DML_INSERT) {
Long id = null;
Statement stmt = this.getDBTransaction().createStatement(0);
try {
(1) ResultSet res = stmt.executeQuery("select @@IDENTITY as pk_num");  =>> WORKS
(2) ResultSet res = stmt.executeQuery("select SCOPE_IDENTITY() as pk_num");  =>> DOES NOT WORKS RETURN 0;
(3) ResultSet res = stmt.executeQuery("insert into uOstan (Nam, Cod) values ('_Test_', '_123_') select SCOPE_IDENTITY() as pk_num"); =>> WORKS
if (res.next()) {
id = res.getLong("pk_num");
populateAttribute(0, id);
} catch (Exception e) {
System.out.println(e.getMessage());
According of above lines of code, I think there is a bug in JDBC. Because of this, I want to customize the ADF auto generated dml statement for EO and add 'select scope_identity() as pk_val' at the end of it to get the correct value of pk of inserted row.
Best Regards
Mehdy Karimpour

What do y o u mean by '... Does not work' exactly?
Do you get an error?
The code you call in the statement looks out of scope to me. It is executed in the DB which can't know what to do with it.
The other statements work as  they are normal insert wavelengths db can handle.
Timo

Similar Messages

  • How to call Apps Module Custom Method from Entity Object / View Object ?

    Hi All,
    I create a custom method in AppsModuleImpl.java. How can I call that custom method from a setter method on Entity Object / View Object ?
    (I have tried to use Configuration.createRootApplicationModule(amDef,config); but it is not the correct way, is it? )
    Below is my code :
    The setter on MyEntityImpl.java :
    public void setKodeprd(String value) {
    setAttributeInternal(KODEPRD, value);
    if (getProduct() != null) {
    // CALL the getSalesPrice custom method from here, HOW ??
    The Application Module custom method :
    public Number getSalesPrice(String priceCode, String kodePrd) {
    Number price = new Number(0);
    String [] theKey = {priceCode, kodePrd};
    Key priceKey = new Key(theKey) ;
    ViewObject SalesPrice = getSalespricedView1();
    Row[] salesPriceRow = SalesPrice.findByKey(priceKey, 1);
    price = ((SalespricedViewRowImpl)salesPriceRow[0]).getPrice();
    SalesPrice.remove();
    return price;
    Thank you for your help,
    xtanto

    inside the EntityObjectImpl :
    YourAppModuleImpl am = (YourAppModuleImpl)getDBTransaction().getRootApplicationModule().findApplicationModule("YourAppModuleorServiceName");

  • Custom Interface using Entity Objects

    Right now, we can only define cutom interfaces using the Generic Loader. I was wondering if this functionality is going to be extended so that users can define custom interfaces using EOs instead of lct files.

    Hi Mugunthan,
    I have the exact same requirement, to know a little bit more BC4J Support, since we want to use iSetup to control the load of our Receivables Custom Database Tables also. I have opened an SR and they have forwarded to the Receivables Team, which i do not believe will help us, since our need is to know technically the iSetup Custom Interface process for BC4J. Can you point me out some documentation on this? my e-mail contact is [email protected]
    Regards
    Thiago

  • Customizing Entity Object SQL Query prior to Insert?

    I am using an ADF BC Entity Object to store values from a multi-page form input process.
    At the end of the process, I plan to call a method that will programmatically take the values from the Entity Object and insert a new row to the database. I need to customize the query to add an encryption function to the insert for one of the fields. For example, instead of 'INSERT password' I need the SQL to be 'INSERT encrypt_fct(password)'.
    Is this possible and if so how?
    thanks

    Hi javaX
    Easiest way of achieving this in ADF BC is overriding the doDML method in your underlying EO's EntityImpl class. The following gives an example, assuming a table called users with username & password columns, where you wish to encrypt the password column with a SQL function named encrypt_fc:
    protected void doDML(int operation, TransactionEvent transactionEvent) {
      if (operation == DML_INSERT) {
        CallableStatement statement = null;
        String insertDML =
          "INSERT INTO users (username, password) VALUES (?,encrypt_fc(?))";
        statement =
          getDBTransaction().createCallableStatement(insertDML, 1);
        try {
          // Bind the statement parameters and execute the statement
          statement.setString(1, getUsername().toString());
          statement.setString(2, getPassword().toString());
          statement.execute();
        } catch (Exception ex) {
          throw new oracle.jbo.JboException(ex);
        } finally {
          try {
            statement.close();
          } catch (Exception nex) {
            /* Ignore */
      } else // operation == DML_UPDATE || DML_DELETE
        super.doDML(operation, transactionEvent);
    }Another way is to include the code for your encrypt function in your ADF model project. By this I mean convert the encrypt function to Java, then add it as a piece of code to your EntityImpl or a more generic library if needed elsewhere. This way you don't have to modify the doDML, but rather the EO setter routine to call your encyption function, and the unencrypted password isn't passed between ADF and the DB.
    Hope this helps.
    CM.

  • Error while deleting a row from the Entity Object

    Hi OAF Guys,
    i am unable to delete the newly created row from the entity object.
    let me explain my scenario.
    1. i have a table of which some of the columns are mandatory.
    2. I am writing the code in the validateEntity to check wether the user really enter anything into the fields.
    3. My problem is, when the user creates row and wanted to delete the row without entering any details, the validate entity of the EO gets fired which will not allows to delete the row.
    Is there any workaround for this problem.
    Regards,
    Nagesh Manda.

    Hi Tapash,
    I am very sorry for not providing you the complete details of my scenario. Here i am explaining
    1. what code you have placed while creating the row and in validation method on EOImpl.
    while creating a new row i am initializing the primary key of the EO with the sequence value.
    2.When you say, you are unable to delete the row, are you getting a error message ? if yes, custom message or fwk error ?
    its not the fwk error, its the custom message which wrote in my validateEntity method of EO to check whether the user had entered all the necesary columns or not.
    3.How are you trying to delete the row ?
    while the user clicks on the delete switcher i am getting the primary key of the row and searching for the row in the vo and finally deleting it.
    The problem arises when the user creates a row, and later doesnt want to enter the details and delete it. Here while deleting the row the validateEntity method of the EO gets fired and doesnt allow me to do so :(.
    Any way appreciate your help tapash.
    Regards,
    Nagesh Manda.

  • Uix two view-objects on one entity-object synchronize

    Hi All
    I want to add some uix pages to an old project using ADF UIX and Business Components.
    I have an entity object to a table witch about 50 fields.
    Now I create two view objects due to a better performance. One witch seven attributes for the overwiew and one with all attributes for the detail page.
    They are related via a view link.
    I create the overview as a read-only-table and the detail-page as an input-form.
    The proplem is that the synchronization don't work. The detail page shows the first dataset ever.
    Has anyone a solution or a tip where I can found that?
    Is where a performance problem if I use one view-object for both pages?
    Thanks in advance
    Roger

    Use custom DataAction for the first page:
    package controller;
    import oracle.adf.controller.struts.actions.DataAction;
    import oracle.adf.controller.struts.actions.DataActionContext;
    public class Class1 extends DataAction
      protected void validateModelUpdates(DataActionContext actionContext)
         //super.validateModelUpdates(actionContext);
          // put you custom validation here
    }http://www.oracle.com/technology/products/jdev/collateral/papers/10g/ADFBindingPrimer/index.html#usingdataaction
    Message was edited by:
    Sasha
    Message was edited by:
    Sasha

  • Problem with database schema objects in the entity object wizard

    Hi All,
    When creating a new entity object, I am facing a problem with database schema objects in the entity object wizard, database schema objects (check boxes for tables,synonyms...) are disabled. Actually I am using a synonym but I am not able to select the synonym check box.
    Can any of you folks tell me how to enable the database schema objects (check boxes for tables,synonyms...).
    Thanks in Advance.
    Raja.M

    Make sure your using rite version of jdeveloper..
    Make sure your using apps schema and check whether your able perform DML operations in the schema vis sql developer.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                           

  • HELP URGENT - Entity Object Substitution not working as advertised!!!!!

    Hi All,
    I have done an entity Object substitution and in order to rule out any coding errors on my part I have generated a fresh EO with no code changes in it and uploaded the files to java top and updated the MDS with the substitution.
    The substitution is successful but I get the following error related to my substituted file:
    oracle.apps.fnd.framework.OAException: oracle.jbo.AttrValException: JBO-27019: Get method for attribute "ItemNumber" in XxEgoMtlSystemItemsVLEOEx could not be resolved. at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:912) at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1169) at oracle.apps.fnd.framework.webui.OAPageBean.renderDocument(OAPageBean.java:3241) at oracle.apps.fnd.framework.webui.OAPageBean.renderDocument(OAPageBean.java:3036)
    ## Detail 0 ## java.lang.ClassCastException: oracle.jbo.server.EntityDefImpl incompatible with oracle.apps.fnd.framework.server.OAEntityDefImpl at oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl.getDefinitionObject(EgoMtlSystemItemsVLEOImpl.java:562) at oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl.getItemNumber(EgoMtlSystemItemsVLEOImpl.java:11324) at oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl.getAttrInvokeAccessor(EgoMtlSystemItemsVLEOImpl.java:6888)
    I think the real error is Detail 0 line but I haven't seen this before. Could this be the wrong version of JDeveloper that I have used????? About this page showed 12.1.2 and I have downloaded the JDev for 12.1.2???????
    Please help I need to sort this ASAP.
    Thanks all

    I have covered everything in the above threads and followed the EO substitution scenario exactly as per area51.
    I am now getting a different error on the EO substitution, when the page loads that creates a row in the EO the following error is displayed:
    Error
    1. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
    2. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
    3. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
    4. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
    This is a caught error and thrown to the top of the page as opposed to a complete stack error which is what I was getting before? At first I thought this was due to the VO substitution I had done earlier as a test but I have deleted the substitution document for the VO sub and if I remove my EO substitution the page works fine so my EO substitution is causing the problem.
    EO substitution was as follows:
    <Substitutes>
    <Substitute OldName ="oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEO" NewName ="xxsdg.oracle.apps.ego.item.eu.server.XxEgoMtlSystemItemsVLEOEx" />
    </Substitutes>
    Beginning of EO Code is as follows:
    package xxsdg.oracle.apps.ego.item.eu.server;
    import oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl;
    import oracle.apps.fnd.framework.server.OAEntityDefImpl;
    import oracle.jbo.AttributeList;
    import oracle.jbo.domain.Date;
    import oracle.jbo.domain.Number;
    import oracle.jbo.domain.RowID;
    import oracle.jbo.server.AttributeDefImpl;
    import oracle.jbo.server.EntityDefImpl;
    // --- 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 XxEgoMtlSystemItemsVLEOExImpl extends EgoMtlSystemItemsVLEOImpl {
    public static final int MAXATTRCONST = EntityDefImpl.getMaxAttrConst("oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEO");
    public static final int GLOBALATTRIBUTE11 = MAXATTRCONST;
    public static final int GLOBALATTRIBUTE12 = MAXATTRCONST + 1;
    public static final int GLOBALATTRIBUTE13 = MAXATTRCONST + 2;
    public static final int GLOBALATTRIBUTE14 = MAXATTRCONST + 3;
    public static final int GLOBALATTRIBUTE15 = MAXATTRCONST + 4;
    public static final int GLOBALATTRIBUTE16 = MAXATTRCONST + 5;
    public static final int GLOBALATTRIBUTE17 = MAXATTRCONST + 6;
    public static final int GLOBALATTRIBUTE18 = MAXATTRCONST + 7;
    public static final int GLOBALATTRIBUTE19 = MAXATTRCONST + 8;
    public static final int GLOBALATTRIBUTE20 = MAXATTRCONST + 9;
    public static final int ROWID = MAXATTRCONST + 10;
    private static OAEntityDefImpl mDefinitionObject;
    /**This is the default constructor (do not remove)
    public XxEgoMtlSystemItemsVLEOExImpl() {
    /**Retrieves the definition object for this instance class.
    public static synchronized EntityDefImpl getDefinitionObject() {
    if (mDefinitionObject == null) {
    mDefinitionObject =
    (OAEntityDefImpl)EntityDefImpl.findDefObject("xxsdg.oracle.apps.ego.item.eu.server.XxEgoMtlSystemItemsVLEOEx");
    return mDefinitionObject;
    /**Add attribute defaulting logic in this method.
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    ....

  • Entity object attribute with a list of objects

    Does anyone know how one sets up an entity object that has an attribute with a list of objects as the type? (assuming that's supported)
    as in:
    CREATE TYPE phones AS VARRAY(10) OF varchar2(10);
    Create table suppliers (supcode number(5),
    Company varchar2(20),
    ph phones);
    The SOA Suite in jDeveloper (new Entity Object/attributes etc) has an ARRAY that can point to REF or OBJECT. Neither work. When I try to Create DB Object later from the Entity Object I've created I get an invalid type.

    What you suggested about "validation codes on the VO" is not written on the ADF Documentation.
    I try to blindly/strictly follow best practices (particularly on Validations, using Declartive and/or built in validators) on most ADF documentation and blogs but there are many scenarios on coding some large ADF projects that I think must veer away from the best practices stated on the documentation or maybe add new rules on the documentation depending on how complex an ADF project would be.
    I religiously followed best practices stated on the documentation to use Entity and Attribute Validators when performing validations. What I did was i had created lots of Custom Validators (by implementing JboVAlidatorInterface interface) for each of the attributes on an Entity Object that need validated. So those validator is valid only for one attribute, its not reusable. And those validation codes either have reference to a ViewObject or call some PL/SQL procedure. So at some point are codes became messy.
    Ultimately the whole project became harder to manage when the codes became large. Now I am trying to refactor the whole application by separating it into project/package and I am hoping to do it with little Re-coding as possible.
    Hope to get your opinion on this one.
    regards,
    Anton

  • Creating Views on multiple entity-objects

    Dear Forum,
    Is it possible to make associations and lookups based on multiple entity-objects.
    I made a custom view, say view1 based on two entity-objects, say entity1 and entity2.
    I used some fields from entity1 and some from entity2. There's a 1 to 1 association between the index of entity1 and entity2.
    Now I want to make a master-detail between entity1 and view1. I tried to make links and associations, but that didn't work.
    Any ideas?
    Kind regards,
    Arjen

    Arjen,
    I am a bit confused by what it is you need. It appears you may have Entity Object and View Objects mixed up. Entity Objects are one-to-one with database tables. So, for every table one Entity Object, and the other way around. Associations are, pretty much, one-to-one with foreign keys on the database. So, if two tables have a foreign key between them, the two Entity Objects will have an Association between them. In that respect, Entity Objects and Associations are usually 'strictly defined' by the database model.
    The layer of View Objects and View Links is where you 'get design control' in the Business Components arena. A View Object can be based on zero, one or more Entity Objects. Viewlink, defining 'Master-Detail' relationships between View Objects (and NOT Entity Objects!!) can but don't have to be based on Entity Associations (i.e. foreign keys), but can be based on any attribute in the 'Master' view to any attribute in the 'Detail' view.
    In this respect, your statement that you want to "make a master-detail between entity1 and view1" makes no sense. It sounds like you need to create a View2, and then make a View Link between View1 and View2.
    Kind regards,
    Peter Ebell
    JHeadstart Team

  • Extended but NOT polymorphic Entity Object ?

    Hi,
    We are trying to implement the OO features of ADF BC, i.e : Inheritance and Polymorphism, to reuse the logic in EO. I need some confirmation below to make sure we apply it correctly :
    1) We can Extend Entity Object WITHOUT assigning any discriminator, can't we ?
    (this is what I call Extended but NOT polymorphic )
    If the answer is yes , then I have further question :
    2) In our Order Processing module of our ERP application, there are following entity object : SalesOrder, Invoice, SalesReturn, CreditNote
    And there are four underlying database tables : SalesOrder, Invoice, SalesReturn, CreditNote.
    They are surely DIFFERENT transaction BUT they have COMMON attributes (and validation), This is why I call it "Extended but NOT polymorphic".
    The common attributes are :
    - DocID (PK)
    - DocNumber
    - DocDate
    - Warehouse
    - Customer
    - Salesman
    - TermOfPayment
    - DueDate
    So I create one BaseOrderEntity as super class entity. Then I create four entity objects that extend the base entity :
    Entity : SalesOrder, Extend : BaseOrderEntity, Database Object : SalesOrder
    Entity : Invoice, Extend : BaseOrderEntity, Database Object : Invoice
    Entity : SalesReturn, Extend : BaseOrderEntity, Database Object : SalesReturn
    Entity : CreditNote, Extend : BaseOrderEntity, Database Object : CreditNote
    Is this the correct way to apply it ?
    In other word, is this the correct use case ?
    Thank you very much,
    xtanto.

    Starting in JDeveloper 10.1.2, the ADF runtime throws an error if it detects that you have a superclass and subclass entity objects without properly-configured discriminator attributes. If you do not intend to instantiate the superclass, just assign it a descriminator attribute with a value that will never occur in real-life, like NULL or 'x' or whatever.
    It will be simplest if all your family of subclasses were stored in the same table, although that is not required. It simply makes the polymorphic queries easier.
    If you want to avoid the runtime check for the discriminator's being properly configured, because you know that your application will never run the chance of loading the same row into the entity cache as two different entity definition types, then you can get a property jbo.abstract.base.check in your configuration (or as a System property) to the value false and then the check is not performed.

  • Error when running the entity object

    Hi Experts,
    I am learning OAF. I created Application Module, and entity object for table emp and shcema apps.
    While running entity object, it's throwing the following error.
    Error(17,14): class practice_test_prc1.oracle.apps.mfg.simplepg.schema.server.EmpImpl should be declared abstract; it does not define method setLastUpdateLogin(oracle.jbo.domain.Number) of class oracle.apps.fnd.framework.server.OAEntityImpl
    I changed the EmpImpl class as abstract;error was rectified.
    I wanted to know why it's is giving that error, Did i make any mistake while creating the entity object?
    Awaiting your response.
    Thanks in advance.

    Hi,
    ---The custom table should contain who columns in table structure.
    CREATED_BY Number,
    CREATION_DATE Date,
    LAST_UPDATE_DATE Date,
    LAST_UPDATED_BY Number,
    LAST_UPDATE_LOGIN Number
    Refer:
    How to create a new EO in OAF?
    Regards
    Meher Irk

  • Entity object enum mapping

    Hi all,
    I'm using JDeveloper 11g, EntityObjects, and ADF Faces.
    I have a database field VARCHAR2(1), and its possibles values are "A", "B" and "M", and I want to map is as an enum due to its internationalization. I've created my enum class, and I create the entity object related with this table, but when I try to change the type from String to my enum class, I click in "Browse" button, but my enum class is not visible in the class hierarchy.
    Is there another way to implement this? What am I doing wrong?
    Thank you
    Joseba

    Hi,
    attributes in ADF BC use domains to map custom data types. However, you don't need an enum class in the EO if the sole purpose is to provide a list of allowed values for the attribute. Have a look at the LOV option for ViewObjects, which allows you to create a static VO with the allowed choices and then map these to teh attribute. Please read the developer guide about domains in ADF BC
    Frank

  • Entity Object's "addNewRow" Permission, how to implement?

    Hi,
    this is a generic question about an implementation strategy to be followed for ADF Authorization.
    I've been researching the definition of permissions at the entity object level, and successfully tested the 3 permission targets available: read, update, removeCurrentRow.
    However, I'd actually need the full set of permission targets for CRUD operations, which means that ADF lacks an "addNewRow" to secure row creation on EOs.
    What should be the strategy to implement that?
    Is it a planned feature so waiting till, say, 11g Release 2 should bring it to the table, or has it been left out by design and thus it just won't be added? In the latter case, how to actually implement it?
    I'd need to actually hide/disable the Create/CreateInsert button on my edit pages if the underlying EO does not allow new row creation for the current role. I gave a thought to EO's Custom Properties as a way to handle that extra permission flag, but is it a viable way? Can they be accessed through EL so that I can, say, use them directly in the Rendered/Disabled property of the button to regulate access?
    Or would you suggest another strategy altogether?
    Please share your ideas.
    thanks,
    RickyS

    Well, I can definitely see some benefits in having security at the model layer, at least in our scenario. In a complex app with many edit pages often dealing multiple times with the same EOs, having to specify a single set of policies on the EO itself and see it automatically implemented on every page seems a plus and a step ahead from 10g - not that I tried Security in 10g, but I know the approach. Seeing fields automatically become read-only or datacontrol operation buttons such as Delete become disabled without specifying anything on the page is cleaner and will speed up development a bit, too (for large numbers of pages that might be significant, on a small app it's probably irrelevant).
    Probably not as useful and powerful as model-driven lists, but still a welcome feature. You probably have a point about the double mainteinance, but that may be avoided if the BC layer security truly encompasses everything (e.g. if I can't rely on a "create" permissions, I'll certainly have to maintain additional code as well as additional BC data such as custom properties to deal with that, and this is even worse).
    Another point is that I might want to enable/disable functionality on the page via EL/backing bean based on BC permissions, and that seems useful. Being able to express a condition like "this EO is accessible" or "this attribute is accessible" is sometimes much superior to "user belongs to this role". It's better to decouple roles from the secured targets and just use the latter, IMHO. Especially becuse we'll likely won't have a fixed set of static roles defined in advance for all customers we'll deploy our webapp to.
    Just my 2 cents, anyway, you might end up being totally right :-)
    Cheers,
    RickyS

  • How insert into another entity object

    Hi ,
    i hope find the solution for this case
    i am using jdeveloper 11.2
    and i have two entity object based on two table as follow
    1 - DocTransaction entity
    Attributes ( id , createdOn, createdBy ,modifiedOn,modifiedBy , docStatus-- default = 1-- , EmpId )
    2- transHistory entity
    Attributes ( id , transId--FK-- , Transdate, TransBy ,ToEmp , docStatus , docAction )
    when inserting row in DocTrasaction it will insert row in transHistory and when update docStatus in DocTransaction it will insert row with updated status in transHistory and so on ( every DML in first entity ocure will insert it in first entity )
    the problem is when docStatus updated after 7 days from creation with value (2 or 5 ) i want the row inserted in second entity with docStatus = 3 not ( 2 or 5 )
    and if docStatus in first entity not updated within 7 days then automatically change its status to 3
    my incomplete code in DocTrasactionImpl as follow
    *protected void doDML(int operation, TransactionEvent e)  {*
    super.doDML(operation, e);
    *if (operation == DML_INSERT) {*
    EntityDefImpl secDef = TranshistoryImpl.getDefinitionObject();
    TranshistoryImpl insert = (TranshistoryImpl)secDef.createInstance2(getDBTransaction(), null);
    insert.setTransId(this.getId().getSequenceNumber());
    insert.setTransBy(this.getCreatedBy());
    insert.setToEmp(this.getEmpId());
    insert.setDocStatus(this.getDocStatus());
    insert.setTransStatus(new Number(1));       // transaction still open
    *if (operation == DML_UPDATE) {*
    *// insert into history when update the status by user to 2 or 5 before 7 days from created the task*
    Date today = new Date();
    Long dateDiff =(today.dateValue().getTime())-(getCreatedOn().dateValue().getTime());
    Boolean checkBefore=( (this.getDocStatus().intValue() == 2 && dateDiff <=7 )||( this.getDocStatus().intValue() == 5 && dateDiff<=7)) ; // change status before 7 days
    Boolean checkAfter=( (this.getDocStatus().intValue() == 2 && dateDiff > 7 )||( this.getDocStatus().intValue() == 5 && dateDiff > 7)); // change status after 7 days
    if  ( checkBefore )      // update by user
    EntityDefImpl secDef = TranshistoryImpl.getDefinitionObject();
    TranshistoryImpl insert = (TranshistoryImpl)secDef.createInstance2(getDBTransaction(), null);
    insert.setTransId(this.getId().getSequenceNumber());
    insert.setTransBy(this.getModifiedBy());
    insert.setToEmp(this.getEmpId());
    insert.setDocStatus(this.getDocStatus());
    insert.setTransStatus(new Number(2)); //close transaction
    else  if  (checkAfter )  // update by user
    EntityDefImpl secDef = TranshistoryImpl.getDefinitionObject();
    TranshistoryImpl insert = (TranshistoryImpl)secDef.createInstance2(getDBTransaction(), null);
    insert.setTransId(this.getId().getSequenceNumber());
    insert.setTransBy(this.getModifiedBy());
    insert.setToEmp(this.getEmpId());
    insert.setDocStatus(new Number(3));//رد متأخر
    insert.setTransStatus(new Number(2));// close transaction
    this code not working will and also how can i update the docStatus automatic after 7 days from value 1 to 3
    thank you
    }

    What is not working, your logic when to create/update or new EO rows itself are not getting updated or created ?
    Amit

Maybe you are looking for

  • Can I use my Apple ID on another Mac?

    Here's the deal: I have a Mac Pro that I use at home with my own, personal Apple ID. I want to buy a Mac for my business and want to have two user accounts on there. One for the business which will have its own, separate Apple ID, and one for my pers

  • Settlement rule error

    Hi, I am facing as issue while settling costs to internal order. The system is giving warning message "Enter a percentage, equivalence number, or amount" Diagnosis You have entered at least one distribution rule which contains neither a percentage no

  • Delete condition records in VA01

    Hi,    I am trying to write a BDC for VA01. There are SOME(not all) unwanted condtion records comming. how can i remove those condition records (Goto - > Header - > Conditions) thru BDC. Regards, Naveen Vishal

  • Adding Airport card to 867mhz Ti Powerbook?

    Hi, I have a 867mhz Titanium Powerbook that i need to add an Airport card too, how do do this and what will it (roughly) cost?

  • How do you view iPhoto pictures in iPad?

    How can I view the pictures that I saved in my MacBook Pro's iPhoto to my iPad? I read you can do it through iTunes, but how?