• Ravi23
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 19
    Replies
   I have a page where there are 6 questions and out of them one functionality is if I select other there is a text box opening where I need to enter what the other is in that text box.

All 6 questions are mandatory.

The challenge or issue here is say I did not fill the first question but filled all other and come to the 5 question where I select other a text box opens and I enter some details and click next since I did not fill first question it will throw me a error as expected but the cursor is going back to the text box always instead of stopping at the top of the page. Can some one help me in resolving this.
  • March 07, 2016
  • Like
  • 0
I have a requirement to capture the approval process comments on a custom field we just have one step for approval process. Can some one guide me to achieve the same.
  • December 29, 2016
  • Like
  • 0
Hi All,

         Can you please guide me in the scenario below.

I have a multipicklist field where one option is other. If I select the other option(in multipicklist) then a text box should open below to enter what that other is. Can some one guide me on this
  • November 30, 2015
  • Like
  • 0
Hi All I have a futre class and I have written a test class for the same which is passing but the parent class is just not covering any percent. Can some one hellp. Below is class and the test class.

Class
global class ABfutureclass {
   
  
    @future
    public static void createABdetails(){
          string timePSetName=Label.Time;
       PermissionSet timePSet =[SELECT Id,IsOwnedByProfile,Label FROM PermissionSet where Name=:timePSetName limit 1];
        Id myID2 = userinfo.getUserId();
        string permissionsetid = timePSet.id; 
        List<PermissionSetAssignment> lstPsa = [select id from PermissionsetAssignment where PermissionSetId =: permissionsetid AND AssigneeId =:myID2];
    
        if(lstPsa.size() == 0)
        {
            PermissionSetAssignment psa1 = new PermissionsetAssignment(PermissionSetId= permissionsetid, AssigneeId = myID2 );
            database.insert(psa1);
        }
    }

}



Test Class

@isTest
public class ABfutureclasstest {
    
    public static testMethod void createABdetails(){
        test.startTest();
        Profile Profile1 = [SELECT Id, Name FROM Profile WHERE Name = 'Basic Profile'];
       
     
      User u = [SELECT Id FROM User WHERE ProfileId =:Profile1.Id AND isActive = true LIMIT 1];
        PermissionSet ps = [SELECT Id FROM PermissionSet WHERE Name =: Label.Time];
        system.runAs(u){
   PermissionSetAssignment psa = new PermissionSetAssignment();
        psa.AssigneeId = u.Id;
        psa.PermissionSetId = ps.Id;
        insert psa;
        }
        test.stopTest();
    }

}
  • November 19, 2015
  • Like
  • 0
Hi All,

         Below is my Batch class. Is that always we require to pull complete records in databse in query field or can we filter using where condition. If we can filter can some one help me on this as I am getting errors

global class batchContactAccountNameUpdate implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) {
       String query = 'SELECT Id, AccountId,Type__C  FROM Contact where Type__c=:Asian Entities';
        return Database.getQueryLocator(query);
    }
   
    global void execute(Database.BatchableContext BC, List<Contact> scope) {
         for(Contact c : scope)
             
         {
             if(c.AccountId==null){
             
             c.AccountId = '0011900000BiZzn';            
         }
         }
         update scope;
    }   
    
    global void finish(Database.BatchableContext BC) {
    }
}
  • October 28, 2015
  • Like
  • 0
Hi All,

         Below is my Batch class. Is that always we require to pull complete records in databse in query field or can we filter using where condition. If we can filter can some one help me on this.

global class batchContactAccountNameUpdate implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) {
        String query = 'SELECT Id, AccountId  FROM Contact ';
        return Database.getQueryLocator(query);
    }
   
    global void execute(Database.BatchableContext BC, List<Contact> scope) {
         for(Contact c : scope)
             
         {
             if(c.AccountId==null){
             
             c.AccountId = '0011900000BiZzn';            
         }
         }
         update scope;
    }   
    
    global void finish(Database.BatchableContext BC) {
    }
}
  • October 22, 2015
  • Like
  • 0
Hi All,

          Two of my test classes are passing without any issues but the code coverage on the respective classes is 0% . Can anyone let me know what the possible issue might have been?
  • October 21, 2015
  • Like
  • 0
Hi All,

         Can you please guide me in the scenario below.

I have a multipicklist field where one option is other. If I select the other option(in multipicklist) then a text box should open below to enter what that other is. Can some one guide me on this
  • November 30, 2015
  • Like
  • 0
Hi All I have a futre class and I have written a test class for the same which is passing but the parent class is just not covering any percent. Can some one hellp. Below is class and the test class.

Class
global class ABfutureclass {
   
  
    @future
    public static void createABdetails(){
          string timePSetName=Label.Time;
       PermissionSet timePSet =[SELECT Id,IsOwnedByProfile,Label FROM PermissionSet where Name=:timePSetName limit 1];
        Id myID2 = userinfo.getUserId();
        string permissionsetid = timePSet.id; 
        List<PermissionSetAssignment> lstPsa = [select id from PermissionsetAssignment where PermissionSetId =: permissionsetid AND AssigneeId =:myID2];
    
        if(lstPsa.size() == 0)
        {
            PermissionSetAssignment psa1 = new PermissionsetAssignment(PermissionSetId= permissionsetid, AssigneeId = myID2 );
            database.insert(psa1);
        }
    }

}



Test Class

@isTest
public class ABfutureclasstest {
    
    public static testMethod void createABdetails(){
        test.startTest();
        Profile Profile1 = [SELECT Id, Name FROM Profile WHERE Name = 'Basic Profile'];
       
     
      User u = [SELECT Id FROM User WHERE ProfileId =:Profile1.Id AND isActive = true LIMIT 1];
        PermissionSet ps = [SELECT Id FROM PermissionSet WHERE Name =: Label.Time];
        system.runAs(u){
   PermissionSetAssignment psa = new PermissionSetAssignment();
        psa.AssigneeId = u.Id;
        psa.PermissionSetId = ps.Id;
        insert psa;
        }
        test.stopTest();
    }

}
  • November 19, 2015
  • Like
  • 0
Hi All,

         Below is my Batch class. Is that always we require to pull complete records in databse in query field or can we filter using where condition. If we can filter can some one help me on this as I am getting errors

global class batchContactAccountNameUpdate implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) {
       String query = 'SELECT Id, AccountId,Type__C  FROM Contact where Type__c=:Asian Entities';
        return Database.getQueryLocator(query);
    }
   
    global void execute(Database.BatchableContext BC, List<Contact> scope) {
         for(Contact c : scope)
             
         {
             if(c.AccountId==null){
             
             c.AccountId = '0011900000BiZzn';            
         }
         }
         update scope;
    }   
    
    global void finish(Database.BatchableContext BC) {
    }
}
  • October 28, 2015
  • Like
  • 0
Hi All,

         Below is my Batch class. Is that always we require to pull complete records in databse in query field or can we filter using where condition. If we can filter can some one help me on this.

global class batchContactAccountNameUpdate implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) {
        String query = 'SELECT Id, AccountId  FROM Contact ';
        return Database.getQueryLocator(query);
    }
   
    global void execute(Database.BatchableContext BC, List<Contact> scope) {
         for(Contact c : scope)
             
         {
             if(c.AccountId==null){
             
             c.AccountId = '0011900000BiZzn';            
         }
         }
         update scope;
    }   
    
    global void finish(Database.BatchableContext BC) {
    }
}
  • October 22, 2015
  • Like
  • 0
Hi All,

          Two of my test classes are passing without any issues but the code coverage on the respective classes is 0% . Can anyone let me know what the possible issue might have been?
  • October 21, 2015
  • Like
  • 0