ADFBC EO attributes: "conditionally" mandatory

We've a requirement via ADF BC to say that an EO attribute is mandatory/optional, based on an external piece of logic. In other words the field is "conditionally" mandatory, and polymorphic EOs are not suitable in this situation.
I note in a previous OTN post: Re: Mandatory flag at  VO level.
...that ER 3176734 was raised to include such functionality, but I'm unsure if the ER was every implemented in ADF BC. Essentially is there an isAttributeMandatory() solution available somewhere in the 11g ADF BC framework, or at least some sort of solution that will give me the ability in code to determine is a field should be mandatory?
Your help appreciated.
CM.

Yeah, Steve's 2a and 2b solution is what I came up with initially, which is "urg" as for every attribute you need to create a transient attribute, and I was hoping the ER had resulted in something useable/workable/scalable. We've discovered polymorphic EOs are limited in use where you have a predefined static list of discriminator values. In our case we can have an unlimited number of types, all with their own mandatory/optional attribute requirements, derived from a 3rd party rules engine. Of course it gets worse because we also have the need to change labels on the fly, as well as if the field is shown/hidden. A bunch of chokepoint methods similar to isAttributeUpdateable would have been ideal.
Alternatively I've been investigating if you can do anything with the EntityDeflImpl class from the AttributeDefImpl point of view, but it seems to be mostly a read-only object which you can't override at runtime.
Currently I'm thinking that what we'll need to do is create a JSF bean with a getter method based on a hashmap lookup, something like: #{smartBean.fieldMandatory.thisField}, where behind the scenes given the "thisField" hash, the isFieldMandatory method will use the hash to query the external business rule engine to discover if the field is mandatory/optional.... if that makes sense.
CM.

Similar Messages

  • Entity Attribute conditional mandatority

    Hello OTN,
    I've got an entity object which is used in different projects. In this entity there is an attribute which should be mandatory conditionally:
    When (attributeA != 1 && attributeA != 2) attributeB should be mandatory.
    This should be reflected in the UI with * symbol and an error message which I define in entity business rules.
    The problem is I can't set Mandatory constraint to be conditional, there's no Validation Execution tab.
    Well, I could add a Script Expression or Java method to EntityImpl as business rule but this woudln't give me the * symbol in the UI and I will have to set inputText required attribute on every page.
    Could I avoid it somehow? I want the business rule to be defined only once in the entity object.
    Thanks.
    ADF 11.1.2.1
    Edited by: ILya Cyclone on Jan 10, 2012 3:25 PM

    Quick brainstorm on my part:
    a) You create a transient attribute on the EO with a groovy expression that defines if the other attribute is mandatory or not
    b) Remove the mandatory property on the original attribute (this removes the mandatory rule), then create a script based declarative validation rule based on the result of "a"
    c) In the page change the original attribute's required EL expression to be based on that of "a" too
    ...or something along those lines, this should give you the inspiration you're looking for.
    CM.

  • Is it possible to create a Column with Conditional Mandatory with another Column?

    Is it possible to create a Column with Conditional Mandatory with another Column?
    For example
    In a Table we have column A, B, C.
    A is Primary Column.
    B is Optional
    C is Conditional Mandatory.
    A B
    C
    12345 ABC
    OK
    12346 NULL
    NULL
    12347 ABC
    OK
    Only if the B Column has the value then only C column should be mandatory

    I guess you can't create a condtional mandatory column directly. However, you can use check constraint to on the column
    create table YourTable
      A int primary key,
      B char(3),
      C int,
      constraint ch_con check(
                                B
    is not null
    or C is null

  • Trans-attribute of Mandatory

    Hello,
    I am running WebLogic 6.1 on NT. Today I ran an experiment by setting trans-attribute
    to "Mandatory". The client calls this method with no transaction. The result
    is that the method is not executed and there is no error message anywhere. This
    seems to be a very tricky kind of error to catch.
    Once I changed the trans-attribute to "Requires" without changing anything
    else, the method was executed normally.
    Does any one have any comments on using "Mandatory"?
    Simon

    I can tell you what the EJB 2.0 Spec says:
    17.6.2.5 Mandatory
    The Container must invoke an enterprise Bean method whose transaction attribute is set to
    Mandatory in a client’s transaction context. The client is required to call with a transaction
    context.
    • If the client calls with a transaction context, the Container performs the same steps as
    described in the Required case.
    • If the client calls without a transaction context, the Container throws the
    javax.transaction. TransactionRequiredException exception if the client is a remote client, or
    the javax.ejb.TransactionRequiredLocalException if the client is a local client..
    Is that not what you are seeing?
    Bill
    Simon Ng wrote:
    Hello,
    I am running WebLogic 6.1 on NT. Today I ran an experiment by setting trans-attribute
    to "Mandatory". The client calls this method with no transaction. The result
    is that the method is not executed and there is no error message anywhere. This
    seems to be a very tricky kind of error to catch.
    Once I changed the trans-attribute to "Requires" without changing anything
    else, the method was executed normally.
    Does any one have any comments on using "Mandatory"?
    Simon

  • Purchase Order conditions mandatory

    Hi,
    our requirement is to make tax condtions into PO Mandatory--i. excise & vat conditions,
    system should not allow to save the PO without this taxes.
    Devendra

    Hi,
    Tax code links pricing procedure with tax procedure and in tax procedure you have all your asked related condition types.
    Use follow the path:
    SPRO-MM-Purchasing- Purchase Order--Define Screen Layout at Document Level
    Select & double click your Field Selection Key for Po you are using and go to
    GR/IR control segment & make Tax code is the required entry & save.
    Now create PO, system will ask to entry Tax code and you can find all respective tax condition types WRT Tax code.
    Regards,
    Biju K

  • Conditional Mandatory Field in Material Master (Sugg. Needed

    Hi ,
    I am having a requirement where i need to make a particular field to be mandatory for a certain condition in Material Master.
    Say for a Product Hierarchy i want to make Volume Rebate Group mandatory ( Sales Org 2 View).
    Please suggest the possible solutions for the same.
    Thanks,
    Rachita.

    Hi,
    It is possible to get access to all other fields from within a field exit by using the below code. This is a field exit on GMG_HEADER_FIELDS-grant_type within program SAPLBDT_GMGR but by using the code below you can get data stored in any field within the program. i.e. GMG_HEADER_FIELDS-GRANT_NBR
    Field-symbols: <status>.
    assign ('(SAPLBDT_GMGR)GMG_HEADER_FIELDS-GRANT_NBR') to <status>.
    if SY-SUBRC = 0.
      message e003(zr) with <status> .
    ******other code*****************
    endif.
    Reward points if found helpful....
    Cheers,
    Rakesh.

  • Conditionally Mandatory or non-Mandatory field in Isupplier banking Detail Form.

    Hi OA Experts
    I need to make a field mandatory or Non-Mandatory based on Lov item in page "/oracle/apps/pos/sbd/webui/SuppRegActPG", Can I do this by using VO extension , if yes, Kindly guide me as I am new to OAF.

    You need to do VO extension first and add transient attribute in the same VO. Set SPEl to the required field using Controller code.For this You need to do controller extension.
    ++++++++++++++++++++++++++++++++++++++++++++++++
    In PR,
    Set SPEL to the field by initializing the field according to its Style.(OAMessagetextinputBean or OAMessageStyledTextBean etc...)
    +++++++++++++++++++++++++++++++++++++++++++++++++
    Then in PFR use Lov event as below.
    if (pageContext.isLovEvent())
              String lovInputSourceId = pageContext.getLovInputSourceId();
              if ("myLovInput".equals(lovInputSourceId)) // "myLovInput" is the item id of LOV, replace with your LOV on page
                   rendVO.getCurrentRow().setAttribute("xxRenderApprove",Boolean.FALSE);//here handle the SPEL
    I hope this will be enough for your requirement.

  • AC 5.3 - CUP - initiator attributes - conditional logic

    Is there a trick to making the conditional logic work correctly in CUP when trying to define/select the initiator attributes?   Even when I specify to use AND, it seems to still be adding the attribute with an OR condition.
    For our non-production provisioning,  I have a role that needs to be approved by different people depending on which system (i.e. Dev, IT, QA) it is being requested.  I am trying to set up the 2 initiators as follows:
    Initiator 1:  Application/System = DEV and  Role = Role 1
    Initiator 2:  Application/System = IT or QA    and    Role = Role1
    Edited by: Jane Yap on Oct 22, 2009 5:12 PM

    After playing around with this more,  it appears that if I am selecting Role as the attribute and use the search functionality (i.e. click on the magnifying glass) to specify/select the actual role/role name,  the conditional logic does not get set accordingly.   In order to get the correct conditional logic set (i.e. populate the one I actually selected),  I need to type the role name or pattern of the role name instead of selecting the role using the search functionality.  
    I guess everywhere else within GRC AC it's always best to use the seach functionality when setting/selecting field values  (as opposed to manually typing/entering the values) EXCEPT for when creating/changing CUP initiators.   Documented feature? Perhaps...
    Thank you to those who responded to my post.

  • Set up or flag the field of attribute as mandatory or optional

    Hi,
    I’d like to know if it’s possible to either set up or flag the attribute fields as either mandatory or optional. Is it possible with Java API?
    Thanks a lot.

    Hi Thomas,
    You have setting in the Console called Required that you can flag YES or NO to indicate whether the field is required or not.  However, this option setting does not actually enforce anything as of now.  In future releases of 2006, there is a proposal to enforce this.
    For now, the way I worked around is:
    1. I flag the field required YES in the console if I do NOT want NULL values in the field. (for the sake of setting).
    2. Then, in data manager I write validation expression using IS_NOT_NULL function on those fields so that manual entry does not allow NULL values.  It throws an error.
    3. Import Manager however cannot retrieve the validation expressions.  So, you can load null values in a field that has the expression written.  You will identify these if you manually run validation after the loads.
    4. <b>JAVA API</b> lets you enforce this when you are using API programs to post the data.  You can write such that if the consoel is set to YES, then do not let NULL values to post.
    I have some information around requried in fields in my blog:
    /people/savitri.sharma/blog/2005/09/22/tips-and-hints-for-new-mdm-users
    Is this helpful?
    Good luck
    Savi

  • Attribute Conditional Clause

    I would like to know if I'm able to assign values to a member based on another member's attribute assignment using the code fragment below from Sample Basic:
    fix (Jan:Mar, @children(West), Budget, @descendants(Product))
    "COGS"
    if (@ATTRIBUTESVAL("Pkg Type") == "Can")
    "COGS"= xyz;
    else
    "COGS" = abc;
    endif;)
    endfix

    Just use @ISATTRIBUTE. Oddly, it doesn't show up in the Tech Ref, but it's there.
    You can also use @ISMBR(@ATTRIBUTE(name)).
    See: http://www.network54.com/Forum/58296/thread/1214605070/Untitled
    Regards,
    Cameron Lackpour

  • ADFBC: Customizing attribute level error messages

    hi,
    i am using JDev 10.1.3 and i want to customize the default attribute level error messages that the ADF would raise in response to the database. for example in a input field (which expects a primary key) if a duplicate field is entered you would see a JBO exception telling you that its a duplicate right under the Component. But as i am using the a custom error handler class which inherits the DCErrorHandlerImpl along with a custom pageLifecycle and ADFPhaseListener classes (as in the ADF Guide), i manage to customize the messages according to the ErrorCodes but the messages that are displayed under the component giving the specific messages are no longer there.
    Is there a way to customize them so that i can put the general error messages on top of the page (using the <af:messages> tag) and component/attribute specific errors beside the components.
    any help or pointers would be appreciated.
    Thanks.

    There is surely a section in the Fusion Developer's Guide on custom error/exception handling. Have you found it? Perhaps you have since you are considering overriding view/model framework objects.
    In JDev 10g there was very good documentation for how to do this in the ADF Developer's Guide. As far as I could tell, the equivalent manuals are the Fusion Developer Guides for ADF 11g. I think you will have a lot of luck getting what you want if you research this a bit more.
    In ADF 10g, what you are alluding to certainly was the solution to what you wanted. I do not know a whole lot about version 11g, but I suspect it is similar in this regard.
    in 10g this process started with overriding the ADF life-cycle.
    Once you get this working I also found some on-line commentary/articles from Avrom Roy-Federman on how to additionally extend error handling.
    All this said, you also seem to be asking some other questions (jobid and such), the solutions of which would require us to have more information about your application, I think.
    Maybe you can take one question at a time? Or start multiple threads?

  • Policy Evaluation using session attributes condition

    Hi Guys,
    I have custom policies defined in Access Manager for several resources to be protected. What i am trying to achieve is When policy evaluation happens to calculate the resources based on the ldaproles for a user entry, I need few session properties to be applied which are defined under "conditions" in the policy setup . I need to figure out how would set these users AM session properties from the client application. Any inputs would be of great help.
    Thanking in advance.
    Akeel M Sayyad.

    Anyways, I figured it out. You can do it using SSOTokenManager.

  • Conditionally mandatory parameters using value sets.

    I Have three parameters batch, from_date and to_date . I want either batch or (from_date and to_date) as mandatory parameters .
    I the user enters from_date, then i want to_date as mandatory as well.
    Any help would be appreciated.
    thanks in advance
    vittal

    Hi,
    You can check the values of your parameters in your after parameter form trigger
    IF :FROMDATE IS NULL AND :BATCH IS NULL THEN
        RETURN FALSE;
    ELSIF :FROMDATE IS NOT NULL AND :TODATE IS NULL THEN
        RETURN FALSE;
    END IF;
    RETURN TRUE;Regards
    MP

  • Error when using a condition for required attribute

    Hi
    I have a requirement to validate the mandatory fields only when the submit button is pressed....if some other button is pressed or some how the form is submitted the validations should not be performed....
    I have used required="#{MyBB.somecondition}" for all the mandatory fields...the method that is being called for doing the condition check is given below:
    public boolean isSomeCondition() {
        // assumes submitButton is a component binding 
        FacesContext fc = FacesContext.getCurrentInstance();
        Map reqParams = fc.getExternalContext().getRequestParameterMap();
        return reqParams.containsKey(submitButton.getClientId());
      }It is same that is given at the following location
    http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works ---Soln 3
    But the problem is if I am submitting the form using Javascript from another page(page is a popup that is opened inside the current window), this condition doesnt work and it gives me an error saying "Check some field for its value"
    Please help me sort out this problem
    Thanks

    I think the problem is not clear....my mistake
    I try to be more elaborate on this....
    I open up a popup page from my main window....Here I perform a search(lets say there is a requirement for finding the Country and pincode for a particular city that the user enters)
    Now when I select the particular row in the datatable and click the submit button...... I want the selected values to be filled inside the parent window.....
    I want to bring to your notice that the button that is clicked is in the popup page...not in the parent window.....
    So you see that when that button in popup is clicked i am submiting the form of the parent window and during that time I dont want the validation to occur..... To submit the form of the parent window I use the Javascript like this : window.opener.document.forms[0].submit();Also one more thing that I want to mention is that the method that is used for specifying the condition for required attribute for mandatory fields in the parent window works fine for any button that i click inside my parent window......
    What I mean by this is lets say I have a button to add a dynamic row into my parent page then also I have to submit the form but during that time validation should not occur and it works fine.
    So now I think its clear that the Javascript is being invoked from another page which is submitting the parent window.....
    Then you're doing something wrong. Invoking the wrong button maybe? So please enlighten me where i am wrong and how possibly would I know which button I am invoking??

  • Set attribute to be mandatory in set type

    Hi! Can I confirm whether it is possible to set certain attribute fields to be mandatory in a set type? The transaction code to create set attribute and assign to the set type is COMM_ATTRSET.
    Thanks!
    SF

    Hi SF,
    In the standard system, you cannot configure an attribute to be mandatory in a set .
    However, you can try using transaction SFAC in order to set an attribute as mandatory; I am not sure if this procedure will work for you, but is it good to take a look. Into this transaction, you cam define which fields are displayed/hidden/mandatory.
    Keep on mind that every time a set is create in transaction COMM_ATTRSET, a corresponding module pool SAPLZOM_<set type name> is created with Screen group 0100.
    I hope it helps.
    Kind Regards,
    Gabriel Santana

Maybe you are looking for

  • Help with date format in Procedure...

    Hi, I am very new to orcale development.... as my requirement have asked me i have written a procedure Procedure create or replace procedure MEXICO_NAFTA_CERTIFICATE_EXT ( f_org_id NUMBER, f_customer_nbr_base NUMBER, f_customer_nbr_sufx number, f_yea

  • ObjectInputStream with large files?

    I write two arrays to their own separate files using: FileOutputStream fos = new FileOutputStream("C:/location"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(array); oos.close(); One file is 2MB and the other is 600MB. When

  • HI, I have a WRT54GL Ver1.1 I have enable mac address as...

    HI, I have a WRT54GL Ver1.1 I have enable mac address as authentication for the wireless. I have been able to add up to 40 Mac addresses; meaning 40 machines. How would i be able to add more machines; Do you have to buy another unit or a firmware upg

  • Passing variable from one template to another

    We have problems in the BI7 environment with passing variables across from one web template to another. In BW3.x there was a Java Script Command SAP_BW_URL_Get used to construct URLs. (Please also see the SAP documentation: http://help.sap.com/saphel

  • Flash player won't install despite...?

    Last time I had problems installing flash player with an HP DC5000 desktop, I was directed to this thread: http://forums.adobe.com/thread/928315 which worked for that unit, this time I am trying to install flash player in a Dell Optiplex 170L followe