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