Friday, 12 July 2013

Set DFF Segment Required in OA Framework

In processRequest or processFormRequest Use this code.....

OADescriptiveFlexBean oaDFF = (OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FlexField"); // put your dff web bean name here
oaDFF.processFlex(pageContext);


// If you want to set the first Dff (first dff shown in the page) to required then

OAMessageChoiceBean FirstDff = (OAMessageChoiceBean)oaDFF.findIndexedChild("FlexField0");

if (FirstDff != null)
{
FirstDff .setRequired("yes"); // Try to access the value here using getText() or getValue() methods..
}


// If you want to set the  second DFF (second dff shown on page) then

OAMessageChoiceBean SecDffe = (OAMessageChoiceBean)oaDFF.findIndexedChild("FlexField1");

 {
SecDffe .setValue("Default value string"); // Try to access the value here using getText() or getValue() methods..
}

 ========================================================================

OADescriptiveFlexBean oaDFF = (OADescriptiveFlexBean)webBean.findChildRecursive("FlexDFF"); // put your dff web bean name here
oaDFF.processFlex(pageContext);

Enumeration dffElements= null;
dffElements= oaDFF.getChildNames();
while(dffElements.hasMoreElements())
    {
       String DffName = (String)dffElements.nextElement();
       OAWebBean dffbeans=(OAWebBean)oaDFF.findChildRecursive(DffName );
      if(dffbeans != null)
       {                   
           dffbeans.setRequired(OAWebBeanConstants.REQUIRED_NO);
         }

   }
 


6 comments:

  1. Hi Kishore,can you please confirm, is it code working.. it is not working for me. I have changed instead off Message choice to Message test input
    getting below error oracle.apps.fnd.framework.webui.beans.form.OAFormValueBean cannot be cast to oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean

    ReplyDelete
    Replies
    1. Please help on this to resolve the issue

      Delete
  2. OADescriptiveFlexBean oadescriptiveflexbean = (OADescriptiveFlexBean)webBean.findIndexedChildRecursive("HzAddressStyleFlex");
    pageContext.writeDiagnostics(this,"oadescriptiveflexbean value is : " +oadescriptiveflexbean, 1);
    oadescriptiveflexbean.processFlex(pageContext);

    OAMessageTextInputBean addressLine = (OAMessageTextInputBean)oadescriptiveflexbean.findIndexedChildRecursive("HzAddressStyleFlex0");
    pageContext.writeDiagnostics(this,"addressLine value is : " +addressLine, 1);
    if(addressLine!=null){
    addressLine.setRequired("yes");
    }

    OAMessageTextInputBean city = (OAMessageTextInputBean)oadescriptiveflexbean.findIndexedChildRecursive("HzAddressStyleFlex4");
    pageContext.writeDiagnostics(this,"City value is : " +city, 1);
    if(city!=null){
    city.setRequired("yes");
    }

    ReplyDelete
  3. I have tried the same but am getting null pointer exception while accessing segment city

    ReplyDelete
  4. OADescriptiveFlexBean oaDFF = (OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FlexField"); // put your dff web bean name --> How to determine the dff web bean name ?

    ReplyDelete
  5. I have dff enabled on /oracle/apps/imc/ocong/party/organization/webui/ImcOrgProfilePage and DFF Party Information (receivables application). This is context based DFF and I want to get the dff value in my controller. How can i get this ?

    ReplyDelete