Tuesday, February 14, 2012

Redirect Configurator Extension to new Window

Use below method         
Attach it to the [on command] event of any button.

 public void generateOutput(IRuntimeNode rtNode, HttpServletResponse response)
 {
                        PrintWriter out = response.getWriter();
                        response.setContentType("text/html");
                        response.sendRedirect("www.google.com");
}


or you can embed HTML response in the page.

public void generateOutput(IRuntimeNode rtNode, HttpServletResponse response)
 {

                        PrintWriter out = response.getWriter();
                        response.setContentType("text/html");
                                     sHTML = "<html>\n" +
                                                            "<head>\n " +
                                                            "<title>Information</title><script language='javascript' type='text/javascript'>\n " +
                                                            "function closeWindow(){" +
                                                            "alert('closedd');" +
                                                            "}" +
                                                            "</script></head>\n " +
                                                            "<body onunload='closeWindow()'> " +
                                                            "</body>\n"+
                                                            "</html>\n";
                                                            out.println(sHTML);
}

Monday, February 13, 2012

Call oracle sql functions and procedures form the Java

Call function from the Java

     ConnectionManager cmCon;
     Connection connCon = null;
     CallableStatement cspro = null;
     cmCon = new ConnectionManager(rtNode);
     connCon = cmCon.getConnection();
       
    CallableStatement cs = connCon.prepareCall("{? = call fnd_request.submit_request(varchar2,number)}");
    cs.registerOutParameter(1, Types.INTEGER);
    cs.setString(2, "application name");
    cs.setInt(3, 896);
    cs.execute();
    requestId = cs.getString(1);


Call Procedure from a Java

CallableStatement cs = connection.prepareCall("call my_proc(?,?)");
cs.setString(1,"address");
cs.setInt(2,654);
cs.execute();

Thursday, February 9, 2012

set profile options from pl sql

Procedure to set the profile options form backend. PL SQL

create or replace procedure my_proc(profile_name varchar2,profile_value varchar2)
as
stat BOOLEAN;
begin
result:= fnd_profile.SAVE (profile_name, profile_value, 'USER',0);
--IF result THEN
--DBMS_OUTPUT.put_line ('result= TRUE - profile updated');
--ELSE
--DBMS_OUTPUT.put_line ('result= FALSE - profile NOT updated');
--END IF;
COMMIT;
end;



You can use below method also.


begin
APPS.FND_PROFILE.PUT('profile_name', profile_value);
end; 

Regards
Kaushal Bhati
kosal01bhati@gmail.com



Tuesday, February 7, 2012

Configurator Extension to get Profile Options

First create a profile option through Application Developer

DOWNLOAD Profile option

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct yourLdtfilename.ldt PROFILE PROFILE_NAME="your_profile_name" APPLICATION_SHORT_NAME="application_short_name"


UPLOAD Profile option

FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct yourLdtfilename.ldt

Use Below code to get the profile option value.

        String appsProfile = null;
        CZWebAppsContext ctx = (CZWebAppsContext)pRuntimeNode.getConfiguration().getContext();
        Profiles profiles = new Profiles(ctx);
        appsProfile = profiles.getSiteLevelProfile(profileName);
        if (appsProfile == null) {
          appsProfile = profiles.getProfile(profileName);
        }
        return appsProfile;




Email:kosal01bhati@gmail.com

Tuesday, January 31, 2012

TSO Configurator Extensions

CX that will Assign Line Type to the Quote According to the Properties that exists in the Configurator Structure.

Java class "AssignItemLineTypeCX" is used to assign Line Type to the Quote according to the Properties.

it is in the package oracle.apps.cz.cx.tso

Java class "CZIBAttributeCX" is used to create the IB Attributes of the BOM Item.

it is in the package oracle.apps.cz.cx.tso

Wednesday, January 25, 2012

Call Concurrent Program with Configurator Extension

First you need to intialize Apps parameter.

             CallableStatement cspro =
             connection.prepareCall("{call FND_GLOBAL.APPS_INITIALIZE(?,?,?)}");
             cspro.setString(1, "0");
             cspro.setString(2, "20420");
             cspro.setString(3, "1");
             cspro.executeUpdate();
             cspro.close();

After that Use ConcurrentRequest class to submit request from the you java class.

             ConcurrentRequest cr = new ConcurrentRequest(connection);
             int requestId = cr.submitRequest("Application Name",
"Prog short Name", "Prog Description", null, false, parameter in vector);
             System.out.println(requestId);

check the status of the concurrent program.


SELECT * FROM FND_CONCURRENT_REQUESTS WHERE   REQUEST_ID=your request id.



mail me for any further info.




Monday, January 16, 2012

Commands for Bouncing Apache after Change in Java file or Jserv.properties


first you have to stop the apache server.
$COMMON_TOP/admin/scripts/"your instance name"/adapcctl.sh stop

then you have to start the apache server.
$COMMON_TOP/admin/scripts/"your instance name"/adapcctl.sh start

your changes will be reflected now.