How To change the ADF View Object  query where-clause at RunTime?

I am trying to create a simple display page which will display user data (username, assoc_dist_id, assoc_agent_id, status , etc). The User data is stored in a database table and i am using an ADF Read Only table based on the View Object to display the data on the JSF page.
However, i want to display only the users that a particular person accessing the page has the AUTH LEVEL to see. e.g. If the person accessing the page is an 'ApplicationAdministrator' then the page should display all users in the table, If its a 'DistributorAdministrator' then the page should display only users associated with that Distributor (i.e. assoc_dist_id = :p_Dist_id ) and If its an 'AgentAdministrator' , then the page should display only users associated with that Agent ( i.e. assoc_agent_id = :p_Agent_id).
Currently my af:table component displays all the users in the table because the query for the view object is (select * from users) . However, i want to use the same viewobject and just set the where-clause at runtime with the appropriate parameter to restrict the dataset returned.
Do anyone knows how to accomplish this ?

David,
See the custom method initializeDynamicVariableDefaults() in the SRViewObjectImpl.java class in the FrameworkExtentions project in the SRDemoSampleADFBC sample application. You can find out how to install the demo if you haven't already from the ADF Learning Center at:
http://www.oracle.com/technology/products/adf/learnadf.html
This class is a framework extension class for view objects that adds a neat, generic feature to be able to dynamic default the value of named bind variables. You can read more about what framework extension classes are and how to use them in Chapter 25, "Advanced Business Components Techniques" of the ADF Developer's Guide for Forms/4GL Developers, also available at the learning center above.
It is an example of generic framework functionality that "kicks in" based on the presence of custom metadata properties on a named bind variable. See section 25.3.3 "Implementing Generic Functionality Driven by Custom Properties" in the dev guide for more details. Using this sample code, if you add a bind variable to a view object, and define a custom metadata property named "DynamicDefaultValue" on that bind variable, and set this custom metadata property to the value "CurrentUser", then that bind variable will have its value dynamically defaulted to the name of the authenticated user logged in. If instead you set this custom property to the value "UserRole", then the bind variable will be set to the comma-separated string containing the list of roles that the authenticated user is part of.
Once you've created a framework extension class for view objects like this, you can have the view objects you create inherit this generic functionality.See section 25.1.4 "How to Base an ADF Component on a Framework Extension Class" in the dev guide for more info on this.
By adapting a technique like this (or some idea similar that better suits your needs) you can have your view object query contain bind variables whose values automatically take on the defaults based on something in the user-session environment.

Similar Messages

  • How to change the default view of published iCal's URL

    I am publishing an iCal for a nonprofit group and link to the calendar from the group's website. The default URL given (in the send publish email option) leads to the week view of the current week. I would prefer the link to take site visitors to the month view of the calendar. If I go to the month view and copy the URL for it, and use that for the link, I have to change the URL each month, because the URL that comes from the month view will only show the month it was at the time I copied the URL -- it will not change with the new month. Does anyone have any idea of how I can change the URL so that it leads to the month view of whatever the current month is?
    I should note that I know how to change the default view in the my browser, but I would rather not have to explain how to do this to all the people viewing the calendar -- just wanting the correct month view to show up when they click the link, without having to change it each month.
    I would be so grateful if anyone has some insight on this!
    Thanks.

    Carlo,
    The fact that this question has been left unanswered for over 2 months seems a little negligent on the part of Apple Support.
    This Forum is unfortunately not Apple Support. According to Apple:
    What is Apple Discussions and how can it help me? 
"Apple Discussions is a user-to-user support forum where experts and other Apple product users get together to discuss Apple products. You'll find a wealth of information about your favorite Apple hardware and software products that will help you get the most out of your purchase. You can participate in discussions about various products and topics, find solutions to help you resolve issues, ask questions, get tips and advice, and more.
    If you have a technical question about an Apple product, be sure to check out Apple's support resources first by consulting the application Help menu on your computer and visiting our Support site to view articles and more on our product support pages."
    In direct response to your questions, I would say that (as observed by the OP) anyone who subscribes to a published calendar can make a change to their desired view using the "Preferences" icon which is displayed underneath the mini-month calendars.
    There is no way that I know of to directly or conveniently change the time-range. There may be workarounds, but I could not find a suitable solution for you.
    I would recommend that you provide iCal Feedback, if you are interested in informing Apple of your desires.
    ;~)

  • How to change the Workflow Business Objects

    Hi,
    How to change the Workflow Business Objects. I need to add custom code to the Method. can I create only custom method or I need to copy the existing object to Custom object .
    Thanks
    Niranjan

    Hi,
    Check the following link:
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://www.sapmaterial.com/badi.html
    Regards,
    bhaskar

  • How to reference the Parent view Object attribute in Child View object

    Hi , I have the requirememt to generate Tree like struture to display Salary from joining date to retirement date in yearly form.I have writtent two Pl/SQL function to return parent node and child nodes(based on selected year).
    1.First function --> Input paramter (employee id, retirement date , joining date) --> return parent node row with start_date and end_date
    2. 2nd function --> input paarmter(employee id, startDate, end_date) --> return child node based on selected parent node i.e. start date and end date
    I have created two ADF view object based on two function return
    Parent Node --> select * from Table( EUPS.FN_GET_CONTR_SAL_BY_YR(employeeId,retirement Date, dateOf joining)) ;
    Child Node --> select * FROM TABLE( EUPS.FN_GET_CONTR_SAL_FOR_YEAR( employeId,startDate, endDate) ) based on selected parent node.
    I am giving binding variable as input for 2nd function (child node) . I don't know how to reference the binding variable value in child view from parent view.
    Like I have to refernce employeId,startDate, endDate values in 2nd function from parent view object. some thing like parentNode.selectedStart_date parentNode.employeeId.
    I know we can achive this writing the code in backing bean.But i want to know how can we refernce parent view object attribute values in child view object using Groovy or otherway?
    I will appreciate your help.
    Thanks

    I have two view com.ContractualSalaryByYearlyView for Parent Node and com.ContractualSalaryByYearlyView for child Node.
    I have created view link(ContractualSalYearlyByYearViewLink) betweem two view by giving common field empId, stDate , endDate.(below is the view link xml file).
    I tried give the binding attribute values using parent object reference like below in com.ContractualSalaryByYearlyView xml file but getting error
    Variable ContractualSalaryByYearlyView not recognized.I think i am using groovy expression.
    Thanks for quick response.
    com.ContractualSalaryByYearlyView xml
    <ViewObject
    <DesignTime>
    <Attr Name="_isExpertMode" Value="true"/>
    </DesignTime>
    <Variable
    Name="empId"
    Kind="where"
    Type="java.lang.Integer">
    <TransientExpression><![CDATA[adf.object.ContractualSalaryByYearlyView.EmpId]]></TransientExpression>
    </Variable>
    ContractualSalYearlyByYearViewLink.xml file
    <ViewLinkDefEnd
    Name="ContractualSalaryByYearlyView"
    Cardinality="1"
    Owner="com.ContractualSalaryByYearlyView"
    Source="true">
    <DesignTime>
    <Attr Name="_finderName" Value="ContractualSalaryByYearlyView"/>
    <Attr Name="_isUpdateable" Value="true"/>
    </DesignTime>
    <AttrArray Name="Attributes">
    <Item
    Value="com.ContractualSalaryByYearlyView.EmpId"/>
    <Item
    Value="com.ContractualSalaryByYearlyView.StDate"/>
    <Item
    Value="com.ContractualSalaryByYearlyView.EndDate"/>
    </AttrArray>
    </ViewLinkDefEnd>
    <ViewLinkDefEnd
    Name="ContractualSalaryForYearView"
    Cardinality="-1"
    Owner="com.ContractualSalaryForYearView">
    <DesignTime>
    <Attr Name="_finderName" Value="ContractualSalaryForYearView"/>
    <Attr Name="_isUpdateable" Value="true"/>
    </DesignTime>
    <AttrArray Name="Attributes">
    <Item
    Value="com.ContractualSalaryForYearView.EmpId"/>
    <Item
    Value="com.ContractualSalaryForYearView.StDate"/>
    <Item
    Value="com.ContractualSalaryForYearView.EndDate"/>
    </AttrArray>
    </ViewLinkDefEnd>

  • How to not have your view objects query before the page comes up?

    Hello. I have a view object that is part of a LOV. This view object always gets queried on bringing up the page (I need it to happen on the LOV click) How can I have the VO not queried initially? I tried setting the Iterator to refresh never, but it still does it. Here's the log before the page comes up:
    [363] BindingContext.put( ContactsAMDataControl@irepair_DataBindings_cpx, oracle.jbo.uicli.binding.JUApplication )
    [364] Resolving VO:ContactsVVO1 for iterator binding:ContactsVVO1Iterator
    [365] Changing iterator range size from :1 to :25
    [366] ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [367] Column count: 13
    [368] ViewObject: ContactsVVO1 Created new QUERY statement
    [369] ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [370] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [371] Bind params for ViewObject: ContactsVVO1
    [372] DCUtil, returning:oracle.adf.model.binding.DCParameter, for ContactsAMDataControl
    [373] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [374] Column count: 13
    [375] ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 Created new QUERY statement
    [376] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [377] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [378] Bind params for ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1
    Thanks!
    Edited by: user621288 on Jun 17, 2009 4:11 PM

    There are two ways:
    1. Uncheck "Query List Automatically" under List UI Hints in the view object overview xml.
    2. In the query add "where 1=:bnum and 1 is not null" and execute the query in the LaunchPopupEvent
        public void userIdId_launchPopupListener(LaunchPopupEvent launchPopupEvent) {
            DCIteratorBinding myListIter = (getItrtBindings("MyLovViewObj1Iterator"));
            ViewObject vo = myListIter.getViewObject();
            NavigatableRowIterator myItemList = myListIter.getNavigatableRowIterator();
            Row row = myItemList.first();
            Object[] val = row.getAttributeValues();
            ViewRowSetImpl vor = (ViewRowSetImpl)val[row.getAttributeCount() - 1];
            vor.setNamedWhereClauseParam("bnum", new BigDecimal(1));
            vor.executeQuery();
        }

  • How to change the text of object icon

    Hi Freinds ,
    We have just upgraded to EEC 6.0 ,
    when the user is loging in french language the text for the object icon (Job)  on OM is the same as object icon (position) .
    Is there a way in which you can change the text for the object icon :
    Regards
    Lakshmi

    Hi Sikindar ,
    We use different languages in different countries , when using the transaction PPOME , The text against icon JOB : appears to be the same as position in french language but  when we log in english it shows the correct text that is JOB ,
    Which report are you talking about .

  • How to Change the Format of Object.................

    Hi,
    The client is asking us to change the format of the out of th object into another format.
    With The existing format the result is DisplayFare: 4,673.23
    and the formula used is :
    WhilePrintingRecords;
    global currencyvar DisplayFare;
    global currencyvar array PaxFare;
    global numbervar num;
    if {fld.Fld1}= 'IPAX' then
        DisplayFare := PaxFare[num];
    DisplayFare;
    But client want the same in different format DisplayFare:4 673,22.
    For what changes i needs to do...................please do the needful.
    Regards,
    Maheedhar

    Hi Maheedhar,
    The only difference I see if that the required format does not have a thousands separator (Or does it have space as the separator?) and it uses a comma as the decimal separator.
    You can right-click the field > Format Field > Customize > In here you should be able to change the Decimal separator, Thousands separator etc.
    -Abhilash

  • ADF View Object query to use Oracle  LONG data type

    Hi,
    I'm using a view object that uses Oracle LONG data type.The following exception is thrown
    *"java.sql.SQLException: Stream has already been closed"* and it is not fetching the correct data.
    I have searched in many forums,they suggested to use LOB instead of LONG as LONG is deprecated. But in my case I can't avoid using LONG as some of my legacy applications using the same DB.
    Please suggest me a way
    Thanks in Advance
    Felix

    Thanks for your reply Arun,
    I have solved this problem using the solution suggested by this blog [AskTom-Link|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:839298816582]
    In the above blog link,they have suggested to convert Long to Varchar by functions and asked to use this function in the column.
    Thank you all guys who have seen this post.
    Regards,
    Felix

  • May I know how to confighure the ADF views,Entity to load while startup

    Hi,
    I want to load some lookup tables i.e adf views/entities while starting server. May I know how I can confighure that in oc4j?
    Thanks,

    user528306,
    You might be able to use startup classes, or a startup servlet.
    Good Luck,
    Avi.

  • ADF BC View Objects: Disappearing where clauses

    Playing around with the 11g Technical Preview I find out that sometimes the where clauses - added to View Objects by means of the new "Join Type" field in the VO-editor UI - disappear.
    I'm not able to reproduce exactly and "on demand", but it seems to happen when the sources of more than one View Object are open simultaneously and/or the XML definition of a View Object is edited directly on the Source-tab.

    Today I succeeded in reproducing:
    Two tables:
    TAB_MASTER:
    ID NUMBER NOT NULL
    DESCRIPTION VARCHAR2 NOT NULL
    TAB_DETAIL:
    ID NUMBER NOT NULL
    MASTER_ID NUMBER NOT NULL
    DESCRIPTION VARCHAR2 NOT NULL
    TAB_DETAIL.MASTER_ID is a foreign key referencing TAB_MASTER.ID.
    Steps to reproduce:
    1. Generate default ADF BC objects from database tables.
    2. Open definition of TAB_DETAIL View Object.
    3. Go to the Entity Objects tab
    4. Add TAB_MASTER Entity Object to the Selected Entities Objects. Association and Join Type are filled in automatically.
    5. Go to the Query tab and go to SQL tab in de Property Inspector. Where clause is filled.
    6. Go to the Attributes tab and click Add from Entity...
    7. Add TAB_MASTER.DESCRIPTION attribute.
    8. Again, go to the Query tab and go to SQL tab in de Property Inspector. Where clause is still filled.
    9. Go to the Attributes tab and select MASTER_ID attribute.
    10. Click icon to add List Of Values
    11. In List Of Values dialog add View Object TAB_MASTER and add the correct pairs of List Return Values for the ID and (MASTER) DESCRIPTION attributes.
    12. After completing the List Of Values dialog go to the Query tab -> SQL tab again. The where clause added to join the Entity Objects (see step 5.) is cleared, resulting in a wrong SQL statement for the View Object.

  • How to Change the Text Box to LOV where the Text Box displayed dynamically

    Hi All,
    I have to Change the Text Box to LOV. But the Text Box is not the static one.
    In the Expense Screen, when i select the particular expense type, additonal infomation is getting displayed.
    There is a one additional field called 'Portfolio Code' . This is a text Box. I need to change this as LOV.
    Even i am not sure how this is getting displyed. This column is mapped to attriubte14 of AP_EXPENSE_LINES_ALL table.
    Please advice
    Thanks,
    Mani

    Controller code continues
    private void createDirectBinding(OAWebBean oawebbean, String s, AttributeKey attributekey, String s1, String s2)
    OAWebBean oawebbean1 = oawebbean.findChildRecursive(s);
    oawebbean1.setAttributeValue(attributekey, new OADataBoundValueViewObject(oawebbean1, s2, s1));
    private void createDirectBinding(OAWebBean oawebbean, String s, AttributeKey attributekey, String s1)
    OAWebBean oawebbean1 = oawebbean.findChildRecursive(s);
    oawebbean1.setAttributeValue(attributekey, new OADataBoundValueViewObject(oawebbean1, s1, "DetailsPagePVO"));
    private void processRequestNormalDetails(OAPageContext oapagecontext, OAWebBean oawebbean)
    OAMessageChoiceBean oamessagechoicebean = (OAMessageChoiceBean)oawebbean.findChildRecursive("ExpTypeChoice");
    oamessagechoicebean.setPickListCacheEnabled(false);
    oamessagechoicebean = (OAMessageChoiceBean)oawebbean.findChildRecursive("GuestType");
    oamessagechoicebean.setPickListCacheEnabled(false);
    OAMessageTextInputBean oamessagetextinputbean = (OAMessageTextInputBean)oawebbean.findChildRecursive("Justification");
    if(oamessagetextinputbean != null)
    oamessagetextinputbean.setWrap("soft");
    createDirectBinding(oawebbean, "ExpTypeChoice", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "StartDate", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "Justification", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ExpenseGroup", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "LocationName", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "RBLocation", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "DetailMerchantName", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "DetailTaxClassification", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "DetailTaxCode", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "TaxRegNumber", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ReceiptNumber", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "Reference", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "TaxpayerID", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "AirTravelType", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "AirTicketClass", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "AirTicketNumber", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "AirFromLocation", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "AirToLocation", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "AccEndDate", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "MealNumberAttendees", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "MealAttendees", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "DetailDailyRate", STYLE_CLASS_ATTR, "DetailDailyRateCSS");
    createDirectBinding(oawebbean, "NumberOfDays", STYLE_CLASS_ATTR, "DetailDailyRateCSS");
    createDirectBinding(oawebbean, "DetailReceiptAmount", STYLE_CLASS_ATTR, "DetailReceiptAmountCSS");
    createDirectBinding(oawebbean, "ReceiptCurrencyChoice", STYLE_CLASS_ATTR, "ReceiptCurrencyChoiceCSS");
    createDirectBinding(oawebbean, "InverseExchRate", STYLE_CLASS_ATTR, "DetailExchRateCSS");
    createDirectBinding(oawebbean, "ExchRate", STYLE_CLASS_ATTR, "DetailExchRateCSS");
    createDirectBinding(oawebbean, "DetailDailyRate", CURRENCY_CODE, "ReceiptCurrencyCode");
    createDirectBinding(oawebbean, "DetailReceiptAmount", CURRENCY_CODE, "ReceiptCurrencyCode");
    createDirectBinding(oawebbean, "DetailReimbursAmt", CURRENCY_CODE, "ReimbursementCurrencyCode");
    createDirectBinding(oawebbean, "ParentGuestTypeSortableHeader", REQUIRED_ATTR, "FB_GuestTypeColReq");
    createDirectBinding(oawebbean, "ParentGuestNameSortableHeader", REQUIRED_ATTR, "FB_GuestNameColReq");
    createDirectBinding(oawebbean, "ParentGuestTitleSortableHeader", REQUIRED_ATTR, "FB_GuestTitleColReq");
    createDirectBinding(oawebbean, "ParentGuestTaxIdSortableHeader", REQUIRED_ATTR, "FB_GuestTaxIdColReq");
    createDirectBinding(oawebbean, "ParentGuestEmployerSortableHeader", REQUIRED_ATTR, "FB_GuestEmployerColReq");
    createDirectBinding(oawebbean, "ParentGuestEmployerAddrSortableHeader", REQUIRED_ATTR, "FB_GuestEmployerAddressColReq");
    String s = oapagecontext.getParameter("source");
    String s1 = oapagecontext.getParameter("event");
    if("StartDateUpdate".equals(s1) && "StartDate".equals(s))
    setFocusToField("StartDate", oawebbean);
    } else
    if("AmountUpdateReceiptCurrency".equals(s1) && "ReceiptCurrencyChoice".equals(s))
    setFocusToField("ReceiptCurrencyChoice", oawebbean);
    private void processRequestItemizationDetails(OAPageContext oapagecontext, OAWebBean oawebbean)
    OAWebBean oawebbean1 = oawebbean.findChildRecursive("ItemizedDetails");
    OAMessageChoiceBean oamessagechoicebean = (OAMessageChoiceBean)oawebbean1.findChildRecursive("IPL_ExpTypeChoice");
    oamessagechoicebean.setPickListCacheEnabled(false);
    OAMessageChoiceBean oamessagechoicebean1 = (OAMessageChoiceBean)oawebbean1.findChildRecursive("ChildExpTypeChoice");
    oamessagechoicebean1.setPickListCacheEnabled(false);
    oamessagechoicebean = (OAMessageChoiceBean)oawebbean1.findChildRecursive("ExpenseType");
    oamessagechoicebean.setPickListCacheEnabled(false);
    oamessagechoicebean = (OAMessageChoiceBean)oawebbean1.findChildRecursive("ChildGuestType");
    oamessagechoicebean.setPickListCacheEnabled(false);
    OAMessageLayoutBean oamessagelayoutbean = (OAMessageLayoutBean)oawebbean1.findChildRecursive("ChildExpTypeLayout");
    oamessagelayoutbean.setRequired("uiOnly");
    createDirectBinding(oawebbean, "IPL_ExpTypeChoice", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_StartDate", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_Justification", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_LocationName", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_RBLocation", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_MerchantName", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_TaxRegNumber", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_ReceiptNumber", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_Reference", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_TaxpayerID", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildExpTypeChoice", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildStartDate", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildReceiptCurrencyChoice", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildJustification", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildExpenseGroup", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildLocationName", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildRBLocation", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildDetailMerchantName", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildDetailTaxClassification", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildDetailTaxCode", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildAirTravelType", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildAirTicketClass", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildAirTicketNumber", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildAirFromLocation", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildAirToLocation", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildAccEndDate", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildMealNumberAttendees", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildMealAttendees", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "ChildDetailReceiptAmount", STYLE_CLASS_ATTR, "SharedCSS");
    createDirectBinding(oawebbean, "IPL_ReceiptCurrency", STYLE_CLASS_ATTR, "DetailReceiptAmountCSS");
    createDirectBinding(oawebbean, "IPL_OriginalReceiptAmount", STYLE_CLASS_ATTR, "DetailReceiptAmountCSS");
    createDirectBinding(oawebbean, "IPL_ExchangeRate", STYLE_CLASS_ATTR, "DetailExchRateCSS");
    createDirectBinding(oawebbean, "IPL_InverseExchangeRate", STYLE_CLASS_ATTR, "DetailExchRateCSS");
    createDirectBinding(oawebbean, "ChildDetailDailyRate", STYLE_CLASS_ATTR, "DetailDailyRateCSS");
    createDirectBinding(oawebbean, "ChildNumberOfDays", STYLE_CLASS_ATTR, "DetailDailyRateCSS");
    createDirectBinding(oawebbean, "ExpenseReimAmountHeader", TEXT_ATTR, "ReceiptAmountColHeader");
    createDirectBinding(oawebbean, "IPL_ReimbursementAmount", CURRENCY_CODE, "ReimbursementCurrencyCode");
    createDirectBinding(oawebbean, "ItemizationDetailsHeader", TEXT_ATTR, "ChildDetailHeader");
    createDirectBinding(oawebbean, "ChildDetailDailyRate", CURRENCY_CODE, "ReceiptCurrencyCode");
    createDirectBinding(oawebbean, "ChildDetailReceiptAmount", CURRENCY_CODE, "ReceiptCurrencyCode");
    createDirectBinding(oawebbean, "ChildDetailReimbursAmt", CURRENCY_CODE, "ReimbursementCurrencyCode");
    createDirectBinding(oawebbean, "ReceiptAmount", CURRENCY_CODE, "ReceiptCurrencyCode");
    createDirectBinding(oawebbean, "IPL_OriginalReceiptAmount", CURRENCY_CODE, "ReceiptCurrencyCode");
    createDirectBinding(oawebbean, "ChildGuestTypeSortableHeader", REQUIRED_ATTR, "FB_GuestTypeColReq");
    createDirectBinding(oawebbean, "ChildGuestNameSortableHeader", REQUIRED_ATTR, "FB_GuestNameColReq");
    createDirectBinding(oawebbean, "ChildGuestTitleSortableHeader", REQUIRED_ATTR, "FB_GuestTitleColReq");
    createDirectBinding(oawebbean, "ChildGuestTaxIdSortableHeader", REQUIRED_ATTR, "FB_GuestTaxIdColReq");
    createDirectBinding(oawebbean, "ChildGuestEmployerSortableHeader", REQUIRED_ATTR, "FB_GuestEmployerColReq");
    createDirectBinding(oawebbean, "ChildGuestEmployerAddrSortableHeader", REQUIRED_ATTR, "FB_GuestEmployerAddressColReq");
    createDirectBinding(oawebbean, "BusinessExpValue", TEXT_ATTR, "ItemizationTotalBusinessExpenses");
    createDirectBinding(oawebbean, "BusinessExpValue", CURRENCY_CODE, "ReceiptCurrencyCode");
    createDirectBinding(oawebbean, "PersonalExpValue", TEXT_ATTR, "ItemizationTotalPersonalExpenses");
    createDirectBinding(oawebbean, "PersonalExpValue", CURRENCY_CODE, "ReceiptCurrencyCode");
    createDirectBinding(oawebbean, "ReceiptAmountValue", TEXT_ATTR, "ExpenseReportLinesVO", "ReceiptCurrencyAmount");
    createDirectBinding(oawebbean, "ReceiptAmountValue", CURRENCY_CODE, "ReceiptCurrencyCode");
    OAMessageTextInputBean oamessagetextinputbean = (OAMessageTextInputBean)oawebbean1.findChildRecursive("IPL_Justification");
    oamessagetextinputbean.setWrap("soft");
    oamessagetextinputbean = (OAMessageTextInputBean)oawebbean1.findChildRecursive("ChildJustification");
    oamessagetextinputbean.setWrap("soft");
    String s = oapagecontext.getParameter("source");
    String s1 = oapagecontext.getParameter("event");
    if("DuplicateItemization".equals(s) || "RemoveItemization".equals(s) || "AddItemization".equals(s) || "SingleSelectionChange".equals(s1))
    setFocusToField(oamessagechoicebean1.getID(), oawebbean);
    } else
    if("ChildStartDateUpdate".equals(s1))
    OAMessageTextInputBean oamessagetextinputbean1 = (OAMessageTextInputBean)oawebbean.findChildRecursive("ChildDetailDailyRate");
    OADataBoundValueViewObject oadataboundvalueviewobject = new OADataBoundValueViewObject(oamessagetextinputbean1, "DetailDailyRateRendered", "DetailsPagePVO");
    Boolean boolean1 = (Boolean)oadataboundvalueviewobject.getValue(oapagecontext.getRenderingContext());
    if(boolean1 != null && boolean1.booleanValue())
    setFocusToField("ChildDetailDailyRate", oawebbean);
    } else
    setFocusToField("ChildDetailReceiptAmount", oawebbean);
    } else
    if("StartDateUpdate".equals(s1) && "IPL_StartDate".equals(s))
    setFocusToField("IPL_StartDate", oawebbean);
    } else
    if("IPL_ReceiptCurrencyChange".equals(s1) && "IPL_ReceiptCurrency".equals(s))
    setFocusToField("IPL_ReceiptCurrency", oawebbean);
    private void setFocusToField(String s, OAWebBean oawebbean)
    OABodyBean oabodybean = (OABodyBean)OAWebBeanUtils.findParentByType(oawebbean, "BODY", oracle/apps/fnd/framework/webui/beans/OABodyBean);
    oabodybean.setInitialFocusId(s);
    private void createPPRFlexRegions(OAPageContext oapagecontext, OAWebBean oawebbean)
    OAWebBean oawebbean1 = oawebbean.findChildRecursive("AdditionalFields");
    OAWebBean oawebbean2 = oawebbean.findChildRecursive("ChildAdditionalFields");
    String s = oapagecontext.getProfile("AP_WEB_DESC_FLEX_NAME");
    if(s == null || "N".equals(s) || "H".equals(s))
    return;
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean1);
    Vector vector = (Vector)oaapplicationmodule.invokeMethod("getExpenseTypesVector");
    Vector vector1 = (Vector)vector.elementAt(0);
    Vector vector2 = (Vector)vector.elementAt(1);
    Vector vector3 = new Vector();
    Vector vector4 = new Vector();
    vector.addElement(vector4);
    Boolean boolean1 = (Boolean)oaapplicationmodule.invokeMethod("IsItemizedLine");
    for(int i = 0; i < vector1.size(); i++)
    String s1 = vector1.elementAt(i).toString();
    String s2 = (String)vector2.elementAt(i);
    String s3 = (new StringBuilder()).append("DFF_").append(s1).toString();
    int j = createFlexBean(true, oapagecontext, oawebbean1, s1, s2, s3);
    if(Boolean.TRUE.equals(boolean1))
    String s4 = (new StringBuilder()).append("ChildDFF_").append(s1).toString();
    j = createFlexBean(false, oapagecontext, oawebbean2, s1, s2, s4);
    vector4.addElement(new Integer(j));
    if(oapagecontext.isBackNavigationFired(true))
    return;
    } else
    Serializable aserializable[] = {
    vector
    Class aclass[] = {
    java/util/Vector
    oaapplicationmodule.invokeMethod("configurePVOForDFF", aserializable, aclass);
    oaapplicationmodule.invokeMethod("syncAttCategoryWithExpType");
    return;
    private int createFlexBean(boolean flag, OAPageContext oapagecontext, OAWebBean oawebbean, String s, String s1, String s2)
    OAMessageLayoutBean oamessagelayoutbean = (OAMessageLayoutBean)createWebBean(oapagecontext, "MESSAGE_LAYOUT_BEAN", null, null);
    oawebbean.addIndexedChild(oamessagelayoutbean);
    String s3 = (new StringBuilder()).append("DFF_").append(s).append("Rendered").toString();
    ArrayList arraylist = (ArrayList)oapagecontext.getTransactionTransientValue("flexList");
    Object obj = null;
    Object obj1 = null;
    if(arraylist != null)
    OADescriptiveFlexBean oadescriptiveflexbean = (OADescriptiveFlexBean)arraylist.get(0);
    String s4 = (String)arraylist.get(1);
    if(oadescriptiveflexbean != null && s4 != null && s.equals(s4) && oadescriptiveflexbean.getUINodeName().equals(s2))
    oamessagelayoutbean.addIndexedChild(oadescriptiveflexbean);
    oamessagelayoutbean.setAttributeValue(RENDERED_ATTR, new OADataBoundValueViewObject(oamessagelayoutbean, s3, "DetailsPagePVO"));
    oapagecontext.removeTransactionTransientValue("flexList");
    return oadescriptiveflexbean.getIndexedChildCount(null) - 2;
    OADescriptiveFlexBean oadescriptiveflexbean1 = (OADescriptiveFlexBean)createWebBean(oapagecontext, "DESCRIPTIVE_FLEX", null, s2);
    oamessagelayoutbean.addIndexedChild(oadescriptiveflexbean1);
    oamessagelayoutbean.setAttributeValue(RENDERED_ATTR, new OADataBoundValueViewObject(oamessagelayoutbean, s3, "DetailsPagePVO"));
    oadescriptiveflexbean1.setAttributeValue(READ_ONLY_ATTR, new OADataBoundValueViewObject(oadescriptiveflexbean1, "SDP_PageReadOnly", "DetailsPagePVO"));
    oadescriptiveflexbean1.setContextListRendered(false);
    oadescriptiveflexbean1.setAttributeValue(FLEXFIELD_NAME, "AP_EXPENSE_REPORT_LINES");
    oadescriptiveflexbean1.setAttributeValue(FLEXFIELD_APPLICATION_SHORT_NAME, "SQLAP");
    oadescriptiveflexbean1.setAttributeValue(REGION_APPLICATION_ID, OIECommonConstants.STATIC_INTEGER_222);
    if(flag)
    oadescriptiveflexbean1.setViewUsageName("ExpenseReportLinesVO");
    } else
    oadescriptiveflexbean1.setViewUsageName("ItemizedLinesVO");
    oadescriptiveflexbean1.setFlexContext(oapagecontext, s1);
    try
    oadescriptiveflexbean1.processFlex(oapagecontext);
    catch(Exception exception)
    oamessagelayoutbean.setRendered(false);
    return 0;
    return oadescriptiveflexbean1.getIndexedChildCount(null) - 2;
    private void ManualPPR(OAPageContext oapagecontext, OAWebBean oawebbean)
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "DetailsPageButtonBar");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "LeftColumn");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "RightColumn");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "ChildLeftColumn");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "ChildExpTypeLayout");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "ChildRightColumn");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "MerchantFieldsHeader");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "MerchantFieldsLayout");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "IPL_MerchantFieldsHeader");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "IPL_MerchantFieldsLayout");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "IPL_LeftColumn");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "IPL_RightColumn");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "ChildEmployeeTableRN");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "ChildGuestTableRN");
    OAPartialPageRenderUtils.addPartialTargets(oapagecontext, "ItemizationMasterTable");
    protected static boolean PageHasExceptions(OAPageContext oapagecontext, OAWebBean oawebbean)
    Object aobj[] = (Object[])(Object[])oapagecontext.getTransactionTransientValue("FWK_PAGE_ERROR_TRXN_CACHE");
    Boolean boolean1 = (Boolean)aobj[3];
    return boolean1.booleanValue();
    private static void ClearExceptions(OAPageContext oapagecontext, OAWebBean oawebbean)
    Object aobj[] = (Object[])(Object[])oapagecontext.getTransactionTransientValue("FWK_PAGE_ERROR_TRXN_CACHE");
    Vector vector = (Vector)aobj[0];
    Vector vector1 = (Vector)aobj[1];
    Vector vector2 = (Vector)aobj[2];
    vector.removeAllElements();
    vector1.removeAllElements();
    vector2.removeAllElements();
    aobj[3] = Boolean.FALSE;
    Edited by: user13079906 on Oct 1, 2010 1:14 AM

  • How to change the Quantity in Excise Invoice where PART1&2 are posted

    Dear Gurus
    I have a PO with 2 Qty
    Where i have received GR for  1 QTY with excise invoice for 1 Qty
    now the User is done GR for 2 Qty with excise details of 1 where Part 1&2 are posted
    now i want to change the quantity from 2 to 1 in Excise Document and the GR
    how to solve this issue
    Please help me

    Hi,
    As you needed, 1st reverse GR document in 102 Movement type in t.code: MIGO and cancel the excise entries with t.code: J1IEX, go for post and then cancel for excise amount with entering Rejection Code in miscellaneous TAB.
    Regards,
    Biju K

  • How to change operator of join conditions in where clause?

    Hello
    I have a situation... I want to change the operator between each join conditions in the where clause when these join conditions are not from the same join..
    For example, I have the following schema:
    Dim1 ------ DimA -------Fact1
    Dim1-------DimB -----Fact1
    So DimA and DimB are aliasas of one dim table, but the join is different.
    Now if I run this model, what I will get in the where clause of the query is:
    Where Dim1 = DimA and Dim1 = DimB and DimA= Fact1 and DimB = fact1.
    Is there a way I can change these "and" operator to "OR", so that the where clause would look like this: Where Dim1 = DimA and Dim1 = DimB and DimA= Fact1 OR DimB = fact1?
    This is different from simply changing the join operator within the same join, because these are different joins and I'd like to control how they relate to each other..
    Please help
    Thanks

    Sometimes, business rules are complex, so there isn't always a way to simplify things.  Is your issue that it's complex and error prone, or is it performance due to the OR clauses?
    One possibility that will at least make it easier to test and debug is something like this:  (pseudocode)
    From Table1 Inner join Table2 on x=y etc.etc.
    CROSS APPLY
    (Select case when a=b and (c=d or e=f) then 1 else 0 end) as Situation1
    , case when h=i or j = k then 1 else 0 end) as situation2
    , case when l = m then 1 else 0 end) as situation 3
    ) as CA_Logic_Simplifier
    Where situation1 = 1 and situation2 = 1 and situation3 = 1
    Although you could say, "Hey, this is basically doing the same thing as before", this approach would be far easier to test and debug, because you can at a glance look at the values for situation1, 2, 3, etc. to see where errors are being introduced. 
    The cross apply makes the columns situation1/2/3 "instantiated", so they are usable in the where clause. Divide and conquer.  

  • How to use the MAX DATE condition in WHERE CLAUSE FILEDS

    Hi,
    I am trying to fetch the result for getting maximun date but when i try to execute the query i am getting the error as follows.
    CONDITION : trunc(max(RD.DATERECEIVED)) BETWEEN TO_DATE('01/08/2011','DD/MM/YYYY') AND TO_DATE('01/08/2011','DD/MM/YYYY')
    ERROR: Group function is not allowed here.
    CHEERS,
    PRABU AMMAIAPPAN

    I see a couple of problems here.
    First, what you posted below is not a syntactically valid query. It seems to be part of a larger query, specifically, this looks to be only the GROUP BY clause of a query.
    Prabu ammaiappan wrote:
    Hi,
    I Have a group function in the Query. Below is the Query i have used it,
    GROUP BY S.FREIGHTCLASS,
    R.CONTAINERKEY,
    S.SKU,
    S.DESCR ||S.DESCRIPTION2,
    S.PVTYPE,
    RD.LOTTABLE06,
    R.WAREHOUSEREFERENCE,
    RD.TOLOC,
    R.ADDWHO,
    R.TYPE,
    S.CWFLAG,
    S.STDNETWGT,
    S.ORDERUOM,
    R.ADDDATE,
    C.DESCRIPTION,
    (CASE WHEN P.POKEY LIKE '%PUR%' THEN 'NULL' ELSE to_char(P.PODATE,'dd/mm/yyyy') END),
    NVL((CASE WHEN R.ADDWHO='BOOMI' THEN RDD.SUPPLIERNAME END),SS.COMPANY),
    RDD.BRAND,
    S.NAPA,
    RD.RECEIPTKEY,
    R.SUSR4,
    P.POKEY,
    RDD.SUSR1,
    r.STATUS, DECODE(RDD.SUSR2,' ',0,'',0,RDD.SUSR2),
    rd.SUSR3Second, the answer to your primary question, "How do I add a predicate with with a MAX() function to my where clause?" is that you don't. As you discovered, if you attempt to do so, you'll find it doesn't work. If you stop and think about how SQL is processed, it should make sense to you why the SQL is not valid.
    If you want to apply a filter condition such as:
    trunc(max(RD.DATERECEIVED)) BETWEEN TO_DATE('01/08/2011','DD/MM/YYYY') AND TO_DATE('01/08/2011','DD/MM/YYYY')you should do it in a HAVING clause, not a where clause:
    select ....
      from ....
    where ....
    group by ....
    having max(some_date) between this_date and that_date;Hope that helps,
    -Mark

  • How to change the default sql servery query name?

    Whenever we click on new query button, Sql server automatically opens a new query with default name SQLQuery1.sql.
    Can I change this default name? What I mean to say is I have to work with quite a number of databases on different servers. So I open multiple queries on different server. So I was finding a way where whenever I click on
    New Query button it inherits servername or database name (e.g If I have database name like ABCD new query name should look like ABCDquery.sql ?)
    So that I can distinguish which query belong to which Database?
    I would be very greateful if you can please answer this.
    Many thanks

    Please try with different color code option for your servers:
    Ref: http://technet.microsoft.com/en-us/library/hh213617.aspx
    Set the Status Color for a Server in Object Explorer
    To set a server status color in Object Explorer
    In Object Explorer, select the Connect button and then select Database
    Engine….
    On the Connect to Server dialog, select Options >>.
    Select the Use custom color check box.
    To select the color, select the Select… button.
    Select either a basic or custom color, then select OK.
    Fill in the rest of the connection information, and then select the Connect button.
    Note: This is to identify different server connected not for databases.

Maybe you are looking for