Monday, May 31, 2021

Restrict outgoing emails from Oracle ERP Cloud based on Email domains

One of the major concerns during the implementation phase is the emails from non-production ERP Cloud environment will be sent to the outside entities based on real email addresses. For e.g. when the development team tests a Customer invoice, the customer invoice will be inadvertently sent to the real customers, since the customer's real email address was setup in Cloud. This will cause huge issues since the customer invoices are sent out from a Test environment and obviously the document has incorrect values and the customer is not supposed to pay. The problem gets bigger if the emails are sent out to multiple customers. 

Oracle ERP Cloud provides an option to avert this situation by providing only specific email domains in the BI setup. This will prevent bursting the documents like Customer Invoice, Balance Forward Billing, Customer Statements and other similar documents that get bursted from BI Publisher.

Login to BI Publisher with xmlpserver URL. i.e.https://fa-xxxx-dev-xxxxx.xx.xxx.oraclecloud.com/xmlpserver/servlet/home

Click on Administration as highlighted below.



Click on Delivery Configuration



 Enter the email domains to which emails are okay to be sent from that instance.




Tuesday, August 16, 2016

Oracle 9i - Identify records that have special characters in a database column

From Oracle 10G onwards, there are REGEXP utilities available to identify special characters in a string.
In this short blog, I would like to provide a simple SQL that can be used in Oracle 9i to identify the records that have special characters in a database column.

SELECT emp_no, emp_name, emp_name_trans
  FROM (SELECT emp_no,
               emp_name,
               TRANSLATE (
                  emp_name,
                  '00123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ',
                  '0')
                  emp_name_trans
          FROM employee)
 WHERE emp_name_trans IS NOT NULL

Note:- This query is to find out the employees whose name has any special characters in it.

Wednesday, June 29, 2016

Mobile Apps - Native, Hybrid and Web Apps.



We hear a lot about mobile application development in the modern world and the developers talking about Native Apps, Hybrid Apps and Web Apps.
In this blog, I would like to provide a brief overview on these types of apps.

As we all know, there are different mobile operating systems in the market like iOS, Android, Windows etc.
Native App is an app that is developed for specific operating system. i.e. you will have different code base and possibly different development team for each operating system.
Examples of Native App: Facebook, WhatsApp etc.

Web App is in fact a website that is developed to be rendered like a native app in a mobile device. You will need to first open the website in your mobile browser and then do 'Add to Home screen' or 'Add Bookmark' to have it rendered like an app in your mobile device.
Example: app.ft.com (Financial Times)

Hybrid app is an app that is developed to work for cross platform. i.e. With a single code base, you should be able to install the app in iOS, Android etc.

Each kind of development has its own pros and cons. I will try to depict some of those here.


Sunday, May 22, 2016

Responsive design in Oracle ADF


Nowadays the need to create a web application based on a responsive design is becoming very common. ADF in its latest version (as of today), i.e. 12.2.1 provides the capability to address this. There is a feature in ADF called Match Media Behavior which helps the developer to set the layout and placement of UI components in a page based on the screen size. This enables the appropriate rendering of the page regardless of whether it is being rendered in a desktop, tablet or a mobile device. In this way, customers can see the possibilities of getting away from building a mobile app, which requires additional infrastructure, separate code base etc.

In this blog, I am providing a simple example of using the matchMediaBehavior tag. My page has a bar chart and a table. When the page is rendered in a desktop device, these components should render horizontally, and when it is rendered in a tablet device, these components should be displayed vertically, so that the table will be rendered below the bar chart.

Here is the code of the page:

<?xml version='1.0' encoding='UTF-8'?>
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces" xmlns:f="http://java.sun.com/jsf/core">
  <af:panelGroupLayout id="pgl1" layout="horizontal">
    <af:matchMediaBehavior matchedPropertyValue="vertical" propertyName="layout" 
  mediaQuery="screen and (max-width: 900px)"/>
    <dvt:barChart orientation="vertical" id="barChart1" var="row" value="#{bindings.EmpDetailsVO1.collectionModel}">
      <dvt:chartLegend id="cl1"/>
      <f:facet name="dataStamp">
        <dvt:chartDataItem id="di1" series="#{bindings.EmpDetailsVO1.hints.Salary.label}" value="#{row.Salary}"
                           group="#{row.DepartmentName}"/>
      </f:facet>
    </dvt:barChart>
    <af:table value="#{bindings.EmpDetailsVO11.collectionModel}" var="row" rows="#{bindings.EmpDetailsVO11.rangeSize}"
              emptyText="#{bindings.EmpDetailsVO11.viewable ? 'No data to display.' : 'Access Denied.'}"
              rowBandingInterval="0" selectedRowKeys="#{bindings.EmpDetailsVO11.collectionModel.selectedRow}"
              selectionListener="#{bindings.EmpDetailsVO11.collectionModel.makeCurrent}" rowSelection="single"
              fetchSize="#{bindings.EmpDetailsVO11.rangeSize}" id="t1">
      <af:column sortProperty="#{bindings.EmpDetailsVO11.hints.FirstName.name}" sortable="true"
                 headerText="#{bindings.EmpDetailsVO11.hints.FirstName.label}" id="c1">
        <af:inputText value="#{row.bindings.FirstName.inputValue}"
                      label="#{bindings.EmpDetailsVO11.hints.FirstName.label}"
                      required="#{bindings.EmpDetailsVO11.hints.FirstName.mandatory}"
                      columns="#{bindings.EmpDetailsVO11.hints.FirstName.displayWidth}"
                      maximumLength="#{bindings.EmpDetailsVO11.hints.FirstName.precision}"
                      shortDesc="#{bindings.EmpDetailsVO11.hints.FirstName.tooltip}" id="it1">
          <f:validator binding="#{row.bindings.FirstName.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="#{bindings.EmpDetailsVO11.hints.LastName.name}" sortable="true"
                 headerText="#{bindings.EmpDetailsVO11.hints.LastName.label}" id="c2">
        <af:inputText value="#{row.bindings.LastName.inputValue}"
                      label="#{bindings.EmpDetailsVO11.hints.LastName.label}"
                      required="#{bindings.EmpDetailsVO11.hints.LastName.mandatory}"
                      columns="#{bindings.EmpDetailsVO11.hints.LastName.displayWidth}"
                      maximumLength="#{bindings.EmpDetailsVO11.hints.LastName.precision}"
                      shortDesc="#{bindings.EmpDetailsVO11.hints.LastName.tooltip}" id="it2">
          <f:validator binding="#{row.bindings.LastName.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="#{bindings.EmpDetailsVO11.hints.Salary.name}" sortable="true"
                 headerText="#{bindings.EmpDetailsVO11.hints.Salary.label}" id="c3">
        <af:inputText value="#{row.bindings.Salary.inputValue}" label="#{bindings.EmpDetailsVO11.hints.Salary.label}"
                      required="#{bindings.EmpDetailsVO11.hints.Salary.mandatory}"
                      columns="#{bindings.EmpDetailsVO11.hints.Salary.displayWidth}"
                      maximumLength="#{bindings.EmpDetailsVO11.hints.Salary.precision}"
                      shortDesc="#{bindings.EmpDetailsVO11.hints.Salary.tooltip}" id="it3">
          <f:validator binding="#{row.bindings.Salary.validator}"/>
          <af:convertNumber groupingUsed="false" pattern="#{bindings.EmpDetailsVO11.hints.Salary.format}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="#{bindings.EmpDetailsVO11.hints.DepartmentName.name}" sortable="true"
                 headerText="#{bindings.EmpDetailsVO11.hints.DepartmentName.label}" id="c5">
        <af:inputText value="#{row.bindings.DepartmentName.inputValue}"
                      label="#{bindings.EmpDetailsVO11.hints.DepartmentName.label}"
                      required="#{bindings.EmpDetailsVO11.hints.DepartmentName.mandatory}"
                      columns="#{bindings.EmpDetailsVO11.hints.DepartmentName.displayWidth}"
                      maximumLength="#{bindings.EmpDetailsVO11.hints.DepartmentName.precision}"
                      shortDesc="#{bindings.EmpDetailsVO11.hints.DepartmentName.tooltip}" id="it5">
          <f:validator binding="#{row.bindings.DepartmentName.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="#{bindings.EmpDetailsVO11.hints.JobTitle.name}" sortable="true"
                 headerText="#{bindings.EmpDetailsVO11.hints.JobTitle.label}" id="c6">
        <af:inputText value="#{row.bindings.JobTitle.inputValue}"
                      label="#{bindings.EmpDetailsVO11.hints.JobTitle.label}"
                      required="#{bindings.EmpDetailsVO11.hints.JobTitle.mandatory}"
                      columns="#{bindings.EmpDetailsVO11.hints.JobTitle.displayWidth}"
                      maximumLength="#{bindings.EmpDetailsVO11.hints.JobTitle.precision}"
                      shortDesc="#{bindings.EmpDetailsVO11.hints.JobTitle.tooltip}" id="it6">
          <f:validator binding="#{row.bindings.JobTitle.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="#{bindings.EmpDetailsVO11.hints.City.name}" sortable="true"
                 headerText="#{bindings.EmpDetailsVO11.hints.City.label}" id="c7">
        <af:inputText value="#{row.bindings.City.inputValue}" label="#{bindings.EmpDetailsVO11.hints.City.label}"
                      required="#{bindings.EmpDetailsVO11.hints.City.mandatory}"
                      columns="#{bindings.EmpDetailsVO11.hints.City.displayWidth}"
                      maximumLength="#{bindings.EmpDetailsVO11.hints.City.precision}"
                      shortDesc="#{bindings.EmpDetailsVO11.hints.City.tooltip}" id="it7">
          <f:validator binding="#{row.bindings.City.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="#{bindings.EmpDetailsVO11.hints.StateProvince.name}" sortable="true"
                 headerText="#{bindings.EmpDetailsVO11.hints.StateProvince.label}" id="c8">
        <af:inputText value="#{row.bindings.StateProvince.inputValue}"
                      label="#{bindings.EmpDetailsVO11.hints.StateProvince.label}"
                      required="#{bindings.EmpDetailsVO11.hints.StateProvince.mandatory}"
                      columns="#{bindings.EmpDetailsVO11.hints.StateProvince.displayWidth}"
                      maximumLength="#{bindings.EmpDetailsVO11.hints.StateProvince.precision}"
                      shortDesc="#{bindings.EmpDetailsVO11.hints.StateProvince.tooltip}" id="it8">
          <f:validator binding="#{row.bindings.StateProvince.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="#{bindings.EmpDetailsVO11.hints.RegionName.name}" sortable="true"
                 headerText="#{bindings.EmpDetailsVO11.hints.RegionName.label}" id="c10">
        <af:inputText value="#{row.bindings.RegionName.inputValue}"
                      label="#{bindings.EmpDetailsVO11.hints.RegionName.label}"
                      required="#{bindings.EmpDetailsVO11.hints.RegionName.mandatory}"
                      columns="#{bindings.EmpDetailsVO11.hints.RegionName.displayWidth}"
                      maximumLength="#{bindings.EmpDetailsVO11.hints.RegionName.precision}"
                      shortDesc="#{bindings.EmpDetailsVO11.hints.RegionName.tooltip}" id="it10">
          <f:validator binding="#{row.bindings.RegionName.validator}"/>
        </af:inputText>
      </af:column>
    </af:table>
  </af:panelGroupLayout>
</ui:composition>


Tip: To test the behavior of page’s rendition in a tablet device, you can decrease size of the browser window.

When the page is rendered in desktop device


When the page is rendered in tablet device

Sunday, January 31, 2016

OAF Error : java.lang.IllegalArgumentException: Unknown signal: ALRM


I have seen questions in OTN forum where people seeking clarification on the below error that they see in the log while running OAF pages from Jdeveloper.

java.lang.IllegalArgumentException: Unknown signal: ALRM


This error message can safely be ignored, as per Oracle. And the justification is,
Signal handler was added in order to provide additional debug facilities such that when the ALRM signal is sent to the JVM process, it will dump out AM statistics/information to the console.  The signal handler is only used for diagnostic purposes so this error will not impact the JDeveloper runtime.


You may as well check the MOS note, java.lang.IllegalArgumentException: Unknown signal: ALRM when using JDeveloper With OA Extension (Doc ID 431140.1).

Saturday, January 16, 2016

Change the Color of Prompt and Value of Text field in OAF

In this blog, I try to handle a scenario where we need to set the color of Prompt and Value of a text field in an OAF page.
We will not be able to set the CSS for the text in the prompt of a messageTextInput field. I am sharing a workaround here for that.
We create a rowLayout and two cellFormats with in it. The first cellFormat will have a staticStyledText which holds the Prompt text and the second cellFormat will have a messageTextInput field which holds the Value.

Page XML Code
<oa:header id="TestPromptColRN">  
   <ui:contents>  
   <oa:rowLayout id="RL">  
   <ui:contents>  
   <oa:cellFormat id="Cell1">  
      <ui:contents>  
      <oa:staticStyledText id="SST1" text="PO Number" prompt="PO Number"/>  
      </ui:contents>  
   </oa:cellFormat>  
   <oa:cellFormat id="Cell11">  
      <ui:contents>  
      <oa:messageTextInput id="MTI1"/>  
      </ui:contents>  
   </oa:cellFormat>  
   </ui:contents>  
   </oa:rowLayout>  
   </ui:contents>  
</oa:header>  


Java code to be placed in the processRequest of the Page's Controller.
CSSStyle customCss = new CSSStyle();  
customCss.setProperty("color", "#FF0000");  
OAStaticStyledTextBean sstBean =   
    (OAStaticStyledTextBean)webBean.findChildRecursive("SST1");  
if (sstBean != null)  
    sstBean.setInlineStyle(customCss);  
OAMessageTextInputBean mtiBean =   
    (OAMessageTextInputBean)webBean.findChildRecursive("MTI1");  
if (mtiBean != null)  
    mtiBean.setInlineStyle(customCss); 


The output will be like.



Tuesday, January 5, 2016

Disabling autocomplete in an OAF page

I have come across a question in OTN forum where a user asked to secure the credit card number entry in the Message text field of OAF.
Basically the user was looking for an option to turn off the Auto-Complete of the input field.
He cannot make the field as a Password field, because after data entry the number has to be legible to the user to confirm back with the customer.

Here is the solution given :-

If you have only one field in your page where you want to turn off the Auto complete, you can use the below.

OAMessageTextInputBean textInBean = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("item1");
textInBean.setNoAutoComplete(true);


If you want to turn off the Auto complete for whole page, you can use the below code.

pageContext.putJavaScriptFunction("disableAutoComplete","function disableAutoComplete() { document.DefaultFormName.autocomplete='off';}");
OABodyBean bodyBean = (OABodyBean) pageContext.getRootWebBean();
bodyBean.setOnLoad("disableAutoComplete();");