• App Development
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 7
    Replies
I have another application which I need to call and they are using OAuth 1.0. now I am calling their system endpoint, I have client id and client secret only.
Do I need to generate token also?
because when I tested on Postman its working fine with just giving endpoint url, client id and client secret.
Can anyone help me with samples?
I am getting bad request 400 as a response...
I am facing issue with pagination as its not working correctly. its droping records. could you please help me out.
Here is my code.

Apex class: 


public with sharing class SearchController{

    public integer PageSize {get;set;}
    public integer PageNumber {get;set;}
    public integer RecordCount {get;set;}
    public List<contactwrapper> objAWList {get;set;}
    private Set<id> selectedContactIds;
    public boolean displayPopup {get; set;}  
    public List<contact> objSelectedContacts {get; set;}
    private String soql {get;set;}  
      
    public SearchController() {
        PageSize = 10;
        PageNumber = 1;   
        RecordCount = 0;
        selectedContactIds = new Set<id>();
        objAWList = new List<contactwrapper>();
        objSelectedContacts = new List<contact>();
          
    }
      

    public void closePopup() {        
        displayPopup = false;    
    }     
      

    public void showPopup() {  
        setSelectedContacts();      
        displayPopup = true;    
        objSelectedContacts  = GetSelectedcontacts();
    }
      
    public Integer getSelectedCount(){
        return this.selectedContactIds.size();
    }
      
    public List<contact> GetSelectedContacts(){    
        List<contact> objConList = [Select Id, Name,Email,Account.Name,Account_Cust__c,Job_Title__c 
                                    From Contact Where ID IN : selectedContactIds];       
        system.debug('objConList :'+objConList);
        return objConList;
    }
      
      
    private void setSelectedContacts()
    {
        for(contactwrapper item: objAWList)
        {
            if(item.IsSelected)
            {    
                if(!this.selectedContactIds.contains(item.ContactId))
                {
                    this.selectedContactIds.add(item.ContactId);
                }
            }
            else
            {
                if(this.selectedContactIds.contains(item.ContactId))
                {
                    this.selectedContactIds.remove(item.ContactId);
                }
            }
        }        
    }
      
    public integer PageIndex {
        get { return (PageNumber - 1); }
    }    
      
    public integer PageCount {
        get { return getPageCount(); }
    }
      
    public integer Offset {
        get { return (PageSize * PageIndex); }
    }
      
  
    public void runSearch() {
        objAWList = new List<contactwrapper>();
        try {
                List<Contact> objConList = new List<Contact>(); 
                String contactName = Apexpages.currentPage().getParameters().get('ContactName');
         
                if (!contactName.equals('')){
                    soql = 'select firstname, lastname, Name,account.name,Job_Title__c,Account_Cust__c from contact where account.name != null';
                    soql += ' and name LIKE \'%' + contactName + '%\'';
                    soql += ' order by firstName ASC limit '+PageSize +' offset '+Offset;
                    system.debug('soqlfinal::'+soql);
                    objConList = Database.query(soql);
                    RecordCount = objConList.size();
                    
                }else if(contactName.equals('')){
                    RecordCount = objConList.size();
                    objConList.clear();
                }
          
                 system.debug('objConList---'+objConList);                    
                 if(!objConList.isEmpty()){                         
                     for(Contact Con : objConList){
                            ContactWrapper objAW = new ContactWrapper();
                            objAW.ContactId = Con.Id;
                            objAW.ContactName = Con.Name;
                            objAW.AccountCust= Con.Account_Cust__c ;
                            objAW.JobTitle= Con.Job_Title__c;
                            
                            if(this.selectedContactIds.contains(con.Id)){
                                objAW.IsSelected = true;
                            }
                            else{
                                objAW.IsSelected = false;
                            }
                            objAWList.Add(objAW);
                     }
                 }             
             
        }
        catch (QueryException e) {
            ApexPages.addMessages(e);   
            
        }
    }
      
    public integer LNumber {
        get { return RecordCount == 0 ? 0 : (Offset + 1); }
    }
  
    public integer UNumber {
        get { 
            integer iUNum = ((LNumber + PageSize) - 1);
            return (iUnum > RecordCount) ? RecordCount : iUNum; 
        }
    }
      
    public boolean AllowMoveNext {
        get{ return ((PageIndex + 1) < PageCount); } } public boolean AllowMovePrev { get{ return (PageIndex > 0); }
    }
      
    public void Prev() {
        setSelectedContacts();
        PageNumber--;
  
        if (PageNumber <= 0) { PageNumber = 1; } } public void Next() { setSelectedContacts(); PageNumber++; if (PageNumber > PageCount) {
            PageNumber = PageCount;
        }
    }
      
    public void Last() {
        setSelectedContacts();
        PageNumber = PageCount; 
    }
  
    public void First() {
        setSelectedContacts();
        PageNumber = 1;
    }
      
    private integer getPageCount() {
        integer iPageCount = 1;
  
        if (RecordCount != 0 && PageSize != 0) {
            iPageCount = (RecordCount/PageSize) + ((Math.mod(RecordCount, PageSize)) > 0 ? 1 : 0);
        }
        return iPageCount;
    }
      
    public class Contactwrapper
    {
        public Id ContactId {get;set;}
        public String ContactName {get;set;}
        public String AccountCust {get;set;}
        public String JobTitle {get;set;}
        public Boolean IsSelected{get;set;}
        public Contactwrapper()
        {
    
        }
    }    
}
 
I am working with dropbox for salesforce app and now running with issue,
If i change opportunity owner file is not visible to that new owner uploaded by last owner.
If anyone worked on this,could you please share me suggestions around this?
I also raised the case to dropbox around this and waiting for their reply.
I have tried with adding script on custom button but its not visible in
salesforce 1 as we need to add the script in vf page and then access it.

below script (which i added in custom button) i need to add into Vf page,

(below page in link and javscript method i need to access from another vf page)

{!REQUIRESCRIPT("/apex/TestPage")}
runcode();

i tried with window.onload and other stuff but no luck.

Could ypu please suggest me the way to correct it?
I have created fromula field on opportunity and wanted to get true if following conditions are met. Still its not getting true.
IF((TEXT(Account.Type)== "Test" ) && CONTAINS( Account.Name , "Test") , true, false)
Not getting what i am missing. also, checked text (Test) its same.
Any suggestions?
I have custom objects order and quote from managed package and i have given access to both objects in profile with ALL ACCESS (CRUD,view all,modify all).

now, it should display related list or tab for both objects for the profile.

I have assigned same profile and role to another user and by logging in that user i am able to see the tab and related list.

means, user A with same profile and role not able to see the tab and user B with same profile and role able to see the tab and related list.

after doing checks got to know that may be their is something messed up with that particular user but i am unable to find it.

any suggestions? do i need to raise the case to salesforce.
I have created a community where i need to restrict the access for Order object.

I have created permission set and given "Order" object access : read and edit
Also, selected permission set in community admin settings.

Still i can perform CRUD operations for order object for community user.

Any suggestions? 
I have following scenario and want to set up partner community license.

1. Have profile Customer service rep.
2. He has access to only Order object.

i know we need to set Account as partner and then contacts need to be enabled as partner and then create user and assign the partner community profile.
But if i have no.of users and want to assign them Partner Community License  and Customer service repprofile, how i should proceed to implement this?

Could you please suggest?
I have tried with exporting accounts with activity history using reports.
but, is there any other way to do the same.?

i see there is no correct data exported. could you please suggest on this?
I am getting error "insufficient priviledeges while adding quote line item.

Checked with permission setting for profile but still same. i have access to quote object.

Got to the one point, when we click on "Add line item" button on quote line item related list it will redirect to products selection page where we can add products. So, i guess its not related to object premissions.

please suggest.
I am developing code review tool to do the code review of apex class.
So, here i need to go through line by line of Apex class body and then needs to perform some analysis.
please give suggestion on this.
Need to Edit field accessibility on Order object for Order start date and Status field.
i actually need to make both of the fields read only.

Any suggestions?
We have more number of users consider 100 users or more.
The user which will use only standard order object record.

Now if we buy Salesforce license it will cost too much per month/user.

So, is there any way to handle it with cheap way in the case of license?
Let me know best license suitable for this scenario.
 
Consider, if we have attachment added to "Quote" object and we need to generate "order" object record from attached quote PDF based on trigger or anything.

Is it possible in salesforce to read the PDF and generate record from it?
Up to my knowledge there is no way in Apex to do the same or by any way we can implement the same.

Let me know if you have any sugesstions for the same. 
As i tried with Upserting the Product2id in salesforce integration but its giving error field is read only. for upsert.

It works well for insert but not for upsert.

Do you any workaround for the same.?
Getting error "List has no rows for assignment to SObject"

Line kept bold below...Please suggest.

apex class:
public class PopUpExtension{
    
    public Milestone1_Project__c Project {get;set;}
    public Milestone1_Project__c ProjectGetData {get;set;}
    public List<Milestone1_Milestone__c>  milestones {get;set;}
    public List<Milestone1_Task__c> milestonesTasks {get;set;}
    public boolean ErrorFound {get;set;}
 
    public PopUpExtension(ApexPages.StandardController stdController){
        ErrorFound = false;
        Project = new Milestone1_Project__c();
        this.Project = (Milestone1_Project__c)stdCOntroller.getRecord();
        milestones = new List<Milestone1_Milestone__c>();
        milestonesTasks = new  List<Milestone1_Task__c>();
    }
     
    public void UpdateEstimatedDates() {
        try{
            ErrorFound = false;
            Date EstimatedStartDate;
            Map<id,Milestone1_Milestone__c> MilestonesMap = new Map<id,Milestone1_Milestone__c>();  
            ProjectGetData = [select Start_Day__c,Project_Duration__c,Kickoff__c,Deadline__c from Milestone1_Project__c where Duration__c !=null and Start_Day__c !=null and id = :Project.id];
            system.debug('ProjectGetData:'+ProjectGetData);
            if(Project.Kickoff__c != null){
                ProjectGetData.Kickoff__c = Project.Kickoff__c;
                if(ProjectGetData.Start_Day__c != null && ProjectGetData.Project_Duration__c != null){
                    EstimatedStartDate = Date.valueOf(Project.Kickoff__c).addDays((integer)ProjectGetData.Start_Day__c)-1;
                    ProjectGetData.Deadline__c = EstimatedStartDate.addDays((integer)ProjectGetData.Project_Duration__c);
                    system.debug('ProjectGetData1:'+ProjectGetData);
                }else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Please provide project Start Day and Project Duration.');
                    ApexPages.addMessage(myMsg);
                    ErrorFound = true;
                }
                update ProjectGetData;
            }else{
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Please provide project Estimated Start Date or close the window.');
                ApexPages.addMessage(myMsg);
                ErrorFound = true;
                return;
            }
            
            milestones = [Select id,m.Start_Day__c, m.Project__c, m.Kickoff__c, m.Estimated_End_Date__c, m.Milestone_Duration__c From Milestone1_Milestone__c m where Start_Day__c !=null and Duration__c !=null and m.Project__c = :Project.id];
            for(Milestone1_Milestone__c milestone : milestones){
                milestone.Kickoff__c = EstimatedStartDate.addDays((integer)milestone.Start_Day__c);
                milestone.Estimated_End_Date__c = Date.valueOf(milestone.Kickoff__c).addDays((integer)milestone.Milestone_Duration__c)-1;
                if(milestone.Estimated_End_Date__c > ProjectGetData.Deadline__c){
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Milesone Estimated End date is greater than Project Estimated End Date');
                    ApexPages.addMessage(myMsg);
                    ErrorFound = true;
                }
                MilestonesMap.put(milestone.id,milestone);
            }
            update milestones;
            
            milestonesTasks = [Select m.Task_Duration__c,m.Project_Milestone__c, m.Start_Day__c, m.Start_Date__c, m.Estimated_End_Date__c From Milestone1_Task__c m where Start_Day__c !=null and Task_Duration__c !=null and m.Project_Milestone__c = :MilestonesMap.keyset()];
            for(Milestone1_Task__c task : milestonesTasks){
                Milestone1_Milestone__c milestone = MilestonesMap.get(task.Project_Milestone__c);
                task.Start_Date__c = (date)milestone.Kickoff__c.addDays((integer)task.Start_Day__c);
                task.Estimated_End_Date__c = Date.valueOf(task.Start_Date__c).addDays((integer)task.Task_Duration__c)-1;
                
                if(task.Estimated_End_Date__c > ProjectGetData.Deadline__c){
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Tasks Estimated End date is greater than Project Estimated End Date');
                    ApexPages.addMessage(myMsg);
                    ErrorFound = true;
                }
                if(task.Estimated_End_Date__c > milestone.Estimated_End_Date__c){
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Tasks Estimated End date is greater than Milestone Estimated End Date');
                    ApexPages.addMessage(myMsg);
                    ErrorFound = true;
                }
            }    
            update milestonesTasks;
            
        }catch(exception e) {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Error Occured while updating the Projects/Milestones/Tasks '+e.getMessage());
            ApexPages.addMessage(myMsg);
            ErrorFound = true;
        }
    }
}

test class:

@isTest
private class TestPopUpExtension {

    static testMethod void functionalTest() {
        
        Milestone1_Project__c Project = new Milestone1_Project__c();
        Project.Name = 'Test1';
        Project.Kickoff__c = date.today();
        Project.Start_Day__c = 1;
        Project.Project_Duration__c = 200;
        insert Project;
        
        Milestone1_Milestone__c Milestone = new Milestone1_Milestone__c();
        Milestone.Name = 'Test1';
        Milestone.Start_Day__c = 1;
        Milestone.Milestone_Duration__c = 3;
           Milestone.Project__c = Project.id;
           insert Milestone;
           
           Milestone1_Task__c Tasks = new Milestone1_Task__c();
           Tasks.Start_Day__c = 1;
           Tasks.Task_Duration__c = 4;
           Tasks.Project_Milestone__c = Milestone.id; 
           insert Tasks; 
           
           PageReference pageRef = Page.popupwindow;
        Test.setCurrentPageReference(pageRef);
        
           ApexPages.StandardController sc = new ApexPages.standardController(Project);
           PopUpExtension popext = new PopUpExtension(sc);
           popext.UpdateEstimatedDates();
            
    }
    
    static testMethod void ErrorTest() {
        
        Milestone1_Project__c Project = new Milestone1_Project__c();
        Project.Name = 'Test1';
        Project.Kickoff__c = date.today();
        Project.Start_Day__c = 1;
        Project.Project_Duration__c = 2;
        insert Project;
        
        Milestone1_Milestone__c Milestone = new Milestone1_Milestone__c();
        Milestone.Name = 'Test1';
        Milestone.Start_Day__c = 1;
        Milestone.Milestone_Duration__c = 3;
           Milestone.Project__c = Project.id;
           insert Milestone;
           
           Milestone1_Task__c Tasks = new Milestone1_Task__c();
           Tasks.Start_Day__c = 1;
           Tasks.Task_Duration__c = 4;
           Tasks.Project_Milestone__c = Milestone.id;
           insert Tasks; 
           
           PageReference pageRef = Page.popupwindow;
        Test.setCurrentPageReference(pageRef);
           
           ApexPages.StandardController sc = new ApexPages.standardController(Project);
           PopUpExtension popext = new PopUpExtension(sc);
           popext.UpdateEstimatedDates();
            
    }
}
I have developed one class which runs on REST webservice and called batch apex for more than 10000 records deletions for the same.
Right now its showing error while fetching query by parameter.
Could you please help on this?  any suggestions?

Apex class:

@RestResource(urlMapping='/PurgeMonitorLog/*')
global with sharing class PurgeMonitorlogRestService {
    @HttpPost
    global static Boolean deleteMonitorLogEntries(String lastExtractedTimeUTC) {
        Boolean isDeleted=false;
        try{
            
            if(lastExtractedTimeUTC == NULL || lastExtractedTimeUTC == ''){
                System.debug('Passed time is Null or empty, Purge process cant proceed: '+lastExtractedTimeUTC);
                return isDeleted;
            }
            
            String[] timeArray=lastExtractedTimeUTC.split('T');
            String transformedTime=timeArray[0]+' '+timeArray[1];
          
            DateTime dtLET_UTC=DateTime.valueOfGmt(transformedTime);
            System.debug('Get all records before time (in UTC):'+dtLET_UTC);
            
            
            String Query;
            Query = 'select id from monitorlog__c where lastmodifieddate < :'+dtLET_UTC;
            
            database.executebatch(new  DeleteMonitorlogBatchClass(Query));
    
   
        }catch (Exception ex){
            System.debug(Logginglevel.ERROR, 'deleteMonitorLogEntries: Exception while deleting MonitorLog Records due to: ' + ex.getMessage());
            MonitorUtility.insertHandledExceptions(ex, null, 'MonitorLog', 'PurgeMonitorlogRestService','PurgeMonitorLog','GSD','Monitoring',System.now());
        }  
        System.debug('returned val:'+isDeleted);
        return isDeleted;
    }
    
}

Batch Apex:

global class DeleteMonitorlogBatchClass implements Database.Batchable{

    global final string Query;
    
    global DeleteMonitorlogBatchClass(String q){
        Query = q;
    }

    global Database.QueryLocator start(Database.BatchableContext BC){
        return Database.getQueryLocator(Query);
    }

    global void execute(Database.BatchableContext BC, List scope){
        List monitorObjList = new List();
        for(monitorlog__c Mon : scope){
            monitorlog__c MonInst = (monitorlog__c)Mon;
            monitorObjList.add(MonInst);
        }
        
        if(!monitorObjList.isEmpty()){
            Database.delete(monitorObjList, false);
            Database.emptyRecycleBin(monitorObjList); 
        }
    }

    global void finish(Database.BatchableContext BC){
                    
    }
}


ERROR :

34.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
01:20:01.027 (27069598)|EXECUTION_STARTED
01:20:01.027 (27099942)|CODE_UNIT_STARTED|[EXTERNAL]|01pq0000000Eg40|DeleteMonitorlogBatchClass
01:20:01.050 (50255196)|METHOD_ENTRY|[1]|01pq0000000Eg40|DeleteMonitorlogBatchClass.DeleteMonitorlogBatchClass()
01:20:01.050 (50270556)|METHOD_EXIT|[1]|DeleteMonitorlogBatchClass
01:20:01.050 (50398704)|SYSTEM_METHOD_ENTRY|[10]|Database.getQueryLocator(String)
01:20:01.050 (50635038)|EXCEPTION_THROWN|[10]|System.QueryException: unexpected token: '2015-06-23'
01:20:01.050 (50709933)|SYSTEM_METHOD_EXIT|[10]|Database.getQueryLocator(String)
01:20:01.050 (50762663)|FATAL_ERROR|System.QueryException: unexpected token: '2015-06-23'

Class.DeleteMonitorlogBatchClass.start: line 10, column 1
I have developed below code fro cloning but unfortunately because of unique field i am getting error of duplication.

here one text field set to unique.

Apex class: 

public class GSDPartnerCloneWithSkillsController {

    public ApexPages.StandardController controller {get; set;}
    public GSD_Partner__c GSDP {get;set;}
    public ID newRecordId {get;set;}
    public Id OldGSDResourceId {get;set;}
    public Id NewGSDResourceId {get;set;}

    
    public GSDPartnerCloneWithSkillsController(ApexPages.StandardController controller) {

        this.controller = controller;
        GSDP = (GSD_Partner__c)controller.getRecord();

    }
    
    public PageReference cloneWithItems() {

         Savepoint sp = Database.setSavepoint();
         GSD_Partner__c newGSDP;

         try {
         
             GSDP = (GSD_Partner__c) GSDDataUtility.getObject('GSD_Partner__c', GSDP.id);
             
             newGSDP = GSDP.clone(false);
             insert newGSDP;

            
             newRecordId = newGSDP.id;
           
           
             GSD_Resource__c OldGSDResource = [select id from  GSD_Resource__c where Partner__c = :GSDP.id limit 1];
             OldGSDResourceId = OldGSDResource.id;
             system.debug('OldGSDResourceId :'+OldGSDResourceId );
             
             GSD_Resource__c NewGSDResource = [select id from  GSD_Resource__c where Partner__c = :newRecordId  limit 1];
             NewGSDResourceId = NewGSDResource.id;
             system.debug('NewGSDResourceId :'+NewGSDResourceId);
             
             CLoneGSDResourceLang();
             CLoneGSDResourceNon();
             CLoneGSDResourcePPS();
             CLoneGSDResourcePMaster();
             CLoneGSDResourceServices();
             CLoneGSDResourceTech();

         } catch (Exception e){
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

        return new PageReference('/'+newGSDP.id+'/e?retURL=%2F'+newGSDP.id);
    }
    
    public void CLoneGSDResourceLang(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourceLang and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceNon(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourceNon and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourcePPS(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourcePPS and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourcePMaster(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Skill_Name__r.Name, Responsibility_Skill_Level__c, Skill_Name__r.Product_Description__c, Skill_Name__r.Portfolio__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c = :OldGSDResourceId AND Skill_Category__c =: Label.GSDResourcePMaster ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceServices(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Skill_Name__r.Name, Responsibility_Skill_Level__c, Skill_Name__r.Product_Description__c, Skill_Name__r.Portfolio__c, Skill_Name__r.Support_Activity__c,Standard__c, Stand_By__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c = :OldGSDResourceId AND Skill_Category__c ='Services' ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceTech(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Responsibility_Skill_Level__c, Skill_Name__r.Name, Skill_Name__r.Technologies_Name__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c =:OldGSDResourceId  AND Skill_Category__c =: Label.GSDResourceTech ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
}

apex class:

public class GSDDataUtility {
    public static sObject getObject(string objName, string id) {
 
        String fieldnames = '';
        sObject obj;
        try {
            Map < String, Schema.SObjectType > m = Schema.getGlobalDescribe();
            Schema.SObjectType s = m.get(objName);
            Schema.DescribeSObjectResult r = s.getDescribe();
 
        
            Map < String, Schema.SObjectField > fields = r.fields.getMap();
            for (string field: fields.keySet()) {
                if (fieldnames == '') {
                    fieldnames = field;
                } else {
                    fieldnames += ',' + field;
                }
            }
 
            
            String sql = 'SELECT ' + fieldnames + ' FROM ' + objName + ' WHERE Id=\'' + id + '\'';
            System.debug(sql);
            obj = database.query(sql);
 
        } catch (Exception e) {
            System.debug('get Fields Error' + e.getMessage());
            ApexPages.addMessages(e);
            return null;
        }
        return obj;
    }
}
I have developed below test class but not getting why i am getting below error,

System.NullPointerException: Attempt to de-reference a null object..
the id i am passing has having the value..any suggestion?

apex class:

public class GSDPartnerCloneWithSkillsController {

    public ApexPages.StandardController controller {get; set;}
    public GSD_Partner__c GSDP {get;set;}
    public ID newRecordId {get;set;}
    public Id OldGSDResourceId {get;set;}
    public Id NewGSDResourceId {get;set;}

    
    public GSDPartnerCloneWithSkillsController(ApexPages.StandardController controller) {

        this.controller = controller;
        GSDP = (GSD_Partner__c)controller.getRecord();

    }
    
    public PageReference cloneWithItems() {

         Savepoint sp = Database.setSavepoint();
         GSD_Partner__c newGSDP;

         try {
         
             //GSDP = (GSD_Partner__c) GSDDataUtility.getObject('GSD_Partner__c', GSDP.id);
             List<GSD_Partner__c> InsertGSDPList = new List<GSD_Partner__c>();
             List<GSD_Partner__c> GSDPList = [SELECT supervisor__c,Queue_Suffix__c,case_exchange_identifier__c,quota_factor__c,minimum_assignments_monthly__c,open_all_hours__c,account__c,country_iso__c,notes__c,portfolio__c,maximum_assignments_daily__c,createdbyid,lastmodifieddate,id,phone__c,portal_user_identifier__c,last_daily_counter_reset__c,logistics_badge_id__c,name,isdeleted,queue__c,resource__c,systemmodstamp,provider_type__c,last_monthly_counter_reset__c,does_diagnosis__c,email__c,send_case_exchange_reminders__c,mru_code__c,createddate,can_see_quotes__c,ownerid,assignment_counter_daily__c,country_name__c,active__c,case_exchange_enabled__c,assignment_counter_monthly__c,does_own_logistics_and_parts__c,engagement_method__c,maximum_assignments_monthly__c,lastmodifiedbyid,currencyisocode,commitment_levels__c FROM GSD_Partner__c WHERE Id = :GSDP.id];
             for(GSD_Partner__c GSDP : GSDPList ){
                 newGSDP = GSDP.clone(false);
                 newGSDP.Queue_Suffix__c = 'Enter Unique value';
                 InsertGSDPList.add(newGSDP);
             } 
             insert InsertGSDPList;

             if(!InsertGSDPList.isEmpty()){
                 newRecordId = InsertGSDPList[0].id;
             }
           
             GSD_Resource__c OldGSDResource = [select id from  GSD_Resource__c where Partner__c = :GSDP.id limit 1];
             OldGSDResourceId = OldGSDResource.id;
             system.debug('OldGSDResourceId :'+OldGSDResourceId );
             
             GSD_Resource__c NewGSDResource = [select id from  GSD_Resource__c where Partner__c = :newRecordId  limit 1];
             NewGSDResourceId = NewGSDResource.id;
             system.debug('NewGSDResourceId :'+NewGSDResourceId);
             
             CLoneGSDResourceLang();
             CLoneGSDResourceNon();
             CLoneGSDResourcePPS();
             CLoneGSDResourcePMaster();
             CLoneGSDResourceServices();
             CLoneGSDResourceTech();

         } catch (Exception e){
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

        return new PageReference('/'+newGSDP.id+'/e?retURL=%2F'+newGSDP.id);
    }
    
    public void CLoneGSDResourceLang(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourceLang and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceNon(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourceNon and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourcePPS(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourcePPS and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourcePMaster(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Skill_Name__r.Name, Responsibility_Skill_Level__c, Skill_Name__r.Product_Description__c, Skill_Name__r.Portfolio__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c = :OldGSDResourceId AND Skill_Category__c =: Label.GSDResourcePMaster ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceServices(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Skill_Name__r.Name, Responsibility_Skill_Level__c, Skill_Name__r.Product_Description__c, Skill_Name__r.Portfolio__c, Skill_Name__r.Support_Activity__c,Standard__c, Stand_By__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c = :OldGSDResourceId AND Skill_Category__c ='Services' ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceTech(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Responsibility_Skill_Level__c, Skill_Name__r.Name, Skill_Name__r.Technologies_Name__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c =:OldGSDResourceId  AND Skill_Category__c =: Label.GSDResourceTech ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
}


test class:

@isTest
public class GSDPartnerCloneWithSkillsController_Test{

    private testMethod static void TestMethod1(){
    
        Global_Config__c GCObj=new Global_Config__c (CPQ_Mute_Validation_Rule__c=false,DPlus_Mute_Validation_Rule__c=true,Mute_Triggers__c=true,
                                                        Mute_Validation_Rule__c=true,Mute_Workflow_Rule__c=true,Name='GSD');
      
        insert GCOBJ;
        
                
        HPTriggerFrameworkObjectMapping__c PartCSObj= new HPTriggerFrameworkObjectMapping__c(name='GSD_Partner__c',DispatcherCalssName__c='GSDPartnerProfile');
        insert PartCSObj;
        
        HPTriggerFrameworkObjectMapping__c ResCSObj= new HPTriggerFrameworkObjectMapping__c(name='GSD_Resource__c',DispatcherCalssName__c='GSDNewResource');
        insert ResCSObj;
        
        HPTriggerFrameworkObjectMapping__c SKMObj= new HPTriggerFrameworkObjectMapping__c(name='GSD_Skill_Master__c',DispatcherCalssName__c='GSDSKillMaster');
        insert SKMObj;
        
        HPTriggerFrameworkObjectMapping__c RSKMMObj= new HPTriggerFrameworkObjectMapping__c(name='GSD_Resource_Skills_mapping__c',DispatcherCalssName__c='GSDResourceSkillMapping');
        insert RSKMMObj;
        
        Profile fsmManagerPro= [Select Id, Name from Profile where Name = 'GSD FSM Sub Regional Resource' limit 1];        
        
        User fsmProfileUser= new User( profileId = fsmManagerPro.id, username = 'testemail22@hp.com', email = 'testemail22@hp.com', 
                    emailencodingkey = 'UTF-8', localesidkey = 'en_US',languagelocalekey = 'en_US', timezonesidkey = 'America/Los_Angeles',
                    alias='cspu22', lastname='lastname', Adoption_Role_Type__c = 'IT', Email_Address__c = 'testemail3@hp.com',Legacy_Employee_Ref__c='12345', 
                    RMR_Primary_Operational_Role__c = 'Solution Architect');
        
        insert fsmProfileUser;
        
        World_Region__c WR=new World_Region__c();
        wr.Name='US';
        insert WR;
        
        
        
        RecordType rt = [select id,Name from RecordType where SobjectType='Account' and Name='Partner' Limit 1];
        account aObj=new account(name='Account1',RecordTypeId=rt.id,MDCP_Business_Relationship_ID__c = 'abc',World_Region1__c=wr.id);
        insert aObj;
        
        PageReference pref = Page.GSDpartnerClone;
        Test.setCurrentPage(pref);
        
        Gsd_partner__c pObj=new Gsd_partner__c(name='partnerEx1',Account__c = aObj.id,Phone__c='9739',Email__c='xyz@hp.com',Queue_Suffix__c='queue1');
        insert pObj;
        
        Apexpages.StandardController sc = new Apexpages.standardController(pObj);
        GSDPartnerCloneWithSkillsController PCObj=new GSDPartnerCloneWithSkillsController(sc);
        
        Test.startTest();
        
        GSD_Resource__c oldresource = [Select Id From GSD_Resource__c  where Partner__c = :pObj.id];
        system.debug('oldresource :'+oldresource);
        
        GSD_Skill_Master__c SMObj= new GSD_Skill_Master__c();
        SMObj.Skill_Name__c = 'testskillname';
        SMObj.Skill_Type__c='Non-Product';
        SMObj.Skill_Category__c='Language';
        SMObj.Name='German';
        insert SMObj;
        
        GSD_Resource_Skills_mapping__c RSMObj = new GSD_Resource_Skills_mapping__c();
        RSMObj.Skill_Name__c=SMObj.id;
        RSMObj.Standard__c=true;
        RSMObj.Stand_By__c=true;
        RSMObj.Non_Product_Skill_Level__c='0';
        RSMObj.Responsibility_Skill_Level__c='3';
        RSMObj.Skill_Category__c='Language';
        RSMObj.Resource_ID__c= oldresource.id;
        system.debug('RSMObj :'+RSMObj);
        insert RSMObj;
        
        PageReference ref = PCObj.cloneWithItems();
        
        
        PageReference redir = new PageReference('/'+PCObj.newRecordId+'/e?retURL=%2F'+PCObj.newRecordId);
        System.assertEquals(ref.getUrl(),redir.getUrl());
        
        List<GSD_Resource__c > newItems = [Select Id From GSD_Resource__c  where Partner__c = :PCObj.newRecordId];
        System.assertEquals(newItems.size(),1);
        
        List<GSD_Partner_Profile_Linkage__c> newItems1 = [Select Id From GSD_Partner_Profile_Linkage__c  where Accessible_To__c = :PCObj.newRecordId];
        System.assertEquals(newItems1.size(),1);
        
        Test.stopTest();
        

    }
    
}
1. we having the solution, one is to remove the delete permission for object to every profile where we dont want to provide.
2. and we can create VF page to display the wanted view.

now,some out of box what i thought is to give OWD permission and put sharing rule which we will apply for all profile except admin.

Could you please give suggestion on this? how do i set it up?
or you have any better solution on this?
I have following scenario and want to set up partner community license.

1. Have profile Customer service rep.
2. He has access to only Order object.

i know we need to set Account as partner and then contacts need to be enabled as partner and then create user and assign the partner community profile.
But if i have no.of users and want to assign them Partner Community License  and Customer service repprofile, how i should proceed to implement this?

Could you please suggest?
I am getting error "insufficient priviledeges while adding quote line item.

Checked with permission setting for profile but still same. i have access to quote object.

Got to the one point, when we click on "Add line item" button on quote line item related list it will redirect to products selection page where we can add products. So, i guess its not related to object premissions.

please suggest.
We have more number of users consider 100 users or more.
The user which will use only standard order object record.

Now if we buy Salesforce license it will cost too much per month/user.

So, is there any way to handle it with cheap way in the case of license?
Let me know best license suitable for this scenario.
 
Consider, if we have attachment added to "Quote" object and we need to generate "order" object record from attached quote PDF based on trigger or anything.

Is it possible in salesforce to read the PDF and generate record from it?
Up to my knowledge there is no way in Apex to do the same or by any way we can implement the same.

Let me know if you have any sugesstions for the same. 
I have developed below code fro cloning but unfortunately because of unique field i am getting error of duplication.

here one text field set to unique.

Apex class: 

public class GSDPartnerCloneWithSkillsController {

    public ApexPages.StandardController controller {get; set;}
    public GSD_Partner__c GSDP {get;set;}
    public ID newRecordId {get;set;}
    public Id OldGSDResourceId {get;set;}
    public Id NewGSDResourceId {get;set;}

    
    public GSDPartnerCloneWithSkillsController(ApexPages.StandardController controller) {

        this.controller = controller;
        GSDP = (GSD_Partner__c)controller.getRecord();

    }
    
    public PageReference cloneWithItems() {

         Savepoint sp = Database.setSavepoint();
         GSD_Partner__c newGSDP;

         try {
         
             GSDP = (GSD_Partner__c) GSDDataUtility.getObject('GSD_Partner__c', GSDP.id);
             
             newGSDP = GSDP.clone(false);
             insert newGSDP;

            
             newRecordId = newGSDP.id;
           
           
             GSD_Resource__c OldGSDResource = [select id from  GSD_Resource__c where Partner__c = :GSDP.id limit 1];
             OldGSDResourceId = OldGSDResource.id;
             system.debug('OldGSDResourceId :'+OldGSDResourceId );
             
             GSD_Resource__c NewGSDResource = [select id from  GSD_Resource__c where Partner__c = :newRecordId  limit 1];
             NewGSDResourceId = NewGSDResource.id;
             system.debug('NewGSDResourceId :'+NewGSDResourceId);
             
             CLoneGSDResourceLang();
             CLoneGSDResourceNon();
             CLoneGSDResourcePPS();
             CLoneGSDResourcePMaster();
             CLoneGSDResourceServices();
             CLoneGSDResourceTech();

         } catch (Exception e){
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

        return new PageReference('/'+newGSDP.id+'/e?retURL=%2F'+newGSDP.id);
    }
    
    public void CLoneGSDResourceLang(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourceLang and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceNon(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourceNon and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourcePPS(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [select id,Skill_Name__c,Skill_Category__c,Standard__c,Stand_By__c,Non_Product_Skill_Level__c,Web_App_Resp_Created_Dt__c,Web_App_Resp_Modified_Dt__c,Responsibility_Skill_Level__c,Web_App_Employee_Id__c,Web_App_ID__c,Web_App_Skill_Id__c from GSD_Resource_Skills_mapping__c where Skill_Category__c = :Label.GSDResourcePPS and Resource_ID__c = :OldGSDResourceId];  
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourcePMaster(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Skill_Name__r.Name, Responsibility_Skill_Level__c, Skill_Name__r.Product_Description__c, Skill_Name__r.Portfolio__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c = :OldGSDResourceId AND Skill_Category__c =: Label.GSDResourcePMaster ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceServices(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Skill_Name__r.Name, Responsibility_Skill_Level__c, Skill_Name__r.Product_Description__c, Skill_Name__r.Portfolio__c, Skill_Name__r.Support_Activity__c,Standard__c, Stand_By__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c = :OldGSDResourceId AND Skill_Category__c ='Services' ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
    
    public void CLoneGSDResourceTech(){
    
        List<GSD_Resource_Skills_mapping__c> InsertnewSkillList = new List<GSD_Resource_Skills_mapping__c>();
        List<GSD_Resource_Skills_mapping__c> SkillsList = [SELECT Id, Name, Responsibility_Skill_Level__c, Skill_Name__r.Name, Skill_Name__r.Technologies_Name__c FROM GSD_Resource_Skills_mapping__c WHERE Resource_ID__c =:OldGSDResourceId  AND Skill_Category__c =: Label.GSDResourceTech ];
        if(!SkillsList.isEmpty()){
            for (GSD_Resource_Skills_mapping__c GSDrskill : SkillsList) {
                  GSD_Resource_Skills_mapping__c newGSDrskill  = GSDrskill.clone(false);
                  newGSDrskill.Resource_ID__c = NewGSDResourceId;
                  InsertnewSkillList.add(newGSDrskill);
            }
            system.debug('InsertnewSkillList:'+InsertnewSkillList);
            insert InsertnewSkillList ;
        }
    }
}

apex class:

public class GSDDataUtility {
    public static sObject getObject(string objName, string id) {
 
        String fieldnames = '';
        sObject obj;
        try {
            Map < String, Schema.SObjectType > m = Schema.getGlobalDescribe();
            Schema.SObjectType s = m.get(objName);
            Schema.DescribeSObjectResult r = s.getDescribe();
 
        
            Map < String, Schema.SObjectField > fields = r.fields.getMap();
            for (string field: fields.keySet()) {
                if (fieldnames == '') {
                    fieldnames = field;
                } else {
                    fieldnames += ',' + field;
                }
            }
 
            
            String sql = 'SELECT ' + fieldnames + ' FROM ' + objName + ' WHERE Id=\'' + id + '\'';
            System.debug(sql);
            obj = database.query(sql);
 
        } catch (Exception e) {
            System.debug('get Fields Error' + e.getMessage());
            ApexPages.addMessages(e);
            return null;
        }
        return obj;
    }
}
1. we having the solution, one is to remove the delete permission for object to every profile where we dont want to provide.
2. and we can create VF page to display the wanted view.

now,some out of box what i thought is to give OWD permission and put sharing rule which we will apply for all profile except admin.

Could you please give suggestion on this? how do i set it up?
or you have any better solution on this?
I have developed page to display..object,itsfields,childobjects,relationships and childobjfields

right now i have a problem with to render the child object fields..when we do change in parent objects...
it should render by according to respective child object fields.

Class:

public with sharing class ConfigurationController { 

    public Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); 
    public String selectedObject {get; set;}
    public String selectedField {get; set;}
     public String selectedChildobject {get; set;}
     public String selectedchildField {get; set;}
     public String Relationship {get; set;}
     
    Public ConfigurationController(){   
        selectedObject = 'Account';
        selectedChildobject = 'Account';
    }

    public List<SelectOption> getObjectNames(){
        List<SelectOption> objNames = new List<SelectOption>();
        List<String> entities = new List<String>(schemaMap.keySet());
        entities.sort();
        for(String name : entities)
        {
            objNames.add(new SelectOption(schemaMap.get(name).getDescribe().getName() ,schemaMap.get(name).getDescribe().getLabel() ));
        }
        return objNames;
     }

     public List<SelectOption> getObjectFields(){
        Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
        Schema.SObjectType ObjectSchema = schemaMap.get(selectedObject);
        Map<String, Schema.SObjectField> fieldMap = ObjectSchema.getDescribe().fields.getMap();
        List<SelectOption> fieldNames = new List<SelectOption>();
        for (String fieldName: fieldMap.keySet()) 
        {  
            fieldNames.add(new SelectOption(fieldMap.get(fieldName).getDescribe().getLabel(),fieldMap.get(fieldName).getDescribe().getLabel()));
        }
        return fieldNames;
      } 
      
      public List<SelectOption> getRelatedObjects(){
        map<string,string> relatedObjectsMap = new map<string,string>();
        system.debug('selectedObject :'+selectedObject);
        list<Schema.Childrelationship> relatedObjectsList = Schema.getGlobalDescribe().get(selectedObject).getdescribe().getChildRelationships();
        system.debug('relatedObjectsList :'+relatedObjectsList);
        List<SelectOption> ChildobjNames = new List<SelectOption>();
        for (Schema.Childrelationship  relatedObject : relatedObjectsList) {
             if(relatedObject.getChildSObject().getDescribe().isUpdateable()
                    && 
                    relatedObject.getChildSObject().getDescribe().getKeyPrefix()!=null
                    && 
                    !relatedObject.getChildSObject().getDescribe().isCustomSetting()
                    &&
                    relatedObject.getChildSObject().getDescribe().isCreateable()
                )
                   ChildobjNames.add(new SelectOption(relatedObject.getChildSObject().getDescribe().getName(),relatedObject.getChildSObject().getDescribe().getLabel()));
                   system.debug('ChildobjNames :'+ChildobjNames);
           }
           return ChildobjNames;
    }
    
    public List<SelectOption> getRelationships(){
        map<string,string> relatedObjectsMap = new map<string,string>();
        system.debug('selectedObject :'+selectedObject );
        list<Schema.Childrelationship> relatedObjectsList = Schema.getGlobalDescribe().get(selectedObject).getdescribe().getChildRelationships();
        system.debug('relatedObjectsList :'+relatedObjectsList);
        List<SelectOption> Relationships = new List<SelectOption>();
        for (Schema.Childrelationship  relatedObject : relatedObjectsList) {
                 if(relatedObject.getChildSObject().getDescribe().isUpdateable()
                    && 
                    relatedObject.getChildSObject().getDescribe().getKeyPrefix()!=null
                    && 
                    !relatedObject.getChildSObject().getDescribe().isCustomSetting()
                    &&
                    relatedObject.getChildSObject().getDescribe().isCreateable()
                )
                   if(relatedObject.getRelationshipName() != null){  
                       Relationships.add(new SelectOption(relatedObject.getRelationshipName(),relatedObject.getRelationshipName()));
                   }     
                   system.debug('Relationships :'+Relationships); 
           }
           return Relationships;
    }
    
    public List<SelectOption> getChildObjectFields(){
        Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
        system.debug('selectedChildobject :'+selectedChildobject);
        Schema.SObjectType ObjectSchema = schemaMap.get(selectedChildobject);
        Map<String, Schema.SObjectField> ChildfieldMap = ObjectSchema.getDescribe().fields.getMap();
        List<SelectOption> ChildfieldNames = new List<SelectOption>();
        for (String ChildfieldName: ChildfieldMap.keySet()) 
        {  
            ChildfieldNames.add(new SelectOption(ChildfieldMap.get(ChildfieldName).getDescribe().getLabel(),ChildfieldMap.get(ChildfieldName).getDescribe().getLabel()));
        }
        return ChildfieldNames;
      } 
}

Vf page:

<apex:page controller="ConfigurationController" sidebar="false"> 
<apex:form > 
      <apex:pageBlock >
          <apex:pageBlockSection columns="2" title="ParentSection">

              <apex:pageBlockSectionItem >
                  <apex:outputlabel value="Object:"/> 
                      <apex:actionRegion >      
                           <apex:selectList value="{!selectedObject}" size="1">
                                    <apex:selectOptions value="{!ObjectNames}"/>
                                    <apex:actionSupport event="onchange" rerender="myFields,childobj,relationship,childfields1"/>
                           </apex:selectList>
                     </apex:actionRegion>                         
              </apex:pageBlockSectionItem>

              <apex:pageBlockSectionItem >
                      <apex:outputlabel value="Fields:"/>   
                      <apex:outputPanel id="myFields">   
                        <apex:actionRegion >  
                           <apex:selectList value="{!selectedField}" size="1">
                                <apex:selectOptions value="{!ObjectFields}"/>
                            </apex:selectList>
                        </apex:actionRegion>      
                     </apex:outputPanel>
              </apex:pageBlockSectionItem>

          </apex:pageBlockSection>
          
           <apex:pageBlockSection columns="3" title="ChildSection"> 

              <apex:pageBlockSectionItem >
                  <apex:outputlabel value="ChildObjects:"/> 
                      <apex:outputPanel id="childobj">   
                      <apex:actionRegion >      
                           <apex:selectList value="{!selectedChildobject}" size="1">
                                    <apex:selectOptions value="{!RelatedObjects}"/>  
                                    <apex:actionSupport event="onchange" rerender="childfields"/>
                            </apex:selectList>
                     </apex:actionRegion>
                     </apex:outputPanel>                         
              </apex:pageBlockSectionItem>
            
               <apex:pageBlockSectionItem >
                  <apex:outputlabel value="Relationships:"/> 
                     <apex:outputPanel id="relationship">
                     <apex:actionRegion >      
                           <apex:selectList value="{!Relationship}" size="1">
                                    <apex:selectOptions value="{!Relationships}"/>
                            </apex:selectList>
                     </apex:actionRegion>
                     </apex:outputPanel>                          
              </apex:pageBlockSectionItem>
            
              <apex:pageBlockSectionItem >
                      <apex:outputlabel value="Fields:"/>   
                      <apex:outputPanel id="childfields">    
                        <apex:actionRegion >  
                           <apex:selectList value="{!selectedchildField}" size="1">
                                <apex:selectOptions value="{!ChildObjectFields}"/>
                            </apex:selectList>
                        </apex:actionRegion>      
                         </apex:outputPanel>      
              </apex:pageBlockSectionItem>

          </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>