Monday, 9 December 2019

Get Decode Value From Lookup Using API



                                           Get Decode Value Lookup Using API


package demo.com;

import Thor.API.Exceptions.tcAPIException;
import Thor.API.Exceptions.tcColumnNotFoundException;
import Thor.API.Exceptions.tcInvalidLookupException;

import java.util.HashMap;
import java.util.Hashtable;
import oracle.iam.platform.OIMClient;
import Thor.API.tcResultSet;
import Thor.API.Operations.tcLookupOperationsIntf;


import oracle.core.ojdl.logging.ODLLevel;

public class UpdateLookup {
  private static final String CLASS_NAME = UpdateLookup.class.getSimpleName();
    private static String OIMUserName = "xelsysadm";
    private static String OIMPassword = "*****";
    private static String OIMURL = "t3://localhost:14000";
    private static String OIMInitialContextFactory ="weblogic.jndi.WLInitialContextFactory";
      //OIM Client Initiallization
        public static OIMClient loginWithCustomEnv() {
        Hashtable env = new Hashtable();
        env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, OIMInitialContextFactory);
        env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, OIMURL);
     // New Properties needs to be added into system property.
        System.setProperty("OIM.AppServerType", "wls");
        System.setProperty("APPSERVER_TYPE", "wls");
        System.setProperty("java.security.auth.login.config","C:\\Users\\RK\\TestReconEvent\\oimclient\\conf\\authwl.conf");
        OIMClient oimClient = new OIMClient(env);
         try {
              System.out.println("12");
              oimClient = new OIMClient(env);
              System.out.println("Initiating Oim Client");
              oimClient.login(OIMUserName, OIMPassword.toCharArray());
              System.out.println("got OIM client successfully");
              System.out.println("Client - " + oimClient);
             } catch (Exception e) {
              System.out.println("Error: " + e);
               oimClient = null;
                          }
        return oimClient;
     
        }
//        public void addLookupEntry(OIMClient oimClient,String lookupName,String lookupCodekey,String Decode)  {
//             oimClient= null;
//            OIMClient oimClient=this.loginWithCustomEnv();
//            System.out.println("Got the value of lookupName:"+lookupName);
//            System.out.println("Got the value of lookupCodekey:"+lookupCodekey);
//            System.out.println("Got the value of Decode:"+Decode);
//         try {
//          tcLookupOperationsIntf lookupOps = oimClient.getService(tcLookupOperationsIntf.class);
//          lookupOps.addLookupValue(lookupName,lookupCodekey, Decode, "", "");
//         
//         } catch (Exception e) {
//          e.printStackTrace();
//         }
//        }
   //     public void readLookupValues(String lookupname) {
//            OIMClient client=this.loginWithCustomEnv();
//         try {
//          tcLookupOperationsIntf lookupOps = client.getService(tcLookupOperationsIntf.class);
//          tcResultSet values = lookupOps.getLookupValues(lookupname);
//          for (int i = 0; i < values.getRowCount(); i++) {
//           values.goToRow(i);
//           System.out.print(values.getStringValue("Lookup Definition.Lookup Code Information.Decode"));
//           System.out.println("," + values.getStringValue("Lookup Definition.Lookup Code Information.Code Key"));
//          }
//         } catch (Exception e) {
//          e.printStackTrace();
//         }
//        }
     
     
     
   
  private String readLookupValues(String lookupName,String lookupCodekey)
        {
           String methodName = "::getLookupData::";
         
            OIMClient client=this.loginWithCustomEnv();
           String Decode=null;
           tcLookupOperationsIntf lookupOpsIntf = null;
           System.out.println("getLookupValue " + lookupName + "," + lookupCodekey);
           try
                        {
                                lookupOpsIntf = client.getService(tcLookupOperationsIntf.class);
                                Decode = lookupOpsIntf.getDecodedValueForEncodedValue(lookupName, lookupCodekey);
                        }
                        catch (Exception e)
                        {
                                System.out.println("error looking up " + e);
                        }
                        finally
                        {
                                if ( lookupOpsIntf != null )
                                {
                                        lookupOpsIntf.close();
                                }

                        }
                        System.out.println("getLookupValue return " + Decode);
                        return Decode;
                }
        private boolean empIdExit(String emp)
          {
                  boolean isExit=false;
           
                 // HashMap<String, String> map=null;
                  String map=null;
              try
                    {
                  if(map==null)
                  {
                    map= readLookupValues("Lookup.Workday.EmpNumber.ReconValidation",emp);
                      System.out.println(map);
                    //  logger.info("#### map $$$$ " + map);
           
              if(map.equals(emp))
                 {
                     System.out.println(emp);
                         return isExit=true;
                       
                 }
               
                 else{
                         return isExit;
       
           
          }
     

//private boolean empIdExit(String emp)
//      {
//              boolean isExit=false;
//              HashMap<String, String> map=null;
//              if(map==null)
//              {
//                map= readLookupValues("Lookup.Workday.EmpNumber.ReconValidation", emp, emp);
//                 // logger.info("#### map $$$$ " + map);
//                 System.out.println("map"+map);
//              }
//             if(map.containsKey(emp))
//             {
//                     return isExit=true;
//             }
//             else{
//                     return isExit;
//             }
//      }
 
 
//    private HashMap<String, String> readLookupValues(String lookupName,String lookupCode,String lookupDecode)
//            {
//              String methodName = "::readLookupValues::";
//                OIMClient client=this.loginWithCustomEnv();
//              HashMap<String, String> lookupValues = new HashMap();
//              tcResultSet lookupResultSet = null;
//                     
//                tcLookupOperationsIntf lookupOps = (tcLookupOperationsIntf)client.getService(tcLookupOperationsIntf.class);
//              //  logger.info
//              System.out.println("#### lookupOps $$$$ " + lookupOps);
//             
//              try
//              {
//                lookupResultSet = lookupOps.getLookupValues(lookupName);
//                int i;
//                if ((lookupResultSet != null) && (lookupResultSet.getRowCount() > 0))
//                {
//                  for (i = 0; i < lookupResultSet.getRowCount(); i++)
//                  {
//                    lookupResultSet.goToRow(i);
//                    try
//                    {
//                      lookupCode = lookupResultSet.getStringValue("Lookup Definition.Lookup Code Information.Code Key");
//                      //  logger.info
//                            System.out.println("#### lookupCode $$$$ " + lookupCode);
//                     
//                    }
//                    catch (tcColumnNotFoundException localtcColumnNotFoundException1) {}
//
//                        try {
//                            lookupDecode = lookupResultSet.getStringValue("Lookup Definition.Lookup Code Information.Decode");
//                          //  logger.info
//                          System.out.println("#### lookupDecode $$$$ " + lookupDecode);
//                         
//                        } catch (tcColumnNotFoundException e) {
//                        }
//                        lookupValues.put(lookupCode, lookupDecode);
//                  }
//                }
//             
//                if ((lookupValues == null) && (lookupValues.size() == 0))
//                {
//               
//                  return null;
//                }
//              } catch (tcInvalidLookupException e) {
//            } catch (tcAPIException e) {
//            }
//            System.out.println("#################### Reading Lookup Completed ################");
//            return lookupValues;
//           
//            }
        public static void main(String args[]) {
          UpdateLookup obj = new UpdateLookup();
         //  obj.addLookupEntry(null,"Lookup.Data.AAPName","AAPNam26","AAPData26");
       obj.empIdExit(null);
      // obj.empIdExit(null);
       
        }
    }

Wednesday, 20 November 2019

Add Delete and Update Lookup Values From Standalone Code:

OracleIdentityManager


Add Delete and Update Lookup Values From Standalone Code:

import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.HashMap;

import javax.security.auth.login.LoginException;

import com.csvreader.CsvReader;

import Thor.API.Exceptions.tcAPIException;
import Thor.API.Exceptions.tcDuplicateLookupCodeException;
import Thor.API.Exceptions.tcInvalidAttributeException;
import Thor.API.Exceptions.tcInvalidLookupException;
import Thor.API.Exceptions.tcInvalidValueException;
import Thor.API.Operations.tcLookupOperationsIntf;
import oracle.iam.platform.OIMClient;
import oracle.iam.request.api.RequestService;
import oracle.iam.request.vo.RequestData;

public class LookupUtill {

/**
* Contains lookup operations (standalone code using OIMClient)
*/
public static OIMClient oimClient;

private tcLookupOperationsIntf lookupOps;
PreparedStatement pstmt= null ;
Connection con = null;

public static void main(String[] args) {
String oimInitialContextFactory = "weblogic.jndi.WLInitialContextFactory";
java.util.Hashtable<String, String> env = new java.util.Hashtable<String, String>();
env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_FACTORY_INITIAL,oimInitialContextFactory);
env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_PROVIDER_URL, "t3://localhost:port");
System.setProperty("java.security.auth.login.config", "C:\\Users\\xyz\\TestReconEvent\\oimclient\\conf\\authwl.conf");
System.setProperty("OIM.AppServerType", "wls");       
System.setProperty("APPSERVER_TYPE", "wls");
oimClient = new OIMClient(env);
try {
oimClient.login("xelsysadm","pwd".toCharArray());
System.out.println("Connected Successfully");
LookupUtill lu =new LookupUtill();
//lu.addLookup();
//lu.removeLookup();
//lu.AddLookUpValuestoLookups();
lu.AddLookUpValues();
//lu.AddLookUpValuestoLookups();
//lu.removeEntryFromLookup();
// lu.updateEntryFromLookup();
} catch (LoginException e) {
System.out.println("in LoginException ");
e.printStackTrace();
}

}

 


// public LookupUtill(){
// try{
// String usrname = "xyz_oim";
// String pwd = "pwd";
// String driver = "oracle.jdbc.driver.OracleDriver";
// String url = "jdbc:oracle:thin:@DBhost:port:servicename";
//
// Class.forName(driver);
// System.out.println(" after forname");
// con=DriverManager.getConnection(url,usrname,pwd);
// System.out.println(" database connection established successfully");
// }
// catch(Exception e){
//
// e.printStackTrace();
// }
// }





/*
 * Creates a lookup definition.
 * @param   lookupOps    tcLookupOperationsIntf service object
 * @param   lookupName   Name of the lookup definition to be created
 * Note: "Group" Field must be specified for lookup definition when using the Design Console.
 * May need to call update operation on Group field.
 */
//public void addLookup()
//{
//   CsvReader dataValue;
//     try {
//     lookupOps = oimClient.getService(tcLookupOperationsIntf.class);
//     String csvFileLoc="E:\\Code\\CSV\\LookupUtill\\addLookup.csv";
//     String csvSeparator=",";
//        char c[]=csvSeparator.toCharArray();
//      
//  
//      
//         dataValue = new CsvReader(csvFileLoc,c[0]);
//         dataValue.readHeaders();
//
//
//                                 while (dataValue.readRecord())
//                                 {
//                                         String lookupName = dataValue.get("lookupName");
//                                         System.out.println("lookupName :::::" +lookupName);
//                                     lookupOps.addLookupCode(lookupName);
//                                     System.out.println(" Lookup created" +lookupName);     
//                                      
//                                 }
//                                 System.out.println("All Lookups created successfully ");
//
// 
// } catch (tcAPIException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (tcDuplicateLookupCodeException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }catch(Exception e){
// e.printStackTrace();
// }
// //adds a lookup
//}


/*
 * Removes an entry from a lookup. Delete is determined by an entry's code key.
 * @param   lookupOps    tcLookupOperationsIntf service object
 * @param   lookupName   Name of the lookup definition
 * @param   codeKey      Value of an entry's code key
 * Note: If there are duplicates of the code key in your lookup, only one of them will be removed.
 */
//public void removeLookup()
//{
// lookupOps = oimClient.getService(tcLookupOperationsIntf.class);
// String lookupName="Lookup.demo.oim";
//     try {
// lookupOps.removeLookupCode(lookupName);
// System.out.println("*********Lookup Removed  *********");
// } catch (tcAPIException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (tcInvalidLookupException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
//}



/*
 * @Usage : Method to get Contractor values
 * @parameters : NA
 * @return : void
 */
public void AddLookUpValues() {
    CsvReader dataValue;
    try {
    lookupOps = oimClient.getService(tcLookupOperationsIntf.class);
    //String lookupName="Lookupname";
    //String lookupName="Lookupname";
    //String lookupName="Lookupname";
    //String lookupName="Lookupname";
    //String lookupName = "Lookupname";
    //String lookupName = "Lookupname";
    // String lookupName="Lookupname";
    // String lookupName="Lookupname";
    String lookupName="Lookupname";
    //String lookupName="Lookupname";
    System.out.println("LookupName :::::" +lookupName);
    String csvFileLoc="C:\\RK\\LOOKUP.csv";
    String csvSeparator=",";
       char c[]=csvSeparator.toCharArray();
       
 
     
        dataValue = new CsvReader(csvFileLoc,c[0]);
        dataValue.readHeaders();


                                while (dataValue.readRecord())
                                {
                                        String code = dataValue.get("Code");
                                        System.out.println("Code :::::" +code);
                                        String meaning = dataValue.get("Meaning");
                                        System.out.println("Meaning :::::"+meaning);
                                     
                                     
                                     
                                        //** Get AppInstanceDisplayName to update Lookupname //**
                                     
//                                        String appInstanceName = GetAppInstanceName(code);
//                                        System.out.println("AppInstanceDisplayName " +appInstanceName);
                                     
                                     
                                     
                                     
                                        try{
//                                        lookupOps.addLookupValue(lookupName,appInstanceName,meaning,"","");
                                        lookupOps.addLookupValue(lookupName,code,meaning,"","");
//                                        System.out.println(" Added" +appInstanceName);
                                        }
                                        catch (Exception e) {
                                        System.out.println(e);
                                        }
                                     
                                     
                                }
                                System.out.println("*********Lookup values added successfully *********");
    } catch (Exception e) {
    System.out.println(e);
    }
}


/*
 * Removes an entry from a lookup. Delete is determined by an entry's code key.
 * @param   lookupOps    tcLookupOperationsIntf service object
 * @param   lookupName   Name of the lookup definition
 * @param   codeKey      Value of an entry's code key
 * Note: If there are duplicates of the code key in your lookup, only one of them will be removed.
 */
//public void removeEntryFromLookup()
//{
//
// CsvReader dataValue;
//
//
// lookupOps = oimClient.getService(tcLookupOperationsIntf.class);
//
//
// String csvFileLoc="C:\\Users\\xyz\\CSV\\LookupUtill\\addLookupValues.csv";
// String csvSeparator=",";
// char c[]=csvSeparator.toCharArray();
// 
//try{
// 
//    dataValue = new CsvReader(csvFileLoc,c[0]);
//    dataValue.readHeaders();

//
//                            while (dataValue.readRecord())
//                            {
//                                    String lookupName = dataValue.get("lookupName");
//                                   System.out.println("lookupName :::::" +lookupName);
//                                    String codeKey = dataValue.get("Code");
//                                    System.out.println("code :::::" +codeKey);
//                                 
//                                    lookupOps.removeLookupValue(lookupName, codeKey);
//                                 
//                                 
//                            }
//                            System.out.println("*********Lookup values  removed successfully *********");                 
//
// } catch (tcAPIException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (tcInvalidLookupException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (tcInvalidValueException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
//
// }catch(Exception e){
// e.printStackTrace();
// }
//
//
//}




/*
 * Update an existing entry in a lookup. Update is determined by entry's code key.
 * @param   lookupOps           tcLookupOperationsIntf service object
 * @param   lookupName          Name of the lookup definition
 * @param   existingCodeKey     An exisiting entry's code key
 * @param   newCodeKey          code key to be changed to
 * @param   newDecode           decode value to be changed to
 * Note: If there are duplicates of the code key in your lookup, only one of them will be updated.
 */
//public void updateEntryFromLookup()
//{
// CsvReader dataValue;
//try{
// lookupOps = oimClient.getService(tcLookupOperationsIntf.class);
// String lookupName="Lookupname";
// //String lookupName="Lookupname";
// //String lookupName="Lookupname";
// System.out.println("LookupName :::::" +lookupName);
// String csvFileLoc="C:\\Users\\xyz\\Code\\CSV\\LookupUtill\\addLookupValues.csv";
// String csvSeparator=",";
//   char c[]=csvSeparator.toCharArray();
//   
//
// 
//    dataValue = new CsvReader(csvFileLoc,c[0]);
//    dataValue.readHeaders();
//
//
//                            while (dataValue.readRecord())
//                            {
//                                    String existingCodeKey = dataValue.get("Code");
//                                    System.out.println("existingCodeKey :::::" +existingCodeKey);
//                                    String newCodeKey = dataValue.get("Code");
//                                    System.out.println("newCodeKey :::::" +newCodeKey);
//                                    String newDecode = dataValue.get("Meaning");
//                                    System.out.println("Meaning :::::"+newDecode);
//                                    try{
//                                 
//                                    HashMap<String,String> update = new HashMap<String,String>();
//                                        update.put("LKV_ENCODED", newCodeKey);
//                                        update.put("LKV_DECODED", newDecode);
//                                   
//                                        lookupOps.updateLookupValue(lookupName, existingCodeKey, update);
//                                        System.out.println("updated *** "+newCodeKey);
//                                    }
//                                    catch (Exception e) {
//                                    System.out.println(e);
//                                    }
//                                 
//                                 
//                            }
//                            System.out.println("*********Lookup values added successfully *********");
//} catch (Exception e) {
// System.out.println(e);
//}
//}



//public void AddLookUpValuestoLookups() {
// 
// CsvReader dataValue;
//    try {
//    lookupOps = oimClient.getService(tcLookupOperationsIntf.class);
//   
//   
//    String csvFileLoc="C:\\Users\\xyz\\addLookupValues.csv";
//    String csvSeparator=",";
//       char c[]=csvSeparator.toCharArray();
//     
// 
//     
//        dataValue = new CsvReader(csvFileLoc,c[0]);
//        dataValue.readHeaders();
//
//
//                                while (dataValue.readRecord())
//                                {
//                                        String lookupName = dataValue.get("lookupName");
//                                        System.out.println("lookupName :::::" +lookupName);
//                                        String code = dataValue.get("Code");
//                                        System.out.println("code :::::" +code);
//                                        String meaning = dataValue.get("Meaning");
//                                        System.out.println("Meaning :::::"+meaning);
//                                        lookupOps.addLookupValue(lookupName,code,meaning,"","");
//                                        System.out.println("*********Lookup updated********" +lookupName);
//                                }
//                                System.out.println("*********Lookup values added successfully *********");
//    } catch (Exception e) {
//    System.out.println(e);
//    }
//}



//private String GetAppInstanceName(String appInstanceDescription) {
//
//
// String appInstanceName = null;
//
// try{
//   String query = "select APP_INSTANCE_DISPLAY_NAME from app_instance where app_instance_description =  '"+appInstanceDescription+"'";
//
//
// Statement stmt=con.createStatement();
// ResultSet rs=stmt.executeQuery(query);
// while(rs.next()){
//
// appInstanceName = rs.getString("APP_INSTANCE_DISPLAY_NAME");
// //System.out.println("appInstanceName" +appInstanceName);
// }
//
//
// }
// catch(Exception e){
// System.out.println("App Instance not found " +appInstanceDescription);
// e.printStackTrace();
// }
//
// return appInstanceName;
//
//
//}





}

Thursday, 10 August 2017

OIM 11g: Export and Import metadata files from MDS


Oracle WebLogic Server provides three utilities to enable you to modify Oracle Identity Manager metadata.They are:
·         weblogicExportMetadata.sh - export specific metadata files from the MDS database
·         weblogicImportMetadata.sh - import specific metadata files into the MDS database
·         weblogicDeleteMetadata.sh - delete specific metadata files from the MDS database

MDS Data Purpose: Most of Oracle Identity Manager (OIM) 11g configuration files are stored in database under Metadata Services (MDS)  rather than on a file system on the OIM Server. Troubleshooting configuration issue can sometimes require exporting & importing MDS data.

Note: Weblogic admin and manage servers should be up when you are exporting or importing or deleting MDS files.

# Steps to Export : Here I will use wlst.sh utility to export MDS file which is one of the simplest method, we can also use weblogicExportMetadata.sh

 1.       Create directory where you want to export metadata files.




        
       2. Go to cd $ORACLE_HOME/common/bin and run below script.
./wlst.sh







 3Run connect() command.
Please enter your username :weblogic( User name should be weblogic)
Please enter your password : *******(weblogic password)
Please enter your server URL [t3://localhost:7001] : t3://identity.oracleads.com:7001


4. Run the below command to export  metadata files
exportMetadata(application='OIMMetadata', server='oim_server1', toLocation='/tmp/exportMetadata')


      5.   Data will be exported in given directory i.e /tmp/exportMetadata.


     
    # Steps to Import: Here I am using weblogicImportMetadata.sh utility to User.xml metadata file in my case.

     1. Create the directory where from where you want to import file and copy your modify metadata file. In my case I am importing User.xml after some modification.



    2. Go to cd $ORACLE_HOME/server/bin/ and modify weblogic.properties file according to your requirements.

 Note: metadata_from_loc and metadata_files path should be correct otherwise it will be import other location your file.
      wls_servername=oim_server1(This is name of OIM server, you can get server name from weblogic console)
     application_name= OIMMetadata ( oim if file is OOB file or OIMMetadata if this is custom file)
     metadata_from_loc= /tmp/export/oim/ (Location of directory on file system that contains file which you wish to import; used during import process)
     metadata_to_loc=/tmp/export/oim/  (Location of file on file system which you wish to import, used during import process)
     metadata_files=/file/User.xml (Name of file which you wish to export/import like /file/User.xml or user * which represents all files in that folder)


 
     
     3. Run weblogicImportMetadata.sh utility.

          Please enter your username :weblogic( User name should be weblogic)
        Please enter your password : *******(weblogic password)
        Please enter your server URL [t3://localhost:7001] : t3://identity.oracleads.com:7001


4. After import User.xml, export metadata files and verify that modified User.xml imported in /file directory or not.

5.   Check the oim servers logs for any error.



      Reference:
      https://docs.oracle.com/cd/E17904_01/doc.1111/e14309/utils.htm#OMDEV759

Sunday, 12 July 2015

Changing Oracle Identity Manager(11g R2PS2) Administrator Password

 Changing Oracle Identity Manager(11g R2PS2) Administrator Password


If you want to change xelsysadm password in your environment. These are following steps, have to follow.

Step1:
First change xelsysadm password  in Identity Self Service Console.

     1. Login as an admin user(xelsysadm) in Identity Self Service console.
    2. Under my profile click My Information.
    3.   Page is displayed with section changing password.
    4. Under Changing password  specify the value of following field
  
   Old Password: Enter the existing password.
   New Password: Enter the new password.
  Confirm New Password: Re-enter new password.

In case Changing Password section is not in My Information. Then follow the following steps.

1. Login in as admin user in Identity Self Service console.
     2. Click on Users under Administration.
     3. Search xelsysadm user.
     4. Click System Administrator .
     5. Click on Reset password.
     6. Select Manually Change  the Password.

       New Password: Enter the new password.
      Confirm New Password: Re-inter the new password.

     7. Click on Reset password tab.

Note: New password is in compliance with the password policy, then the password is changed. Otherwise, an error message is displayed.

Step 2:

Change Xelsysadm password in EM Console.

1. Under farm_base_domain, click WebLogic Domain.
2. Click your base_domain.
3.  This will open up the base_domain in the main window. On top left hand corner drop down WebLogic Domain, select Security, then select Credentials.
4. This will open up the Credential Store Provider window. Open the Credential called "oracle.wsm.security". Select the entry for OIMAdmin. Use the Edit option to open the editor window. This should pop-up Edit Key. Change the password here.


Note: Restart of the servers are required post changing the password.

Friday, 20 February 2015

Add Custom Attribute(LOOKUP FIELD) On UI In OIM11GR2PS2

       
    Add Custom Attribute(LOOKUP FIELD) On UI In OIM11GR2PS2


1. Login on System Admin console and Create and Activate new Sandbox.




2. Under System Entities click on User, Manage USER page will prompt.


3. Click on Create  icon and then select field type LOOKUP.


4. Create a new field Branch and mark it as searchable.


5. Click on Lookup and search and select your Lookup type.


6. Then also mark it as Search Picklist. Save and Close.

Note: If you don’t  mark it as Searchable Picklist then it will not make as Lookup field.



Note: We have completed creating a UDF on user form. Next we will be adding the UDF to Create User Form.

7. Now go to manage sandbox  page and publish the sandbox.

8. Then login on Identity Self console and Create and Activate Sandbox.


9. Now click on User under Administration.


10. Click on create icon for open create User form and must enter the values of mandatory field.


11. Click on Customize and then click on view and source and customize screen will prompt.


12. Now select area where you want to add custom field and click Edit.


13. Highlight panelFormLayout and click on ADD Content and Select Data Component – Catalog.



14. Select userVO.


15. Branch attribute and click on Add  and select ADF Input Test w/Label click close.


16. Now Branch attribute add on User From.


17. Close Customization Editor.

18. And Publish the Sandbox.

Get Decode Value From Lookup Using API

                                            Get Decode Value Lookup Using API package demo.com; import Thor.API.Exceptions.tcAPIExce...