• Bhushan Singh 13
  • NEWBIE
  • 60 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 18
    Replies
Hi ,

I am using Force.com migration tool , I have been created Apex class and Test class, in Force.com IDE test coverage is showing 100%  but while deploying its failling and throwing the error 0% code coverage. Please help me if any one has idea about that.

Thanks & Regards
Bhushan Singh
Hi ,

I have written one trigger when account record update that time related contact record also should be update . while i am updating account then i am getting error -
" Error:
TriggerTesting: execution of AfterUpdate caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Contact.AccountId Trigger.TriggerTesting: line 20, column 1"

Trigger - 

trigger TriggerTesting on Account (after update) {

   Map<Id, Account> accountWithDes = new Map<Id, Account>();

    
    for(integer i=0; i<Trigger.new.size(); i++)
    {
         if(Trigger.new[i].Description !=Trigger.old[i].Description )
         {
             accountWithDes.put(Trigger.old[i].id, Trigger.New[i]);
         }
    }
       System.debug('Account Object '+accountWithDes);
    
    List<Contact> updateContact = new List<Contact>();
    List<Contact> contacts = [select id, Description from Contact where accountId in : accountWithDes.keySet()];
    System.debug('Contact Object '+contacts);
    for(Contact c : contacts )  
    {
      Account ac = accountWithDes.get(c.accountId);
      c.Description  = ac.Description;
       updateContact.add(c);
      
    }  
   
   update updateContact;
    
}


Please help me , I am new in salesforce.

Thanks & Regards
Bhushan 

 
HI ,

I have genrated one Partner WSDL and trying to genrate Apex code from that WSDL into another user salesforce, but i am getting error
 Apex Generation Failed
"Unsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType"
Please help me , I am new in salesforce.

Thanks & Regards
Bhushan Singh 
 
Hi,

I want to add custom button beside of new contact button in Contact section inside detail page of account, I am abble to add custom button inside to detail page but i want add that same custom button section of Contact. Pelase hepl me.

Thanks &  Regards
Bhushan Singh
Hi,
where we use SOAP web service and where we should use REST web service while integrating salesforce , there is any specific area to use SOAP and REST please help me.

Thanks & Regards
Bhushan Singh 
Hi,
Is it mandatory to 75% code coverage for deploy trigger.   
i am new in salesforce please help me.

Thanks & Regars
Bhushan Singh
Hi,
How can we insert record into object from static resource during the loading visualforce page.
e.g. I have one Object and created one visulaforce page, i want to insert the record from any static resource while that Visualforce is loading.
Please help me 

 
Hi,
I have two object and each object contains trigger for recursive execution 
for e.g. Account has field amount and Contact has also field amount, Both has trigger, 
Trigger on Account if amount field will be update that time contact amount field should be update and
Trigger on Contact If amount field of Contact updating that time amount field of Account should be update. SO It is a Recursive trigger, How to prevent this recursive without usin any static boolean variable.
Please help me .
Hi,
I have created one Batch Apex and scheduler class for execute on every 5 minute but this scheduler is not working , please help me 
Batch Apex --

global class BatchApexUpdateDemo implements Database.Batchable<sObject>
{

    global  Database.QueryLocator start(Database.BatchableContext con)
     {
      String query ='select Id, First_Name__c, Company__c , from User__c, Descriptiom__c';
      return Database.getQueryLocator(query);
    
     }
     
     global  void execute(Database.BatchableContext con, List<User__c> scope) {
     
         List<User__c> usrlist = new List<User__c>();
         for(User__c usr : scope )
          {
           usr.Descriptiom__c = usr.First_Name__c+' '+usr.Company__c;
           usrlist.add(usr);
          }
      
           update usrlist;
     }
     
     public void finish(Database.BatchableContext BC) 
     {
     
     
        AsyncApexJob a = [SELECT Id, Status, NumberOfErrors,
        JobItemsProcessed,TotalJobItems, CreatedBy.Email
        FROM AsyncApexJob WHERE Id =:BC.getJobId()];
        String UserEmail = 'bhushansingh226@gmail.com';
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(new String[] {UserEmail});
        mail.setReplyTo('rathore.bhushan22@gmail.com');
        mail.setSenderDisplayName('Batch Processing');
        mail.setSubject('Batch Process Completed');
        mail.setPlainTextBody('Batch Process has completed');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
     }
}

Schedular class ---

global class schduleBatchOfUser implements Schedulable {

   global void execute(SchedulableContext ctx) {
     
     BatchApexUpdateDemo p = new BatchApexUpdateDemo();
      database.executeBatch(p);
      String sch1 = '0 5 * * * ?';
      
      schduleBatchOfUser sch2 = new schduleBatchOfUser();
      system.schedule('Every Hour plus 0 min', sch1, sch2);

      
   }   
}
Hi,
while embedded VF page with custom object page layout that time VF fields are  not showing, in visulaforce page all fields are showing and i am able to save value also but after add that VF page in custom object page layout all fields are hidding. 
Please help me

Thanks & Regards
Bhushan Singh
Hi, 
I am new in salesforce i have question -
I have some field in object  for one field want to show in the creation of record after that field should not visible,
for eg - I object has 3 field name,address, phone so while  creating record that phone field should be visible after that it should not visible neither view nor edit  page, how to achive this please explain me.
Thanks
Hi,
If i have 10 classes  9 classes has 75 % code coverage , 1 class  has no code coverage ,while  deploy  all the classes will be deploy or not , or only 9 classes will deploy 1 class will fail.
please answer my question.
 
Hi ,

I am using Force.com migration tool , I have been created Apex class and Test class, in Force.com IDE test coverage is showing 100%  but while deploying its failling and throwing the error 0% code coverage. Please help me if any one has idea about that.

Thanks & Regards
Bhushan Singh
Hi ,

I have written one trigger when account record update that time related contact record also should be update . while i am updating account then i am getting error -
" Error:
TriggerTesting: execution of AfterUpdate caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Contact.AccountId Trigger.TriggerTesting: line 20, column 1"

Trigger - 

trigger TriggerTesting on Account (after update) {

   Map<Id, Account> accountWithDes = new Map<Id, Account>();

    
    for(integer i=0; i<Trigger.new.size(); i++)
    {
         if(Trigger.new[i].Description !=Trigger.old[i].Description )
         {
             accountWithDes.put(Trigger.old[i].id, Trigger.New[i]);
         }
    }
       System.debug('Account Object '+accountWithDes);
    
    List<Contact> updateContact = new List<Contact>();
    List<Contact> contacts = [select id, Description from Contact where accountId in : accountWithDes.keySet()];
    System.debug('Contact Object '+contacts);
    for(Contact c : contacts )  
    {
      Account ac = accountWithDes.get(c.accountId);
      c.Description  = ac.Description;
       updateContact.add(c);
      
    }  
   
   update updateContact;
    
}


Please help me , I am new in salesforce.

Thanks & Regards
Bhushan 

 
HI ,

I have genrated one Partner WSDL and trying to genrate Apex code from that WSDL into another user salesforce, but i am getting error
 Apex Generation Failed
"Unsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType"
Please help me , I am new in salesforce.

Thanks & Regards
Bhushan Singh 
 
Hi,
Is it mandatory to 75% code coverage for deploy trigger.   
i am new in salesforce please help me.

Thanks & Regars
Bhushan Singh
Hi,
I have two object and each object contains trigger for recursive execution 
for e.g. Account has field amount and Contact has also field amount, Both has trigger, 
Trigger on Account if amount field will be update that time contact amount field should be update and
Trigger on Contact If amount field of Contact updating that time amount field of Account should be update. SO It is a Recursive trigger, How to prevent this recursive without usin any static boolean variable.
Please help me .
Hi,
I have created one Batch Apex and scheduler class for execute on every 5 minute but this scheduler is not working , please help me 
Batch Apex --

global class BatchApexUpdateDemo implements Database.Batchable<sObject>
{

    global  Database.QueryLocator start(Database.BatchableContext con)
     {
      String query ='select Id, First_Name__c, Company__c , from User__c, Descriptiom__c';
      return Database.getQueryLocator(query);
    
     }
     
     global  void execute(Database.BatchableContext con, List<User__c> scope) {
     
         List<User__c> usrlist = new List<User__c>();
         for(User__c usr : scope )
          {
           usr.Descriptiom__c = usr.First_Name__c+' '+usr.Company__c;
           usrlist.add(usr);
          }
      
           update usrlist;
     }
     
     public void finish(Database.BatchableContext BC) 
     {
     
     
        AsyncApexJob a = [SELECT Id, Status, NumberOfErrors,
        JobItemsProcessed,TotalJobItems, CreatedBy.Email
        FROM AsyncApexJob WHERE Id =:BC.getJobId()];
        String UserEmail = 'bhushansingh226@gmail.com';
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(new String[] {UserEmail});
        mail.setReplyTo('rathore.bhushan22@gmail.com');
        mail.setSenderDisplayName('Batch Processing');
        mail.setSubject('Batch Process Completed');
        mail.setPlainTextBody('Batch Process has completed');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
     }
}

Schedular class ---

global class schduleBatchOfUser implements Schedulable {

   global void execute(SchedulableContext ctx) {
     
     BatchApexUpdateDemo p = new BatchApexUpdateDemo();
      database.executeBatch(p);
      String sch1 = '0 5 * * * ?';
      
      schduleBatchOfUser sch2 = new schduleBatchOfUser();
      system.schedule('Every Hour plus 0 min', sch1, sch2);

      
   }   
}
Hi,
while embedded VF page with custom object page layout that time VF fields are  not showing, in visulaforce page all fields are showing and i am able to save value also but after add that VF page in custom object page layout all fields are hidding. 
Please help me

Thanks & Regards
Bhushan Singh
Hi, 
I am new in salesforce i have question -
I have some field in object  for one field want to show in the creation of record after that field should not visible,
for eg - I object has 3 field name,address, phone so while  creating record that phone field should be visible after that it should not visible neither view nor edit  page, how to achive this please explain me.
Thanks