• rathore_1987
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies

Actully i want to create a trigger in SFDC which will update or Insert the recordes in custom object so i just want the query to update n Insert.if some one can help ?

Actully i want to create a trigger in SFDC which will update or Insert the recordes in custom object so i just want the query to update n Insert.if some one can help ?

How to open a tab in a same window using javascript

Hi

 

Could any help me that how to hide the Edit || Create New View for particular profile when we click any tab of an object.I already disable the 'Manage Public List Views' in  Administrative Permissions.

 

Plz help it's Urgent
.

 

Regards,

Rajesh

Actully i want to create a trigger in SFDC which will update or Insert the recordes in custom object so i just want the query to update n Insert.if some one can help ?

Actully i want to create a trigger in SFDC which will update or Insert the recordes in custom object so i just want the query to update n Insert.if some one can help ?

Hi All,

 

I have the following trigger

 

trigger upsertmanagername on RMG_Employee_Allocation__c (after update)
{
   List<RMG_Employee_Master__c> opps = new List<RMG_Employee_Master__c>();
   List<ID> masterIds = new List<ID>();
   Map<ID, String> childDetailMap = new Map<ID, String>();
  
   for(RMG_Employee_Allocation__c c: Trigger.new)
    {
      masterIds.add(c.RMG_Employee_Code__c);
      childDetailMap.put(c.RMG_Employee_Code__c, (c.Manager_Name__c));
    }
 
   opps = [select id, Current_Manager__c from RMG_Employee_Master__c where id in :masterIds];
  
   for(RMG_Employee_Master__c rem: opps)
    {
      rem.Current_Manager__c = childDetailMap.get(rem.id);
      Update rem;
    }
  
   if(opps.size() > 0)
      Update opps;
}

 

 

And i have the following Apex Test class that has 100 % code covered in sandbox. But when i try deploying it to production i get an error: "Code coverage is 0% atleast 1% code coverage is required"

 

@isTest
private class Testupsertmanagername
{

   static testMethod void testTrigger()
   {
   RMG_Employee_Master__c rmg = new RMG_Employee_Master__c(Name='Test');
      insert rmg;
     
      RMG_Employee_Allocation__c rmgallo = new RMG_Employee_Allocation__c(
                                     Name='Test', Manager_Name__c='Unit Test',
                                     RMG_Employee_Code__c=rmg.id);
      insert rmgallo;
      update rmgallo;
     
      RMG_Employee_Master__c newrmg=[select Name, Current_Manager__c from RMG_Employee_Master__c where id = :rmgallo.id];
      System.assertEquals('Unit Test', newrmg.Current_Manager__c);
      }
      }

 

 

Please help

 

  • January 25, 2011
  • Like
  • 0

This error doesn't make any sense. The only way that I can include a custom field in the

object's searchResultsField is thru the SFC interface from the object. ( at least as far as

i know...)

 

The field that SFC is referencing in my deploy error message is in the list of fields available

to add to to search results. How else could I have added it?

 

I double checked the object. The field is there. It's not a case of where I added a field,

modified the searchResults and then deleted the field.

 

 

Any thoughts on this error would be appreciated. I received five other errors just like this

one on other custom objects I was trying to deploy to production.