• Immu
  • NEWBIE
  • 5 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies
trigger NewTrig on Account (before insert) {
for(account a:trigger.new)
{
if(a.Name=='India')
{
a.NumberOfEmployees=10;
}
}
}
  • January 28, 2014
  • Like
  • 0
Hi...
I have 1 class and 1 trigger..Code coverage for class is 70%  and Trigger is 82%...How to calculate overall code coverage
  • January 28, 2014
  • Like
  • 0

Hi

   Iam New to Test Class...Iam struggling to write Test Class to my Trigger..

   

  Can any one write the test class for below Trigger...

 

  

trigger ownershipTrigger on Account (before update) {
Map<Id,Account> mp=new Map<Id,Account>();
mp=trigger.oldMap;
for(account a:trigger.new)
{
Account al=new Account();
al=mp.get(a.Id);
if(a.Ownership!=al.Ownership)
{
a.ownership.adderror('You Cannot Change this Ownership');
}
}
}

 

Any help would be greatly appreciated..

  • November 20, 2013
  • Like
  • 0

Hi

Iam new to test class...Iam struggling to write test class to my trigger...

 

Here is my Trigger

trigger ownershipTrigger on Account (before update) {
Map<Id,Account> mp=new Map<Id,Account>();
mp=trigger.oldMap;
for(account a:trigger.new)
{
Account al=new Account();
al=mp.get(a.Id);
if(a.Ownership!=al.Ownership)
{
a.ownership.adderror('You Cannot Change this Ownership');
}
}
}

 

Any help would be greatly appreciated!!! 

  • November 20, 2013
  • Like
  • 0
I am to copy one text field from child to parent object.but I am getting one error.Please help.

Trigger

trigger EmployeeMaster  on SP_Master__c (after insert,after update) 
{
    
    Set<id> EmployeeRecords  = new Set<ID>();
    
    for(SP_Master__c sp : trigger.new)
    {
        if( sp.Active__c == true && sp.License_Type__c == 'LI')
        {
            EmployeeRecords.add(sp.Employee_Code__c);
        }
    }
    
    list<Employee_Master__c> EmpMaster = [select id,Name,SP__c,LI_License_No__c from Employee_Master__c where id IN :EmployeeRecords and SP__c = false ];
    
    for( Employee_Master__c empM : EmpMaster )
        
      
    {
        empM.SP__c = true;
        empM.LI_License_No__c=sp.License_Number__c;
        
    }
     
    if(EmpMaster.size()>0)
    {
        update EmpMaster;
    }
}

Error

Error: Compile Error: Variable does not exist: sp.License_Number__c at line 21 column 31
Hi All,
I have a custom object "RegInfo" in which "To be delete" is a custom field with data type checkbox. If this checkbox field is checked in the record under the RegInfo object then that record will be deleted. And if the checkbox field is unchecked then that record is not deleted.For this I need to write a apex class and test class.
Thanks in advance.

Hi

Iam new to test class...Iam struggling to write test class to my trigger...

 

Here is my Trigger

trigger ownershipTrigger on Account (before update) {
Map<Id,Account> mp=new Map<Id,Account>();
mp=trigger.oldMap;
for(account a:trigger.new)
{
Account al=new Account();
al=mp.get(a.Id);
if(a.Ownership!=al.Ownership)
{
a.ownership.adderror('You Cannot Change this Ownership');
}
}
}

 

Any help would be greatly appreciated!!! 

  • November 20, 2013
  • Like
  • 0

Hi,

       I have one application and in that I  have to capture the image through webcam and then have to save that image in he record.How can I do this?Please I need urgent help.

 

thx.

Hi, Can any one post the code for uploading the image and displayin it in the same page or different page

 

  • October 28, 2013
  • Like
  • 0