• Prashant Pandey07
  • SMARTIE
  • 550 Points
  • Member since 2015
  • Salesforce Developer

  • Chatter
    Feed
  • 13
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 127
    Replies
Hello All,
Schrren shot for reference
I am working on opportunity and I have a custom button on opportunity as GoToTask. There is custom field on the opportnuity called Test which is a picklist field. It have two values : 1-Ok and 2- Not Ok . If Test field has value as OK then once I click on GoToTask button it should take me to opportunity's NEW TASK creation activity. If Test field has value as NOT OK then there should be a message saying "You can not goto Task". Pls help me to achieve this. I think this can be done thrugh JavaScript but I am not sure how to achieve this.

Thanks.
Hi, 

  Please suggest me a logic to update quotelines from quote. When quote is inserted or updated. 

Thanks
Sudhir
Hi ,
Currently,I am working on below scenario.When check box in quote line Item object is checked ,corresponding check box in opportunity should be checked. Can anyone please post the  trigger code for this scenario

Hi Everyone,

I've created a simpletrigger that creates a new record of custom object: Hosted_PBX_Deployment__c when a new Opportunity is created.
Now I need to set a value to a fiield: Rack_4_19_two_post_Qty__c in custom object that depends on a value of an Account field: All_Network_Devices_Qty__c
so if Account.All_Network_Devices_Qty__c <=11 then Rack_4_19_two_post_Qty__c =1 

what is the best way to reffer to an Account field from Hosted_PBX_Deployment__c trigger?

this is my trigger:

trigger AutoCreateHPBXdeployment on Opportunity (after insert) {


List<Hosted_PBX_Deployment__c> newHPBX = new List<Hosted_PBX_Deployment__c>();
  for (Opportunity opp : Trigger.new) {
      if(opp.Hosted_PBX__c=='Yes'){
    Hosted_PBX_Deployment__c hpbx = new Hosted_PBX_Deployment__c();
    hpbx.Opportunity__c  = opp.Id;
    hpbx.Opportunity_Account__c = opp.AccountId;
   
 
    newHPBX.add(hpbx);
      }
  }
  insert newHPBX;

}

Thank you!

There are two inputText Mobile and Email.
When i fill only Mobile inputText one popup message should be display and if i fill only email inputText another popup messege should display.
I have a visualforce page that I used to override the 'New Opportunity' button on the Opportunity related list on the Account. To make this usable in Lightning, should I create a lightning component? Or is there a way to use the Visualforce page that I already have written? 

Any advice is greatly appreciated. 

Thanks, 
Tasia

I am using the following trigger which should look at the case being created, make it a default admin user for the time being (for permissions), look only for WEB based bases to change the user ( which i think isn't working right either) and then add everyone with a checkbox on their contact as a case team member. However I get an error but ONLY when adding a case from our community. What about those users would mess this up?

 

trigger CaseTeamAddition on Case (after insert) {
 
  if (Trigger.isAfter){
                If (Trigger.isInsert){
                                CaseTeamRole caseTeamRole = [SELECT Id 
                                                            FROM CaseTeamRole 
                                                            WHERE Name = 'Case Update Team'
                                                            LIMIT 1];
 
                                List<Id> accountIdList = new List<Id>();
                          List<Id> caseIdList = new List<Id>();
                                For (Case currentCase : Trigger.new){
                                     accountIdList.add(currentCase.AccountId);
                                    caseIdList.add(currentCase.Id);
                                }
                          
                          User dbUser = [SELECT Id
                                                    FROM User
                                                    WHERE Alias = 'dblevins'
                                                    LIMIT 1];
                          
                          List<Case> caseList = [SELECT Id, OwnerId
                                                      FROM Case
                                                      WHERE Id IN :caseIdList
                                                      AND Type = 'Web'];
                          
                                for (Case curCase : caseList){
                                    curCase.OwnerId = dbUser.Id;
                                }
                          
                          update caseList;
                                
                                List<Contact> contactList = [SELECT Id, AccountId
                                                             FROM Contact
                                                             WHERE AccountId IN : accountIdList
                                                             AND Get_Email_Updates__c = true];
                                
                                List<CaseTeamMember> caseMembersToInsert = new List<CaseTeamMember>();
                                For (Case currentCase : Trigger.new){
                                  For (Contact currentContact : contactList){
                                     If (currentContact.AccountId == currentCase.AccountId){
                                           CaseTeamMember newMember = new CaseTeamMember(ParentId = currentCase.Id,
                                                                             MemberId = currentContact.Id,
                                                                                         TeamRoleId = caseTeamRole.Id);
                                            caseMembersToInsert.add(newMember);
                                        }
                                   }
                                }

                                if (caseMembersToInsert.size() > 0){
                                  insert caseMembersToInsert;
                                
                                }
                                                               
              }
  }                               

Hi there,

I have two custom objects. The Investigation__c is the parent object, and the Time_Entry_Recap_Report__c is the child object. What I want to have happen is when the parent record (Investigation) is initially created, I want to create an initial entry in the 'Time_Entry_Recap_Report__c' with 15 minutes of time worked and a description of the task being 'Opened new investigation'. I'm trying to figure out how to relate the Child record to the parent record when I create the entry in the trigger. The object 'Time_Entry_Recap_Report__c' is already defined as a child to the parent, but trying to insert the record without a reference to the 'Investigation_Time_Entry__c' field within the 'Time_Entry_Recap_Report__c' object didn't work either. The Error I am getting is "Error: Compile Error: Illegal assignment from Schema.SObjectField to Id at line 8 column 7. Any assistance would be greatly appreicated. 
trigger CreateTimeEntry on Investigation__c (after insert) {
    List<Time_Entry_Recap_Report__c> entryList = new List<Time_Entry_Recap_Report__c>();
    for(Investigation__c InvestigationObj : Trigger.new){
    Time_Entry_Recap_Report__c entry = new Time_Entry_Recap_Report__c();
      entry.Hours_Worked__c = '00';
      entry.Minutes_Worked__c = '15';
      entry.Work_Performed__c = 'Opened new investigation';
      entry.Investigation_Time_Entry__c = Investigation__c.NAME;
      entryList.add(entry);
     }
     if(entryList.size()>0){
      upsert entryList;
     }
}

 

how to achive this requirment? can anybody pls help.. 

Account: location(pick list custom field),if location is delhi add user_X as accountTeam member, bnglr add  user_Y as accountTeam member, 
chennai add user_Z as accountTeam member
other add K as accountTeam member...
Apex: 
<apex:page controller="allObjectListClass">
    <apex:pageBlock>
        <apex:form id = "myForm">
            
            <apex:pageBlockSection>
                <apex:selectList id="objList" value="{!selectedObj}" size="1">
                    <apex:selectOptions value="{!objName}"/>
                    <apex:actionSupport event="onchange" reRender="myForm"/>
                </apex:selectList>  
            </apex:pageBlockSection>
            
            <apex:pageBlockSection>
                <apex:pageblockTable value="{!fieldName}" var="f">
                    <apex:column value="{!f}"/>
                </apex:pageblockTable>
            </apex:pageBlockSection>
            
        </apex:form>        
    </apex:pageBlock>    
</apex:page>
Controller :
public class allObjectListClass {
    public String selectedObj {get;set;}
    
    public static List<selectOption> getObjName(){
        List<selectOption> options = new List<selectOption>();
        
        for ( Schema.SObjectType o : Schema.getGlobalDescribe().values() )
        {
            Schema.DescribeSObjectResult objResult = o.getDescribe();           
            system.debug( 'Sobject API Name: ' + objResult.getName() +' Sobject Label Name: ' + objResult.getLabel());           
            options.add(new SelectOption(objResult.getName(),objResult.getLabel()));
        }
        return options;
    }
    
    public static List<String> getFieldName(){
        List<String> reqFields = new List<String>();
        /*
			Required Code 
		*/
        return reqFields;
    }
}
I am getting a hard time dealing with schema methods, i have gone through the Salesforce documentation though.
Thanks in advance...


 

Hi,

I've got a lightning component that is being used in a Community.
This is meant to be a public facing community/component, where anonymous users essentially fill out a form.

Part of the flow includes uploading files.
Currently the files are being uploaded using <lightning:fileUpload/> and are being associated with an Account object.

When used by a person who already has a logged in session (such as through the builder) it works fine. However a guest user isn't able to upload files.

Is there any way to set the auto generated guest user or guest profile to be able to upload files?
I've tried doing some research on this already, and it seems like its more pointing towards no, but I was hoping if anyone else could provide insight.

Thanks,
Scott

Hi, 

I'm tyring to create a big object in my production environment. I'm able to deploy it in a sandbox, but I run into an error in production. 

When depoloying the package through workbench I get the following error message on my permission set.
changed: false
componentType: PermissionSet
created: false
createdDate: 2018-05-21T14:05:59.000Z
deleted: false
fileName: big_object/permissionsets/IER_History.permissionset
fullName: IER_History
problem: An unexpected error occurred. Please include this ErrorId if you contact support: 333237467-13525 (-1807790659)
problemType: Error
success: false
Permission set xml: 
 
<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
   <fieldPermissions>
      <field>CampaignMemberId__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Clicked__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Contact__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Contact_ID__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>DateBounced__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>DateOpened__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>DateSent__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>DateUnsubscribed__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Email__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Email_Asset_ID__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Email_ID__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>FromAddress__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>FromName__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>HardBounce__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Lead__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Lead_ID__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>NumberOfUniqueClicks__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>MergeId__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>NumberOfTotalClicks__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Opened__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>SendDefinition__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>SoftBounce__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>SubjectLine__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>Tracking_As_Of__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <fieldPermissions>
      <field>TriggeredSendDefinitionName__c</field>
      <readable>TRUE</readable>
      <editable>TRUE</editable>
   </fieldPermissions>
   <label>IER History Permission Set</label>
</PermissionSet>

 

Hi  All,
I have created  picklist field with options(1,2,3,4) and url field in opportunity object..........
my requirment is when i choose 2 and 3 values in picklist the url field should be shown  and when i choose 1 or 4 values the url field must be disabled or not shown...........
How can i achieve these can anyone help me...................................

Thanks Inadvance..................

Hi,

When i through my debug log, i can see the different heap allocates for the same type of varibales, it might be because of the data variables holds but i would like to know in detail how heap allocation works and the heap allocation for different type of variables.

Hi everyone,
I want to create a picklist on a visualforce page , And the values of picklist should be values in a List.
Eg. I have a list called "CCO_producttype". And now on the VF page i want to display Values(CCO_producttype) in a dropdown format.
How would i approach. Any suggestion on this would be highly appriciated.
Hello All,
Schrren shot for reference
I am working on opportunity and I have a custom button on opportunity as GoToTask. There is custom field on the opportnuity called Test which is a picklist field. It have two values : 1-Ok and 2- Not Ok . If Test field has value as OK then once I click on GoToTask button it should take me to opportunity's NEW TASK creation activity. If Test field has value as NOT OK then there should be a message saying "You can not goto Task". Pls help me to achieve this. I think this can be done thrugh JavaScript but I am not sure how to achieve this.

Thanks.
Hi ,

I would like to convert the below trigger to apex class , let me know how to do it. Currently, the trigger fires when an Opportunity is created on custom object A (company Summary), it create Opportunity Contact Roles relating the newly created opportunity to all the contacts related with the object A (company summary). 
 
trigger createOpportunityContactRoles on Opportunity (after insert) {

    Set<Id> CompanySummaryIds = new Set<Id>();
    List<OpportunityContactRole> ocrList = new List<OpportunityContactRole>();
    Map<Id, List<Contact>> CompanySummaryContacts = new Map<Id, List<Contact>>();
    
    for(Opportunity o: Trigger.New) {
        if(o.aduro__Company_Summary__c != Null) 
            CompanySummaryIds.add(o.aduro__Company_Summary__c);
    }
    
    for(Contact con: [select id, aduro__Company__c from Contact 
                    where aduro__Company__c in: CompanySummaryIds]) {
        if(!CompanySummaryContacts.containsKey(con.aduro__Company__c)) 
            CompanySummaryContacts.put(con.aduro__Company__c, new List<Contact>());
        CompanySummaryContacts.get(con.Aduro__Company__c).add(con);
    }
    
    for(Opportunity opp: Trigger.New) {
        if(CompanySummaryContacts.containskey(opp.aduro__Company_Summary__c) 
            && CompanySummaryContacts.get(opp.aduro__Company_Summary__c) != NULL) {
            Boolean isFirstContact = true;
            for(Contact c: CompanySummaryContacts.get(opp.aduro__Company_Summary__c)) {
                OpportunityContactRole ocr = new OpportunityContactRole(ContactId = c.Id, 
                                                                        OpportunityId = opp.id,
                                                                        Role = 'Investor: Influencer');
                if(isFirstContact) {
                    ocr.IsPrimary = true;
                    isFirstContact = false;
                }
                ocrList.add(ocr);
            }
        }           
    }
    
    if(ocrList.size() > 0)
        insert ocrList;
}

 
  • May 07, 2018
  • Like
  • 0
I want to create 3 queues and want to assign cases on the basis of queue size like if Queue 1 is full then I want to assign the task in Queue 2 like this.
Hi Everyone,

Could please provide me example for avoiding recursive trigger using teh future annotated method.
<apex:page standardController="CPL_Protocols__c" renderAs="pdf" applyBodyTag="false" docType="html-5.0" standardStylesheets="false" applyHtmlTag="false" extensions="PrintPageController" showHeader="false">
    
    <apex:form >
        <apex:pageBlock title="CPL Request Information Detail">  
            <br></br>
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left" >
            <apex:pageBlockSection title="Status" columns="1">
                
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.OwnerId}"/></table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Protocol_Number__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Approval_Step_Status__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Status_Date_Time_Stamp__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Protocol_Status__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labels_Due_Date__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Number_of_Labels_to_Printed__c}"/> </table> 
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Contact__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.user_email__c}"/>  </table>
            </apex:pageBlockSection>
        </table>
    </apex:pageBlock>
    
    <apex:pageblock >
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left" >
            <apex:pageBlockSection title="Study Information" columns="2" >
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Name}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Number_of_Study_Sites__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Type__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Treatment_Period__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Country__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Phase__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Protocol_Description__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.No_of_Treatment_Grp__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Enrollment_Period__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Duration__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Dosing_Regimen__c}"/>  
            </apex:pageBlockSection>
        </table>
    </apex:pageblock>
    
    
    <apex:pageblock >
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left" >
            <apex:pageBlockSection title="Product Information" columns="2">
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Primary_Packaging__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Secondary_Packaging__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Label_Information__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labeling_Lot_Number__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Storage_Requirements__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Max_Exposure_Time__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Label_Expiration_Date__c}"/>   
            </apex:pageBlockSection>
        </table>
    </apex:pageblock>
    
    <apex:pageblock >
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left">
            <apex:pageBlockSection title="Packaging/Labeling Operation" columns="2" >
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Packaging_Site__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labeling_Site__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Quantity_Required__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Sampling_Requirements__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.CreatedById}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labeling_Package_Instructions__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Calculated_Qty_to_be_Prepared__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Randomization__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Randomization_File_Acknowledgement__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.LastModifiedById}"/>   
            </apex:pageBlockSection>
        </table>
    </apex:pageblock>
    
</apex:form>

<apex:relatedList list="Parts__r" /> <br></br>
<apex:relatedList subject="{!CPL_Protocols__c}" list="Histories" /> 
<apex:relatedList subject="{!CPL_Protocols__c}" list="ProcessSteps" /> 

<apex:relatedList subject="{!CPL_Protocols__c}" list="ActivityHistories" /> 
<apex:relatedList subject="{!CPL_Protocols__c}" list="OpenActivities" /> 
<apex:relatedList subject="{!CPL_Protocols__c}" list="AttachedContentDocuments" />

</apex:page>

 
Hi there,

I have two custom objects. The Investigation__c is the parent object, and the Time_Entry_Recap_Report__c is the child object. What I want to have happen is when the parent record (Investigation) is initially created, I want to create an initial entry in the 'Time_Entry_Recap_Report__c' with 15 minutes of time worked and a description of the task being 'Opened new investigation'. I'm trying to figure out how to relate the Child record to the parent record when I create the entry in the trigger. The object 'Time_Entry_Recap_Report__c' is already defined as a child to the parent, but trying to insert the record without a reference to the 'Investigation_Time_Entry__c' field within the 'Time_Entry_Recap_Report__c' object didn't work either. The Error I am getting is "Error: Compile Error: Illegal assignment from Schema.SObjectField to Id at line 8 column 7. Any assistance would be greatly appreicated. 
trigger CreateTimeEntry on Investigation__c (after insert) {
    List<Time_Entry_Recap_Report__c> entryList = new List<Time_Entry_Recap_Report__c>();
    for(Investigation__c InvestigationObj : Trigger.new){
    Time_Entry_Recap_Report__c entry = new Time_Entry_Recap_Report__c();
      entry.Hours_Worked__c = '00';
      entry.Minutes_Worked__c = '15';
      entry.Work_Performed__c = 'Opened new investigation';
      entry.Investigation_Time_Entry__c = Investigation__c.NAME;
      entryList.add(entry);
     }
     if(entryList.size()>0){
      upsert entryList;
     }
}