14 Replies Latest reply on Feb 19, 2018 7:06 PM by 3518565

    Any issues extending Application Module - ByrSuppAM ?

    3518565

      Did anyone encounter issues extending the Application Module - ByrSuppAM ?

       

      I need to extend the ByrSuppAM to add a reference to a custom VO (which is referenced by a custom LOV) to the the Supplier Setup screen. I have copied all the class and java files from $JAVA_TOP/oracle/apps/pos/supplier/server to my local JDev environment. I then created a new workspace and project and attempted to create a new AM. When I attempt to reference the AM - ByrSuppAM, as the AM to extend, it wouldn't let me move past that window as shown below!

       

      Are there any restrictions on extending this AM - ByrSuppAM? or did I miss copying any other files from from the server?

       

      Regards,

      Rajesh

        • 1. Re: Any issues extending Application Module - ByrSuppAM ?
          RajPapdeja

          You cannot extend the root application module. In order to associate a custom VO with the standard AM, you can go for CO extension and implement it as shown in the sample code below. This method should be invoked from processRequest method of the extended CO. Hope this helps.

           

          • 2. Re: Any issues extending Application Module - ByrSuppAM ?
            3518565

            Hello Raj - Thanks so much for your response.. as advised I will follow your sample code and extend the CO; will post an update once the issue is resolved.

             

            Thanks again,

            Rajesh

            • 3. Re: Any issues extending Application Module - ByrSuppAM ?
              3518565

              Hi Raj - I followed your sample code and added code to processRequest method to add the new VO to the extended CO. I saved the project, copied the java class for the new CO and jpx file to the server; when I attempted importing the project, it did not import anything but completed with a message – “No documents imported”

               

              Could you please advise how to migrate this to the server before we personalize the Supplier page to point to this new (Extended) CO?

               

              Thank you!

              • 4. Re: Any issues extending Application Module - ByrSuppAM ?
                RajPapdeja

                Hi Rajesh,

                 

                With my suggested approach you just have to move the VO and CO class and xml files to the server.

                • 5. Re: Any issues extending Application Module - ByrSuppAM ?
                  3518565

                  Hi Raj - Thank you so much for your help.. that worked.

                   

                  Regards,

                  Rajesh

                  • 6. Re: Any issues extending Application Module - ByrSuppAM ?
                    3518565

                    Hello again, Raj - I hope you wouldn't mind answering one more question for me.. Now that the custom LOV is working (which is attached a newly created field of Lov Input), I need to add this LOV to a standard field "HoldReason", which is of type "Message Text Input".

                     

                    As we can't change the Item Style from "Message Text Input" to "Message Lov Input", I created a new field of type "Message Lov Input" and attached the LOV through personalization. How can I add this LOV to the standard field? or should I disable the standard field (not rendered) and show this new field and synchronize the values between the custom field and the standard filed? Any suggestions?

                     

                    Thanks again,

                    Rajesh

                    • 7. Re: Any issues extending Application Module - ByrSuppAM ?
                      3518565

                      Hi Raj - we got this resolved by following personalizations.

                       

                      1. 1. Changed 'Redered' property of the standard field to False. (not displayed any more)
                      2. 2. Assigned 'View Attribute' and 'View Instance' to the newly created field (item style -> "Message Lov Input")

                       

                      Now the new field is displayed with the custom LOV attached to it. Working as anticipated.

                       

                      One issue I still need help here is to make this new field conditionally Rendered and Required based on standard attribute "ByrSuppPVO.showInvHoldReason" (which returns True or False).

                       

                      I have assigned the following properties for Rendered and Required Properties of this Item -

                       

                      SPEL ${oa.ByrSuppPVO.showInvHoldReason}

                       

                      After returning to the Supplier page conditional rendering is working fine (based on ByrSuppPVO.showInvHoldReason True or False) but not the Required attribute.. it always stays as an optional field.

                       

                      Can the ‘Required’ property of an item be set using SPEL syntax through personalization? If it supported, what is it that I am doing wrong?

                       

                      Any suggestions would be greatly appreciated.

                       

                      Thanks,

                      Rajesh

                      • 8. Re: Any issues extending Application Module - ByrSuppAM ?
                        RajPapdeja

                        For Required property are you referring the same VO Attribute that is used to control Rendered Property? (SPEL ${oa.ByrSuppPVO.showInvHoldReason})

                         

                        In this case it will not work as Rendered property can have True/False values and Required property can have yes/no values.

                         

                        You should be defining a new VO attribute (of type String), set its value to yes/no conditionally either in the VO Query or programatically and give this attribute reference in the form of SPEL for Required property

                         

                        Hope this helps.

                        • 9. Re: Any issues extending Application Module - ByrSuppAM ?
                          3518565

                          Hi Raj - Thank you for the clarification and suggestion.. I have decided to go with custom code in the processFormRequest method in the CO. here is what I have but it doesn't appear to be executing this code. Could you please take a look and suggest if there is something that I did wrong.

                           

                           

                          FYI - "xxmwPaymentHoldReason" - is the field that we like to make Required or Optional based on "HoldAllPaymentsFlag" which is in the SupplierVO.

                           

                           

                              public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)

                              {

                                

                                  OAApplicationModule am=pageContext.getApplicationModule(webBean);

                           

                           

                                  //  field that we need to make required or optional

                                   OAMessageLovInputBean xxmwHoldReason = (OAMessageLovInputBean)webBean.findChildRecursive("xxmwPaymentHoldReason");

                                   

                                   //  this is the attribute on the page - checkbox that controls the above filed

                                   OAMessageCheckBoxBean HoldAllPymtsCheckBoxBean = (OAMessageCheckBoxBean)webBean.findChildRecursive("HoldAllPaymentsFlag");

                                   Object HoldAllPymtsCheckBoxObj = HoldAllPymtsCheckBoxBean.getValue(pageContext);

                                   String HoldAllPymtsVal = HoldAllPymtsCheckBoxObj.toString();

                                   

                                   if(HoldAllPymtsVal.equals("on") || "Y".equals(HoldAllPymtsVal)  )

                                   {

                                       xxmwHoldReason.setRequired("yes");

                                   }

                                   

                                   if("N".equals(HoldAllPymtsVal) || HoldAllPymtsVal==null )

                                   {

                                        xxmwHoldReason.setRequired("no");

                                        xxmwHoldReason.setAttributeValue(TABULAR_FUNCTION_VALUE_ATTR, "");

                                   }

                                

                                  super.processFormRequest(pageContext, webBean);

                                         

                              } // end processFormRequest

                           

                           

                          Thanks again, appreciate all your help.

                          Rajesh

                          • 10. Re: Any issues extending Application Module - ByrSuppAM ?
                            RajPapdeja

                            Hi Rajesh,

                             

                            This approach will not work as the framework doesn't support setting Bean properties in the processFormRequest method. That is the reason the framework has provided SPEL and PPR which should be used in this case if you wish to set the required property in PFR.

                             

                            The other approach would be to forward the control to processRequest method using pageContext.forwardImmediatelyToCurrentPage method and use the same code in PR method.

                            • 11. Re: Any issues extending Application Module - ByrSuppAM ?
                              3518565

                              Hi Raj - Thank you so much for your suggestions. Let me take the new approach and will update you.

                               

                              Rajesh

                              • 12. Re: Any issues extending Application Module - ByrSuppAM ?
                                3518565

                                Hi Raj - it is working now with code in the processFormRequest method. Thank you again, for all your help, very much appreciate. I hope you won't mind if reach out to you with other questions.

                                 

                                Thanks,

                                Rajesh

                                • 13. Re: Any issues extending Application Module - ByrSuppAM ?
                                  RajPapdeja

                                  Good to know that all your challenges have been resolved. Please close the thread by marking appropriate posts as Helpful/Correct.

                                   

                                  Regards,

                                  Raj

                                  1 person found this helpful
                                  • 14. Re: Any issues extending Application Module - ByrSuppAM ?
                                    3518565

                                    Hi Raj - Thank you again for your help and I was able to get this working.. However, the user found an issue with my solution. Everything works fine - the LOV fires when the user enters an invalid value and opens up the LOV Window or when the user selects the find button next to the field.

                                    One issue still exists is - if the user doesn't select a value from the LOV window and returns to the field and Click 'Save' by leaving an invalid value in the field (that was entered prior to the LOV window) and it is getting saved to the database.. Basically I need to have the field value validated upon 'Save' similar to when we tab out of this field.

                                     

                                    Are there any attributes (in the LovMap or field properties) that I need to enable to have it fire upon "Save" or do I have to handle this through custom code in the ProcessFormRequest()?

                                     

                                    Thanks

                                    Rajesh