Thursday, September 18, 2014

Disable DFF Attributes in OAF Page

Diable DFF Attributes in OAF Page

Create a raw text item and give below java script.  Add 

SCRIPT type="text/javascript"

     var elementInDocument = function (element) {         while (element = element.parentNode) {             alert('ele ' + element);             alert('doc ' + document);             if (element == document) {                 return true;             }         }         return false;     };     if (elementInDocument("xxswCACPageNewFlag") == false) { if (document.getElementById("salesChannel").value != '') { document.getElementById("salesChannel").disabled = true; }if (document.getElementById("ActFlexField1").value != '') {             document.getElementById("ActFlexField1").disabled = true;             document.getElementById("ActFlexField2").disabled = true;             document.getElementById("ActFlexField3").disabled = true;             var cacGroup = document.getElementById("ActFlexField1__xc_0");             var cacGroupImg = cacGroup.getElementsByTagName("a");             cacGroupImg[0].style.visibility = 'hidden';             cacGroupImg[0].onclick = function () {                 return false;             } ;  var cacCode = document.getElementById("ActFlexField2__xc_0");             var cacCodeImg = cacCode.getElementsByTagName("a");             cacCodeImg[0].style.visibility = 'hidden';             cacCodeImg[0].onclick = function () {                 return false;             }       }        } 

SCRIPT



Friday, September 5, 2014

Menu - Sub Menu - Function (as tree structure) for a given Menu

SELECT LPAD(' ', 6*(LEVEL-1)) || menu_entry.entry_sequence sequence
, LPAD(' ', 6*(LEVEL-1)) || menu.user_menu_name SubMenu_Description
, LPAD(' ', 6*(LEVEL-1)) || func.user_function_name Function_Description
, menu.menu_id
, func.function_id
, menu_entry.grant_flag Grant_Flag
, DECODE( menu_entry.sub_menu_id
, null, 'FUNCTION'
, DECODE( menu_entry.function_id
, null, 'SUBMENU'
, 'BOTH')
) Type
FROM fnd_menu_entries menu_entry,
fnd_menus_vl menu,
fnd_form_functions_vl func
WHERE menu_entry.sub_menu_id = menu.menu_id(+)
AND menu_entry.function_id = func.function_id(+)
AND grant_flag = 'Y'
START WITH menu_entry.menu_id = (SELECT menu_id
FROM fnd_menus_tl menu2
WHERE menu2.user_menu_name = :Parent_Menu_User_Name)
CONNECT BY menu_entry.menu_id = PRIOR menu_entry.sub_menu_id
ORDER SIBLINGS BY menu_entry.entry_sequence 

Monday, July 14, 2014

NLS_LANGUAGE

To set in unix / linux

To download concurrent program ldt with translations we have to take 2 ldt files for each language
first take english file

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_CP_us.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST" CONCURRENT_PROGRAM_NAME="XX_CONCURRENT_PROGRAM"

To change language use below

export NLS_LANG="BRAZILIAN PORTUGUESE_BRAZIL.WE8ISO8859P1"

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_CP_br.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST" CONCURRENT_PROGRAM_NAME="XX_CONCURRENT_PROGRAM".

To change language in Database use
alter session

Ex -
ALTER SESSION SET NLS_LANGUAGE='BRAZILIAN PORTUGUESE';

Thursday, June 26, 2014

Useful queries

Fnd concurrent requests for request set

select fc.* from fnd_amp_requests_v fc start with parent_request_id = 39432608 connect by prior request_id = parent_request_id and level = 2;

Thursday, June 12, 2014

Make DFF Segment readonly through Security Rules

Found good blog post

http://erpschools.com/articles/make-dff-segment-readonly-through-security-rules

Just copying it here for my records -

Goal: Define new DFF segment in Transactions Form and make it read only to Receivables Manager responsibility. All other responsibilities will have access to enter and edit the values and Receivables Manager will have access to only read but not edit and enter the value.
You cannot make DFF segment read-only through personalization but you can restrict users from changing the value in DFF segment through personalization by displaying error message when they try to save the form.
Steps:
1. Define New Segment for DFF in Transactions forms.
2. Define Security Rules
3. Test it.
If you are not familiar with enabling the DFF (Descriptive FlexFields) click here
Define new SEGMENT for DFF in Transactions Form
Navigation: Receivables Manager >> Transactions >> Transactions
alt
alt
click on the box which is enclosed in []
alt
So we have already one segment Available.
DFF that I have in this form is
TitleTransaction Information
ApplicationReceivables
And it has one segment enabled and displayed.
Navigation: Application Developer >> Flexfield >> Descriptive >> Segments
alt
alt
Enter F11 and then fill the information
: Receivables
Title: Transaction Information
Do CTL + F11
alt
uncheck the “Freeze Flexfield Definition”
alt
Click OK
Now the screen looks like this.
alt
alt
Add New Segment by clicking + Icon on the toolbar and enter the following information
Number10
NameDEMO
Window PromptERP DEMO
ColumnATTRIBUTE11
Value Set: erp_demo (click here to see how to define value set)
alt
Click open
alt
Check Security Enabled Flag and uncheck the Required flag
save (CTL+S)
Close it.
Close Segments Screen.
Check the Freeze Flexfield Definition check box
alt
Click OK.
Save it.
alt
alt
Click OK.
Close this Form.
Define Security Rules
Navigation: System Administrator Responsibility >> Security >> Responsibility >> ValueSet >> Define
alt
Click to open
alt
Enter existing value set name erp_demo which we assigned to DFF segment that we defined above.
alt
Click Find
alt
Enter the following information
Nameerpschools
Descriptionerpschools.com
Messageerpschools.com demo
In Security Rile Elements
TypeExclude
FromA
ToD
Add New record and enter
TypeInclude
FromDon’t fill anything
ToDon’t fill anything
alt
Save it.
Click on Assign Button to restrict this functionality to a specific responsibility. This is optional.
alt
Enter the following information
ApplicationReceivables
ResponsibilityReceivables Manager
Nameerpschools
alt
Save and close.
Testing:
To test the changes Navigate to any Receivables Responsibility like US Receivables Manager which has access to Transactions form and query up any record.
Then navigate to DFF and enter some value for ERP DEMO and save the record.
Come back to Receivables Manager responsibility and query up the same transaction which you saved above.
alt
Define New ValueSet:
alt
To assign values to this value set follow the navigation path below and do accordingly
Navigation: Application Developer >> Flexfield >> Descriptive >> Values

alt
alt

Sunday, June 1, 2014

XMl syntaxes

To display number in words
xdofx:to_check_number(12345.67, 'USD') 
Good link - https://blogs.oracle.com/xmlpublisher/entry/numbers_to_words_update

format-number:PaymentAmount/Value;'999G999D99'
xdofx:lpad(PaymentAmount/Value,12,'*')

xdoxslt:lpad(format-number(number(PaymentAmount/Value),’###,##0.00’),13,’*’)
https://community.oracle.com/thread/634899?tstart=0

Exponential number fix
fo:bidi-override direction="ltr" unicode-bidi="bidi-override">

Ref issue
----------

In MS Word, under BI Publisher-> Options, set Form Field Size to Backward Compatible instead of removing tags

------------
Change decimal format in RTF template

Create a field on top of RTF file like below.  Create some dummy field.



In field use like below


----

Table locking because of open form

In Oracle form created master detail blocks with master block on a view based on master table.
When form is opened in any session, table is getting locked and not able to perform DML from any other session or database on other records.

http://www.orafaq.com/forum/t/141137/2/ 
https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:292016138754 

Solution is to create an index on child table for foreign key column 

CREATE INDEX emp_idx1 ON emp(deptno)