• Charlie Chaplin 2017
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 2
    Replies
Hi there,
I am try to move a change set from full Sandbox to Production relaed to community. When i try to Validate changes set in production i am seeing this error message.

Salesforce.com can't validate the domain. The CNAME record may still be processing (which can take up to 24 hours), or the domain may not belong to you. Make sure the domain name uses Domainname.Org Id.live.siteforce.com as its CNAME target and try again later.

i was told by salesforce support that move change set without site.com component in changes set. I followed that, validated and deployed change set to production. 
Now i am trying to create a domain from my domain management but it does not allow me to create and give me the sames error mentioned above. 
Does some one has seen this error or have a clue what am i missing.
Also now the Site.com component is missing from Production how can i enable or build it again.  
I had enabled communities and domain in myproduction environment before change set deployment. 
i am trying to create a new domain in production, When i try to create it i get this error.
Error: Salesforce.com can't validate the domain. The CNAME record may still be processing (which can take up to 24 hours), or the domain may not belong to you. Make sure the domain name ******** uses Domanin Name.Org ID.live.siteforce.com as its CNAME target and try again later.
Anyone had seen this error or knwo why it is happening 
i am in the middle of moving changes set from Full sandbox to production. I hitting this error.
Communities are enabled in production. 
Already created Domain Name

Salesforce.com can't validate the domain. The CNAME record may still be processing (which can take up to 24 hours), or the domain may not belong to you. Make sure the domain name ******* uses Domainname.Org ID.live.siteforce.com as its CNAME target and try again later.
 
I am trying to delelte mulptiple triggers from Production environment but not able to delete it.
1. Created a force.com roject
2. Open Xml file and changes Status from inactive to "Deleted"
3. saved it to server
4. Slected theCredit package and XML file and deployed it to server

This is my log file but trigger is not deleted. Anyone know what i am doing wrong?

# Deployed From:
   Project name: Delete trigger from Prod 1
   Username: jamil.ahmed@everbank.com.devtrigger
   Endpoint: test.salesforce.com

# Deployed To:
   Username: jamil.ahmed@everbank.com.ci
   Endpoint: test.salesforce.com

# Deploy Results:
   File Name:    package.xml
   Full Name:  package.xml
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    triggers/AfterInsert.trigger
   Full Name:  Afterinsert
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

# Test Results:
   n/a
We cannot do calculation in step # 3 in Salesforce due to its limitation of handling very large numbers.
 
 CreatingExampleChart
   a10
 System number10Bx939c5543TqA1144Mb11
 Account Number999143xc12
   d13
Step 1Conversion using chart1011329391255432926101144229914333e14
   f15
Step 2Add 00 at end101132939125543000000000000000000000g16
   h17
Step 3Divide by 971042617929129312294946332267952920.618556701030928i18
 Truncate the remainder to 3 digits.618j19
 Multiply by 9759.946k20
 Round to the nearest whole number60l21
   m22
   n23
   o24
   p25
   q26
   r27
   s28
   t29
   u30
   v31
   w32
   x33
   y34
   z35
      
 
 
We cannot do calculation in step # 3 in Salesforce due to its limitation of handling very large numbers.
 
 CreatingExampleChart
   a10
 System number10Bx939c5543TqA1144Mb11
 Account Number999143xc12
   d13
Step 1Conversion using chart1011329391255432926101144229914333e14
   f15
Step 2Add 00 at end101132939125543000000000000000000000g16
   h17
Step 3Divide by 971042617929129312294946332267952920.618556701030928i18
 Truncate the remainder to 3 digits.618j19
 Multiply by 9759.946k20
 Round to the nearest whole number60l21
   m22
   n23
   o24
   p25
   q26
   r27
   s28
   t29
   u30
   v31
   w32
   x33
   y34
   z35
      
 
Any help will be really appreciated
Hi there,
To all my Devloper friends. I am facing a challenge at this moment. I have this Apex class fetching data from an custom Object and displaying it through a Visual force page. My problem is this class has been written by previous developer and i have no clue what is the logic behind this class to sort, match and display data on Visual force page.
It would be a great help if anyone can let me know how this class is matching data. What is the logic behind it and if i need to change this logic how can i do that.
Here is the Apex Class.

public class RegulationOCheckCtrl {
    
    public class Wrapper {
        public Boolean success { get; set; }
        public Object message { get; set; }
        public Object response { get; set; }
    }

    public class Match {
        public String accountName { get; set; }
        public Double similarity { get; set; }
    }

    public static List<String> tokenize(String str){

        List<String> allPairs = new List<String>();

        String[] tokens = str.split(' ');

        for (Integer t = 0; t < tokens.size(); t++)
        {
            if (!String.isEmpty(tokens[t]))
            {
                String[] pairs = generateBigrams(tokens[t]);

                for (Integer p = 0; p < pairs.size(); p++)
                {
                    allPairs.add(pairs[p]);
                }
            }
        }

        return allPairs;        

    }

    public static List<String> generateBigrams(String str){

        Integer numPairs = str.length() - 1;

        String[] bigrams = new String[numPairs];

        System.debug(numPairs);

        for(Integer i = 0; i < numPairs; i++){
            bigrams[i] = str.substring(i, i + 2);
        }

        return bigrams;

    }
    
    public static String cleanString (String str){
        
        String searchString = str;
        String specialChars = '!|@|#|$|%|^|&|*|(|)|_|-|+|=|{|}|[|]|:|;|"|\'|<|>|,|.|?|/|\\|~|`';
        
        for(Integer i = 0; i<specialChars.split('|').size(); i++){
            searchString = searchString.replace(specialChars.split('|')[i], '');
        }
        
        return searchString;
        
    }

    @RemoteAction
    public static Wrapper compare (Id accountId){

        Wrapper w = new Wrapper();

        try{

            Account context = [SELECT Id, Name FROM Account WHERE Id = :accountId LIMIT 1];

            List<String> source = tokenize(cleanString(context.Name.toUpperCase()));
        
            List <Match> matches = new List<Match>();

            for(RegOInsiders__c r: [SELECT Id, Name FROM RegOInsiders__c WHERE RecordType.DeveloperName = 'Current']){

                List <String> target = tokenize(cleanString(r.Name.toUpperCase()));

                Integer intersection = 0;
                Integer union = source.size() + target.size();

                for(Integer o = 0; o < source.size(); o++){
                    for(Integer i = 0; i < target.size(); i++){
                        if(source[o] == target[i]){
                            intersection++;
                            target.remove(i);
                            break;
                        }
                    }
                }

                Match m = new Match();
                m.accountName = r.Name;     
                m.similarity = (2.0 * intersection) / union;
                if(m.similarity !=0)
                {
                    matches.add(m);
                }
                
                         
            }

            String[] messages = new String[]{'All Reg-O insiders compared and retrieved!'};

            w.success = true;
            w.message = messages;
            w.response = matches;

        }catch(Exception ex){

            String[] messages = new String[]{ex.getMessage()};

            w.success = false;
            w.message = messages;

        }
    
        return w;

    }

    @RemoteAction
    public static Wrapper record (Id accountId, String data){

        Wrapper w = new Wrapper();

        try{
        
            Datetime d = Datetime.now();     
            String now = d.format('yyyy-MM-dd_HH-mm-ss');

            Boolean match = false;
            Account context = [SELECT Id, Name FROM Account WHERE Id = :accountId LIMIT 1];

            List<Match> matches = (List<Match>)JSON.deserialize(data, List<Match>.class);

            for(Match m: matches){
                if(m.similarity > .80){
                    match = true;
                }
            }
        
            Regulation_O_Check_History__c insertRegulationOCheckHistory = new Regulation_O_Check_History__c();
            insertRegulationOCheckHistory.Associated_Account__c = context.Id;
            insertRegulationOCheckHistory.Match__c = match;
        
            INSERT insertRegulationOCheckHistory; 
            Regulation_O_Check_History__c regulationOCheckHistory = [SELECT Id, Name FROM Regulation_O_Check_History__c WHERE Id = :insertRegulationOCheckHistory.Id];

            String csv = 'Comparing Against:,' + context.Name + '\n';
            csv += '\n';
            csv += 'Insider,% Similarity\n';
            for(Match m: matches){
                csv += m.accountName.escapeCSV() + ',' + m.similarity + '\n';
            }

            Blob blobCSV = Blob.valueOf(csv);
    
            Attachment attachment = new Attachment();
            attachment.ParentId = regulationOCheckHistory.Id;
            attachment.Name = context.Name + '_' + regulationOCheckHistory.Name + '_' + now + '.csv';
            attachment.ContentType = 'application/csv';
            attachment.Body = blobCSV;

            INSERT attachment; 

            String[] messages = new String[]{
                'Created Reg-O Check History Record',
                '/' + regulationOCheckHistory.Id
            };

            w.success = true;
            w.message = messages;

        }catch(Exception ex){
      
            String[] messages = new String[]{ex.getMessage()};

            w.success = true;
            w.message = ex.getMessage();

        }

        return w;
          
    }

    public RegulationOCheckCtrl(ApexPages.StandardController ctrl){}

}
Your helpp is really appreciated
Need some help. I am moving this trigger from Partial sandbox to production. It is generating this error. 
System.LimitException: Too many SOQL queries: 101
Stack Trace: Trigger.DealflowCustomApprovalProcessTriggerAIAU: line 5, column 1

Please let me know what am i doing wrong here. 

trigger DealflowCustomApprovalProcessTriggerAIAU on Approval_History__c (after insert, after update) {
    
    Set<Id> CpId = new Set<Id>();
    List<Underwriting__c> UpdatedCP = new List<Underwriting__c>();
    List<Approval_history__c> AH = new List<Approval_history__c>([Select Id, RecordType.DeveloperName, current_approver__c, type__c,  status__c, credit_package__c,actual_approver__c,preliminary_approval__c FROM Approval_history__c WHERE Id IN: Trigger.newMap.keySet()]);
    
    For(Approval_history__c A:AH){
        CpId.add(A.credit_Package__c);
        Map<Id, Underwriting__c> Und = new Map<Id,Underwriting__c>([SELECT Id, Preliminary_Credit_Approval__c, Preliminary_Credit_Approval_Date__c, Final_Initial_Approver__c, Lock_Credit_Package__c,underwriting_stage__c,final_approver__c,final_decision_date__c, RecordType.DeveloperName,Initial_Credit_Approval__c,Initial_Credit_Approval_Date__c,final_preliminary_approver__c from Underwriting__c WHERE Id IN:CpId]);
        Underwriting__c u = und.get(A.credit_package__c);
        
        If(Trigger.IsInsert && (U.RecordType.DeveloperName =='MT_Credit_Package' || U.RecordType.DeveloperName == 'Commercial_Direct' || U.RecordType.DeveloperName == 'Credit_Package') && U.underwriting_stage__c =='Underwriting Review'){
            A.type__c = 'Initial Loan Approval';
            u.underwriting_stage__c = 'Pending Initial Approval';
            UpdatedCP.add(u);
            Update A;
        }
        
        If(Trigger.IsInsert && (U.RecordType.DeveloperName =='MT_Credit_Package' || U.RecordType.DeveloperName == 'Commercial_Direct' || U.RecordType.DeveloperName == 'Credit_Package') && U.underwriting_stage__c =='Borrower Accepted'){
            A.type__c = 'Preliminary Loan Approval';
            u.underwriting_stage__c = 'Pending Preliminary Approval';
            UpdatedCP.add(u);
            Update A;
        }
        
        If(Trigger.IsInsert && (U.RecordType.DeveloperName =='MT_Credit_Package' || U.RecordType.DeveloperName == 'Commercial_Direct' || U.RecordType.DeveloperName == 'Credit_Package') && U.underwriting_stage__c =='In Process'){
            A.type__c = 'Final Loan Approval';
            u.underwriting_stage__c = 'Pending Final Approval';
            UpdatedCP.add(u);
            Update A;
        }
        
        If(Trigger.IsInsert && U.underwriting_stage__c =='Pending Initial Approval'){
            A.type__c = 'Initial Loan Approval';
            
            Update A;}
        
        If(Trigger.IsInsert && U.underwriting_stage__c =='Pending Preliminary Approval'){
            A.type__c = 'Preliminary Loan Approval';       
            Update A;
        }
        
        If(Trigger.IsInsert && U.underwriting_stage__c =='Pending Final Approval'){
            A.type__c = 'Final Loan Approval';
            Update A;
        }
        
        If(Trigger.IsInsert && (((U.RecordType.DeveloperName =='Credit_Package' || U.RecordType.DeveloperName == 'Commercial_Direct' || 
                                  U.RecordType.DeveloperName == 'MT_Credit_Package') && U.underwriting_stage__c =='In Process') || 
                                (U.RecordType.DeveloperName !='MT_Credit_Package' && U.RecordType.DeveloperName != 'Credit_Package' && 
                                 U.RecordType.DeveloperName != 'Commercial_Direct' && U.underwriting_stage__c =='Underwriting Review'))){
                                     
                                     u.underwriting_stage__c = 'Pending Final Approval';
                                     A.type__c = 'Final Loan Approval';  
                                     //u.Committee_Type__c = a.Committee_Type__c;
                                     UpdatedCP.add(u);
                                     Update A;
                                     
                                 }
        
        //the isInsert conditions below will not execute as the below types are not set implicitly.  They are set on update, not insert.
        If(trigger.IsInsert && A.Status__c == 'Final Approved' && A.type__c == 'Initial Loan Approval'){
            U.underwriting_stage__c = 'Initial Credit Approved';
            U.Initial_Credit_Approval__c = TRUE;
            U.Initial_Credit_Approval_Date__c = date.today();
            U.Final_Initial_Approver__c = a.actual_approver__c;              
            UpdatedCP.add(u);
        } 
        
        If(trigger.IsInsert && A.Status__c == 'Final Approved' && A.type__c == 'Preliminary Loan Approval'){
            U.underwriting_stage__c = 'In Process';
            U.Preliminary_Credit_Approval__c = TRUE;
            U.Preliminary_Credit_Approval_Date__c = date.today();
            U.Final_Preliminary_Approver__c = a.actual_approver__c;            
            UpdatedCP.add(u);
        } 
        
        if(trigger.IsInsert && A.Status__c == 'Final Approved' && A.type__c == 'Final Loan Approval'){
            U.underwriting_stage__c = 'Final Credit Approved';
            U.final_approval__c = TRUE;
            U.final_decision_date__c = date.today();
            U.final_approver__c = a.actual_approver__c;
            UpdatedCP.add(u);
        }
        //the isInsert conditions above will not execute as the below types are not set implicitly.  They are set on update, not insert.
        If(trigger.IsUpdate && A.Status__c == 'Final Approved' && trigger.oldmap.get(A.Id).Status__c =='Pending' && A.type__c == 'Initial Loan Approval'){
            System.debug('89');
            U.underwriting_stage__c = 'Initial Credit Approved';
            U.Initial_Credit_Approval__c = TRUE;
            U.Initial_Credit_Approval_Date__c = date.today();
            U.Final_Initial_Approver__c = a.actual_approver__c;
            UpdatedCP.add(u);
        }  
        
        If(trigger.IsUpdate && A.Status__c == 'Rejected' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Initial Loan Approval'){
            U.underwriting_stage__c = 'Underwriting Review';        
            UpdatedCP.add(u);
        }
        
        If(trigger.IsUpdate && A.Status__c == 'Final Approved' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Preliminary Loan Approval'){
            U.underwriting_stage__c = 'In Process';
            U.Preliminary_Credit_Approval__c = TRUE;
            U.Preliminary_Credit_Approval_Date__c = date.today();
            U.final_preliminary_approver__c = a.actual_approver__c;
            UpdatedCP.add(u);
        }  
        
        If(trigger.IsUpdate && A.Status__c == 'Rejected' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Preliminary Loan Approval'){
            U.underwriting_stage__c = 'Borrower Accepted';
            UpdatedCP.add(u);
        }
        
        If(trigger.IsUpdate && A.Status__c == 'Final Approved' && trigger.oldmap.get(A.Id).Status__c =='Pending' && A.type__c == 'Final Loan Approval'){
            u.underwriting_stage__c = 'Final Credit Approved';
            u.final_approval__c = TRUE;
            u.final_decision_date__c = date.today();
            u.final_approver__c = a.actual_approver__c;
            UpdatedCP.add(u);
        }
        
        If(trigger.IsUpdate && A.Status__c == 'Rejected' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Final Loan Approval' && U.RecordType.DeveloperName !='MT_Credit_Package' && U.RecordType.DeveloperName != 'Credit_Package'){
            U.underwriting_stage__c = 'Underwriting Review';
            UpdatedCP.add(u);
        }        
        
        If(trigger.IsUpdate && A.Status__c == 'Rejected' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Final Loan Approval' && (U.RecordType.DeveloperName =='MT_Credit_Package' || U.RecordType.DeveloperName == 'Credit_Package')){
            U.underwriting_stage__c = 'In Process';       
            UpdatedCP.add(u);
        } 
        
        if(trigger.IsUpdate && a.RecordType.DeveloperName == 'Credit_Committee'){
            if(u.Underwriting_Stage__c == 'In Process'){                   
                u.Final_Preliminary_Approver__c = a.Actual_Approver__c;
                u.Committee_Type__c = a.Current_Approver__c;                         
            }else if(u.Underwriting_Stage__c == 'Final Credit Approved'){                 
                u.Final_Approver__c = a.Actual_Approver__c;
                u.Committee_Type__c = a.Current_Approver__c;                 
            }else{                   
                u.Final_Initial_Approver__c = a.Actual_Approver__c;
                u.Committee_Type__c = a.Current_Approver__c;                   
            }    
            UpdatedCP.add(u);
        }
        
        If(UpdatedCp.size()>0){
            update updatedcp;}
    } 
}
 
Need some help. I am try to deploy this class to our Production environment. I getting an error: System.AssertException: Assertion Failed: Same value: null
Stack Trace: Class.ManageVendorProductsControllerTest.existingReviewInProgressSupplemental: line 197, column 1
 
Anyone know why i am getting this error message. 
@isTest
private class ManageVendorProductsControllerTest {
    
    static TestMethod void noExistingReviews (){
                
        PageReference ref = Page.ManageVendorProducts;
       
        Account a = new Account();
        a.Name = 'TESTACCOUNT';
        a.Lease_Volume__c = 10000000.00;
        a.BillingState = 'NJ';
        INSERT a;
        
        Reliance_Product__c rp = new Reliance_Product__c();
        rp.Reliance_Level__c = 'Medium';
        rp.Reliance_Sort__c = 1;
        rp.Name = 'TESTRELIANCEPRODUCT';
        INSERT rp;
        
        Account account = [SELECT Id, Lease_Volume__c FROM Account LIMIT 1];
        Reliance_Product__c relianceProduct = [SELECT Id FROM Reliance_Product__c LIMIT 1];
        
        Vendor_Products__c vp = new Vendor_Products__c();
        vp.Account__c = account.Id;
        vp.Reliance_Product__c = relianceProduct.Id;
        INSERT vp;
                
        List<Vendor_Products__c> vendorProduct = [SELECT Id FROM Vendor_Products__c];
        
        Test.setCurrentPage(ref);  
                   
        ref.getParameters().put('retURL', account.Id);     
        ref.getParameters().put('id', account.Id);   
        
        ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(vendorProduct);
        ManageVendorProductsController controller = new ManageVendorProductsController(ssc);
             
        controller.viewModel.products[0].relianceProduct = relianceProduct;
        controller.viewModel.products[0].selected = true;
        controller.viewModel.account = account;
               
        System.assertNotEquals(null, controller.updateVendorProducts());
        
        controller.ViewModel.products[0].selected = false;
        
        System.assertNotEquals(null, controller.updateVendorProducts());
        
        controller.ViewModel.products[0].selected = true;
        
        System.assertNotEquals(null, controller.updateVendorProducts());
        
        System.assertNotEquals(null, controller.cancel());
        
    }
    
    static TestMethod void existingReviewVendorBookInitalApplication (){
                
        PageReference ref = Page.ManageVendorProducts;
       
        Account a = new Account();
        a.Name = 'TESTACCOUNT';
        a.Lease_Volume__c = 10000000.00;
        a.BillingState = 'NJ';
        INSERT a;
        
        Reliance_Product__c rp = new Reliance_Product__c();
        rp.Reliance_Level__c = 'Medium';
        rp.Reliance_Sort__c = 1;
        rp.Name = 'TESTRELIANCEPRODUCT';
        INSERT rp;
        
        Account account = [SELECT Id, Lease_Volume__c FROM Account LIMIT 1];
        Reliance_Product__c relianceProduct = [SELECT Id FROM Reliance_Product__c LIMIT 1];
        
        Vendor_Products__c vp = new Vendor_Products__c();
        vp.Account__c = account.Id;
        vp.Reliance_Product__c = relianceProduct.Id;
        INSERT vp;
        
        Review__c review = new Review__c();
        review.Account__c = account.Id;
        review.RecordTypeId = [SELECT Id, sObjectType, Name FROM RecordType WHERE Name = 'Initial Application' AND sObjectType = 'Review__c' LIMIT 1].Id;
        review.Is_Approved__c = TRUE;
        review.Review_Stat__c = 'Vendor Booked';
        INSERT review;
                
        List<Vendor_Products__c> vendorProduct = [SELECT Id FROM Vendor_Products__c];
        
        Test.setCurrentPage(ref);  
                   
        ref.getParameters().put('retURL', account.Id);     
        ref.getParameters().put('id', account.Id);   
        
        ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(vendorProduct);
        ManageVendorProductsController controller = new ManageVendorProductsController(ssc);
             
        controller.viewModel.products[0].relianceProduct = relianceProduct;
        controller.viewModel.products[0].selected = true;
        controller.viewModel.account = account;
               
        System.assertEquals(null, controller.updateVendorProducts());
                
    }
    
    static TestMethod void existingReviewCompletedSupplemental (){
                
        PageReference ref = Page.ManageVendorProducts;
       
        Account a = new Account();
        a.Name = 'TESTACCOUNT';
        a.Lease_Volume__c = 10000000.00;
        a.BillingState = 'NJ';
        INSERT a;
        
        Reliance_Product__c rp = new Reliance_Product__c();
        rp.Reliance_Level__c = 'Medium';
        rp.Reliance_Sort__c = 1;
        rp.Name = 'TESTRELIANCEPRODUCT';
        INSERT rp;
        
        Account account = [SELECT Id, Lease_Volume__c FROM Account LIMIT 1];
        Reliance_Product__c relianceProduct = [SELECT Id FROM Reliance_Product__c LIMIT 1];
        
        Vendor_Products__c vp = new Vendor_Products__c();
        vp.Account__c = account.Id;
        vp.Reliance_Product__c = relianceProduct.Id;
        INSERT vp;
        
        Review__c review = new Review__c();
        review.Account__c = account.Id;
        review.RecordTypeId = [SELECT Id, sObjectType, Name FROM RecordType WHERE Name = 'Supplemental' AND sObjectType = 'Review__c' LIMIT 1].Id;
        review.Is_Completed__c = TRUE;
        INSERT review;
                
        List<Vendor_Products__c> vendorProduct = [SELECT Id FROM Vendor_Products__c];
        
        Test.setCurrentPage(ref);  
                   
        ref.getParameters().put('retURL', account.Id);     
        ref.getParameters().put('id', account.Id);   
        
        ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(vendorProduct);
        ManageVendorProductsController controller = new ManageVendorProductsController(ssc);
             
        controller.viewModel.products[0].relianceProduct = relianceProduct;
        controller.viewModel.products[0].selected = true;
        controller.viewModel.account = account;
               
        System.assertEquals(null, controller.updateVendorProducts());
                
    }
    
    static TestMethod void existingReviewInProgressSupplemental (){
                
        PageReference ref = Page.ManageVendorProducts;
       
        Account a = new Account();
        a.Name = 'TESTACCOUNT';
        a.Lease_Volume__c = 10000000.00;
        a.BillingState = 'NJ';
        INSERT a;
        
        Reliance_Product__c rp = new Reliance_Product__c();
        rp.Reliance_Level__c = 'Medium';
        rp.Reliance_Sort__c = 1;
        rp.Name = 'TESTRELIANCEPRODUCT';
        INSERT rp;
        
        Account account = [SELECT Id, Lease_Volume__c FROM Account LIMIT 1];
        Reliance_Product__c relianceProduct = [SELECT Id FROM Reliance_Product__c LIMIT 1];
        
        Vendor_Products__c vp = new Vendor_Products__c();
        vp.Account__c = account.Id;
        vp.Reliance_Product__c = relianceProduct.Id;
        INSERT vp;
        
        Review__c review = new Review__c();
        review.Account__c = account.Id;
        review.RecordTypeId = [SELECT Id, sObjectType, Name FROM RecordType WHERE Name = 'Supplemental' AND sObjectType = 'Review__c' LIMIT 1].Id;
        review.In_Progress__c = TRUE;
        INSERT review;
                
        List<Vendor_Products__c> vendorProduct = [SELECT Id FROM Vendor_Products__c];
        
        Test.setCurrentPage(ref);  
                   
        ref.getParameters().put('retURL', account.Id);     
        ref.getParameters().put('id', account.Id);   
        
        ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(vendorProduct);
        ManageVendorProductsController controller = new ManageVendorProductsController(ssc);
             
        controller.viewModel.products[0].relianceProduct = relianceProduct;
        controller.viewModel.products[0].selected = true;
        controller.viewModel.account = account;
               
        System.assertNotEquals(null, controller.updateVendorProducts());
        
        controller.ViewModel.products[0].selected = false;
        
        System.assertNotEquals(null, controller.updateVendorProducts());
        
        controller.ViewModel.products[0].selected = true;
        
        System.assertNotEquals(null, controller.updateVendorProducts());
        
        System.assertNotEquals(null, controller.cancel());
                
    }
    
}
Hi we are trying to build a integration via Talend from SFDC to Data Warehouse. Issue is when you create a onnection to salesforce.com i can see standard fields but custom fields are not visble. Any thougts. 
Validation rule for lookup field and picklist value based on record typeWe have custom object ABCD. Which is present on Account object as related list
When a user creates a new record on this custom object.
this new record is assinged to a queue. XYZ
Newly created record have
Owner as lookup field
Review Type as Picklist Field 
Want i want to do is when a new record has been create based on a particular Record Type. 
User should not be able to edit the record till he change the Owner. Once that's done.
Review Type picklist value should be changed before make any further changes to the record.
Here is the rule what i have 
AND
(
RecordType.Name = "Supplemental",
ISCHANGED(OwnerId),
      (ISBLANK(TEXT( Review_Type__c)))
)

User-added image
Need some help. I am moving this trigger from Partial sandbox to production. It is generating this error. 
System.LimitException: Too many SOQL queries: 101
Stack Trace: Trigger.DealflowCustomApprovalProcessTriggerAIAU: line 5, column 1

Please let me know what am i doing wrong here. 

trigger DealflowCustomApprovalProcessTriggerAIAU on Approval_History__c (after insert, after update) {
    
    Set<Id> CpId = new Set<Id>();
    List<Underwriting__c> UpdatedCP = new List<Underwriting__c>();
    List<Approval_history__c> AH = new List<Approval_history__c>([Select Id, RecordType.DeveloperName, current_approver__c, type__c,  status__c, credit_package__c,actual_approver__c,preliminary_approval__c FROM Approval_history__c WHERE Id IN: Trigger.newMap.keySet()]);
    
    For(Approval_history__c A:AH){
        CpId.add(A.credit_Package__c);
        Map<Id, Underwriting__c> Und = new Map<Id,Underwriting__c>([SELECT Id, Preliminary_Credit_Approval__c, Preliminary_Credit_Approval_Date__c, Final_Initial_Approver__c, Lock_Credit_Package__c,underwriting_stage__c,final_approver__c,final_decision_date__c, RecordType.DeveloperName,Initial_Credit_Approval__c,Initial_Credit_Approval_Date__c,final_preliminary_approver__c from Underwriting__c WHERE Id IN:CpId]);
        Underwriting__c u = und.get(A.credit_package__c);
        
        If(Trigger.IsInsert && (U.RecordType.DeveloperName =='MT_Credit_Package' || U.RecordType.DeveloperName == 'Commercial_Direct' || U.RecordType.DeveloperName == 'Credit_Package') && U.underwriting_stage__c =='Underwriting Review'){
            A.type__c = 'Initial Loan Approval';
            u.underwriting_stage__c = 'Pending Initial Approval';
            UpdatedCP.add(u);
            Update A;
        }
        
        If(Trigger.IsInsert && (U.RecordType.DeveloperName =='MT_Credit_Package' || U.RecordType.DeveloperName == 'Commercial_Direct' || U.RecordType.DeveloperName == 'Credit_Package') && U.underwriting_stage__c =='Borrower Accepted'){
            A.type__c = 'Preliminary Loan Approval';
            u.underwriting_stage__c = 'Pending Preliminary Approval';
            UpdatedCP.add(u);
            Update A;
        }
        
        If(Trigger.IsInsert && (U.RecordType.DeveloperName =='MT_Credit_Package' || U.RecordType.DeveloperName == 'Commercial_Direct' || U.RecordType.DeveloperName == 'Credit_Package') && U.underwriting_stage__c =='In Process'){
            A.type__c = 'Final Loan Approval';
            u.underwriting_stage__c = 'Pending Final Approval';
            UpdatedCP.add(u);
            Update A;
        }
        
        If(Trigger.IsInsert && U.underwriting_stage__c =='Pending Initial Approval'){
            A.type__c = 'Initial Loan Approval';
            
            Update A;}
        
        If(Trigger.IsInsert && U.underwriting_stage__c =='Pending Preliminary Approval'){
            A.type__c = 'Preliminary Loan Approval';       
            Update A;
        }
        
        If(Trigger.IsInsert && U.underwriting_stage__c =='Pending Final Approval'){
            A.type__c = 'Final Loan Approval';
            Update A;
        }
        
        If(Trigger.IsInsert && (((U.RecordType.DeveloperName =='Credit_Package' || U.RecordType.DeveloperName == 'Commercial_Direct' || 
                                  U.RecordType.DeveloperName == 'MT_Credit_Package') && U.underwriting_stage__c =='In Process') || 
                                (U.RecordType.DeveloperName !='MT_Credit_Package' && U.RecordType.DeveloperName != 'Credit_Package' && 
                                 U.RecordType.DeveloperName != 'Commercial_Direct' && U.underwriting_stage__c =='Underwriting Review'))){
                                     
                                     u.underwriting_stage__c = 'Pending Final Approval';
                                     A.type__c = 'Final Loan Approval';  
                                     //u.Committee_Type__c = a.Committee_Type__c;
                                     UpdatedCP.add(u);
                                     Update A;
                                     
                                 }
        
        //the isInsert conditions below will not execute as the below types are not set implicitly.  They are set on update, not insert.
        If(trigger.IsInsert && A.Status__c == 'Final Approved' && A.type__c == 'Initial Loan Approval'){
            U.underwriting_stage__c = 'Initial Credit Approved';
            U.Initial_Credit_Approval__c = TRUE;
            U.Initial_Credit_Approval_Date__c = date.today();
            U.Final_Initial_Approver__c = a.actual_approver__c;              
            UpdatedCP.add(u);
        } 
        
        If(trigger.IsInsert && A.Status__c == 'Final Approved' && A.type__c == 'Preliminary Loan Approval'){
            U.underwriting_stage__c = 'In Process';
            U.Preliminary_Credit_Approval__c = TRUE;
            U.Preliminary_Credit_Approval_Date__c = date.today();
            U.Final_Preliminary_Approver__c = a.actual_approver__c;            
            UpdatedCP.add(u);
        } 
        
        if(trigger.IsInsert && A.Status__c == 'Final Approved' && A.type__c == 'Final Loan Approval'){
            U.underwriting_stage__c = 'Final Credit Approved';
            U.final_approval__c = TRUE;
            U.final_decision_date__c = date.today();
            U.final_approver__c = a.actual_approver__c;
            UpdatedCP.add(u);
        }
        //the isInsert conditions above will not execute as the below types are not set implicitly.  They are set on update, not insert.
        If(trigger.IsUpdate && A.Status__c == 'Final Approved' && trigger.oldmap.get(A.Id).Status__c =='Pending' && A.type__c == 'Initial Loan Approval'){
            System.debug('89');
            U.underwriting_stage__c = 'Initial Credit Approved';
            U.Initial_Credit_Approval__c = TRUE;
            U.Initial_Credit_Approval_Date__c = date.today();
            U.Final_Initial_Approver__c = a.actual_approver__c;
            UpdatedCP.add(u);
        }  
        
        If(trigger.IsUpdate && A.Status__c == 'Rejected' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Initial Loan Approval'){
            U.underwriting_stage__c = 'Underwriting Review';        
            UpdatedCP.add(u);
        }
        
        If(trigger.IsUpdate && A.Status__c == 'Final Approved' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Preliminary Loan Approval'){
            U.underwriting_stage__c = 'In Process';
            U.Preliminary_Credit_Approval__c = TRUE;
            U.Preliminary_Credit_Approval_Date__c = date.today();
            U.final_preliminary_approver__c = a.actual_approver__c;
            UpdatedCP.add(u);
        }  
        
        If(trigger.IsUpdate && A.Status__c == 'Rejected' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Preliminary Loan Approval'){
            U.underwriting_stage__c = 'Borrower Accepted';
            UpdatedCP.add(u);
        }
        
        If(trigger.IsUpdate && A.Status__c == 'Final Approved' && trigger.oldmap.get(A.Id).Status__c =='Pending' && A.type__c == 'Final Loan Approval'){
            u.underwriting_stage__c = 'Final Credit Approved';
            u.final_approval__c = TRUE;
            u.final_decision_date__c = date.today();
            u.final_approver__c = a.actual_approver__c;
            UpdatedCP.add(u);
        }
        
        If(trigger.IsUpdate && A.Status__c == 'Rejected' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Final Loan Approval' && U.RecordType.DeveloperName !='MT_Credit_Package' && U.RecordType.DeveloperName != 'Credit_Package'){
            U.underwriting_stage__c = 'Underwriting Review';
            UpdatedCP.add(u);
        }        
        
        If(trigger.IsUpdate && A.Status__c == 'Rejected' && trigger.oldmap.get(A.Id).Status__c =='Pending'&& A.type__c == 'Final Loan Approval' && (U.RecordType.DeveloperName =='MT_Credit_Package' || U.RecordType.DeveloperName == 'Credit_Package')){
            U.underwriting_stage__c = 'In Process';       
            UpdatedCP.add(u);
        } 
        
        if(trigger.IsUpdate && a.RecordType.DeveloperName == 'Credit_Committee'){
            if(u.Underwriting_Stage__c == 'In Process'){                   
                u.Final_Preliminary_Approver__c = a.Actual_Approver__c;
                u.Committee_Type__c = a.Current_Approver__c;                         
            }else if(u.Underwriting_Stage__c == 'Final Credit Approved'){                 
                u.Final_Approver__c = a.Actual_Approver__c;
                u.Committee_Type__c = a.Current_Approver__c;                 
            }else{                   
                u.Final_Initial_Approver__c = a.Actual_Approver__c;
                u.Committee_Type__c = a.Current_Approver__c;                   
            }    
            UpdatedCP.add(u);
        }
        
        If(UpdatedCp.size()>0){
            update updatedcp;}
    } 
}
 

Hi Friends

 

I have using 4 custom objects such as contact , lead, Listing, closing . I have been removed  the new button on those custom object search layout page(Buttons displayed) . but these objects list view page has displayed new standard button. How to remove the standard new button from the custom objects list view page.?please post ur suggestion

 

 

Thanks

Sundar