Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to skip validation during create insert in application module java code? (JDev 12.2.1.2)

Mehdi EsteghamatianMay 21 2017 — edited May 23 2017

Dear Experts,

I have the below java code as part of an application module java code which creates and inserts a new row.

The problem is that when call it, the required field error message pops up although the user hasn't commit the changes and he is supposed fill in the required fields.

I am looking for a way to suppress the validation until the next commit operation.

Any clue/suggestion is much appreciate it.

Jake

Attribute "receiving personnel" in Ast Exchange Items is required.

public String addNewEchangeItemRow(Object newExchangeId, String Id, String OwnerId) {
    _logger.info("addNewEchangeItemRow start");
  
    DCBindingContainer bindings = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
  
    ViewObjectImpl astExchangeItemsVO = getAstExchangeItemsVO();          
    RowSetIterator rsi = astExchangeItemsVO.findRowSetIterator("AstExchangeItemsVOIterator");
  
    if (rsi == null)
        rsi = astExchangeItemsVO.findRowSetIterator(null);
  
    //get handle to the last row
    Row lastRow = rsi.last();
  
    //obtain the index of the last row
    int lastRowIndex = rsi.getRangeIndexOf(lastRow);
  
    //create a new row
    Row newRow = rsi.createRow();
  
    //initialize the row
    newRow.setNewRowState(Row.STATUS_INITIALIZED);
  
  
    // setup new attributes
    newRow.setAttribute("AsetId", Id);
    newRow.setAttribute("PrsnId", OwnerId);
    newRow.setAttribute("Id", newExchangeId);
  
    //add row to last index + 1 so it becomes last in the range set
    rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
  
    //make row the current row so it is displayed correctly
    rsi.setCurrentRow(newRow);                    

    _logger.info("addNewEchangeItemRow end");
    return null;
}
This post has been answered by Timo Hahn on May 22 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2017
Added on May 21 2017
8 comments
556 views