• Kai Herng Lau
  • NEWBIE
  • 185 Points
  • Member since 2015
  • WDCi group

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 59
    Replies

My redirect button is not working.  Not sure why or where I'm missing the code.  Can anyone help?  The goal is when it updates I want it to go to a webpage.

This is my button

<apex:commandButton value="Update" action="{!save}" styleClass="btn pull-right" onclick="$j('#pleaseWaitDialog').modal('show')" oncomplete="$j('#pleaseWaitDialog').modal('hide')"/>
<div class="modal fade" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-body">
                        <h3>Processing...</h3><br/>
                        <div class="progress">
                            <div class="progress-bar progress-bar-striped active" role="progressbar"
                            aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
 

 


This is my APEX
public void save() {
        try {
            if(accountUpdate.Account__c == null) {
                accountUpdate.Account__c = accountId;
            }
            upsert accountUpdate;
            PageReference reRend = new PageReference('GOOGLE.COM');
        reRend.setRedirect(true);
        } catch(Exception e) {
            System.debug('------------- ERROR: ' + e.getStackTraceString());
            System.debug('------------- ERROR: ' + e.getMessage());
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'There was a problem while saving the account information.'));
            return;
        }
    }


Thanks
I have gotten myself turned around on this trigger and can not figure out how to get it right. I have a custom field on the OpportunityLineItem / Opportunity Product that has the Length of Months that the product will be used for called Number_of_Months__c. I need to update the Opportunity in a field called Contract_Length_Months__c with the maximum date of all the products when a customer enters it.

I would appreciate any help in pointing me in the right direction:
 
trigger OpportunityLineItemTrigger on OpportunityLineItem ( after update) {
    List<Id> oppIds = new List<Id>();
    Decimal contractLengthMonths = 0;

    if(trigger.isAfter) {
        for (OpportunityLineItem oli3: trigger.new){
            oppids.add(oli3.opportunityId);
        }//END for (OpportunityLineItem oli3: trigger.new)
        List<OpportunityLineItem> allOLI = [SELECT id, Number_of_Months__c FROM OpportunityLineItem WHERE OpportunityId in: oppids];
        List<Opportunity> oppsToUpdate = [SELECT id, Contract_Length_Months__c FROM Opportunity WHERE id in: oppids];
        if(allOLI.size() > 0){
            for(OpportunityLineItem allOLI2: allOLI){
                if(allOLI2.Number_of_Months__c > contractLengthMonths){
                    contractLengthMonths = allOLI2.Number_of_Months__c;
                }//END if(allOLI2.Number_of_Months__c > contractLengthMonths)
            } //END for(OpportunityLineItem allOLI2: allOLI)
            for(Opportunity oppUpdate: oppsToUpdate){
                oppUpdate.Contract_Length_Months__c = contractLenghtMonths;
            }// END for(Opportunity oppUpdate: oppsToUpdate)
 
        }
    }//if(trigger.isAfter)
}//END OpportunityLineItem Class

At the line:
oppUpdate.Contract_Length_Months__c = contractLenghtMonths;

I get the following error from the Developer Console IDE : "Variable does not exist: contractLenghtMonths"

Thank you in advance for any help.

Robert
Hello I have the following Trigger that is not firing consistently.  When a user creates or updates a Contact and the Primary Checkbox = true the trigger should fire which copies the email address on the Contact to the assocuated Account record. 
All of the Contacts are associated to an Account.
Here is the trigger and test class.  Coverage is 92%.  Trued to use before trigger but casues the Test to fail. 
Trigger:
trigger DealerPrimaryContact on Contact ( after insert, after update) {
Set<Id> DealerAccIdSet=new Set<Id>();

   for(Contact cont:Trigger.new)
   {
     if(cont.AccountId !=null && cont.Primary__c == True )
     {

        DealerAccIdSet.add(cont.AccountId); 
     }
   }

   if(!DealerAccIdSet.isEmpty()){

      List<Account> DealerAccListToUpdate=new List<Account>();

        for(Account acc: [SELECT id,(SELECT id,email FROM Contacts where Primary__c = True ) FROM Account WHERE Partner_Type__c = 'Dealer' And Id IN :DealerAccIdSet] ){

         acc.Primary_Contact_Email_Address__c=acc.Contacts[0].email;

          DealerAccListToUpdate.add(acc);

       }

       if(!DealerAccListToUpdate.isEmpty()){

         try{

            Update DealerAccListToUpdate;

         }Catch(DmlException de ){

           System.debug(de);

         }

       }

   }
}

Test Class:
@isTest (SeeAllData = false)
public class TestDealerPrimaryContact {
    @isTest    
    public static void DealerPrimaryTestClass() 
    {
 
        Account a = new Account();
            a.Name= 'Test Dealer Account';
            a.Type= 'Dealer / Distributor';
            a.Partner_Type__c = 'Dealer';
            a.Tier__c = 'Stocking Dealer';
            a.Status__c = 'Active';     
            a.RecordTypeId = '012j0000000cfvw';
            a.Primary_Contact_Email_Address__c ='';
            insert a;
    
       Contact con = new Contact();
            con.Contact_Types__c= 'Employee';
            con.FirstName= 'Tester';
            con.LastName= 'testy';
            con.Email='test@gmail.com';
            con.Primary__c = false;
            con.Phone = '111-111-2222';  
           con.Primary__c=true;
         
               
        test.startTest(); 
        
       //   insert a;
          insert con;
          con.AccountId= a.Id;
          a.Primary_Contact_Email_Address__c =con.Email  ;
          update con;
          update a;
        test.stopTest();        
       
    }

}

Thanks,
M
from a variable myContact I'm trying to reference a user lookup field ID on that contact's account.  The field name is Inside_Sales_Rep_Lookup__c.

I'm trying myContact.Account.Inside_Sales_Rep_Lookup__c.UserID.

I need help getting this right. 
Hi All,

I have done a simple code however when I am runnung my test class I am getting error. 

Apex code:

public class AccountSaveCont{
    public Account acc{get;set;}
    
    public AccountSaveCont(){
       acc = new Account();
    }
    
    public void save1(){
        insert acc;
    }
}

Vf Page:

<apex:page controller="AccountSaveCont">
    <apex:form >
        <apex:pageBlock title="My Content" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save1}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="My Content Section" columns="2">
                <apex:inputField value="{!acc.name}"/>
                <apex:inputField value="{!acc.site}"/>
                <apex:inputField value="{!acc.type}"/>
                <apex:inputField value="{!acc.accountNumber}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Test Class:

@isTest(seeAllData = true)
public class AccountSaveContTest{

    public static testMethod void AccountInsert(){
    
        Account a = new Account(Name='test', phone = '1234567890');
        a.Name= 'DineshTesting1';
        insert a;
      
      PageReference pr= Page.AccountSave; 
      Test.setCurrentPage(pr);
      
    AccountSaveCont m = new AccountSaveCont();
        m.save1();
    }
}
 
  • November 02, 2017
  • Like
  • 1
Hi,

Recently I have created a post installation script it run fine in my developer console, test class and I'm able to package it. But I will get this error message during installation 

1.  Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

Is anyone some similar problem please help me on this. Thanks
Hi Support,

When I tried to install a managed package and I getting this error message during the installation. The message was too short for me to investigate and I'm don't know to allocate the problem, but I receive the email:

Organization: luana HE Test Org 2 (00D1I000001eFfE)
User: admin admin (0051I000001KUqw)
Package: Luana HE (04tf4000000svoo)
Error Number: 251264962-65043 (-1596047739)

Problem:
1. (Student) field integrity exception
Student: field integrity exception

Please help me to get more info about the error message. thanks
 
trigger AppointmentConfirmdateChangeFormat on Appointments__c (before insert,before update) {
    for(Appointments__c app :trigger.new){
        if(app.Confirmed_Date_of_Appointment__c!=Null){            
            app.Confirmed_DateofAppointment__c = string.valueOf(app.Confirmed_Date_of_Appointment__c);  
        }
        
        if(trigger.isInsert){
            String lastDigit = '';
            List<String> nameFormat = new List<String>();
            List<Appointments__c> appn = [SELECT Id, Name, CreatedDate FROM Appointments__c 
                                          WHERE CreatedDate =THIS_YEAR  ORDER BY CreatedDate DESC LIMIT 1];
            Integer i=0;
            string year=string.valueOf(System.today().year());
            string test= year+'-';
            if(appn.size()>0 && appn[0].Name.contains(test)){
                if(appn[0].Name != Null)
                    nameFormat = String.valueOf(appn[0].Name).Split('-');
                lastDigit = nameFormat[1];
                i = Integer.valueOf(lastDigit);
                system.debug('>>>>>>>>>'+i);
            }  
            for(Appointments__c appoint:Trigger.new){
                
                if(appn.size()>0 && appn[0].Name.contains(test)){
                    if(i>0 && i<9){
                        i +=1;
                        appoint.Name = year+'-'+'0000'+String.ValueOf(i);
                    }
                    else if(i>=9 && i<99){
                        i +=1;
                        appoint.Name = year+'-'+'000'+String.ValueOf(i);
                    }
                    else if(i>=99 && i<999){
                        i +=1;
                        appoint.Name = year+'-'+'00'+String.ValueOf(i);
                    }
                    else if(i>=999 && i<9999){
                        i +=1;
                        appoint.Name = year+'-'+'0'+String.ValueOf(i);
                    }
                    else if(i>=9999){
                        i+=1;
                        appoint.Name = year+'-'+String.ValueOf(i);
                    }
                }
                else{
                    appoint.Name = year+'-'+'00001';
                }
                
                system.debug('appoint.Name----------->'+appoint.Name);    
            }
        }
    }
    
    
}



@isTest
public class AppointmentConfirmdateChangeFormatTest {
    
    @isTest
    public static void testMthd(){
        Id acId = Schema.getGlobalDescribe().get('Account').getDescribe().getRecordTypeInfosByName().get('Non-Accredited Doctors').getRecordTypeId();
        Account acc = new Account();
        acc.RecordTypeId = acId;
        acc.Name = 'Test';
        insert acc;
        
        Id docRecord = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Doctors').getRecordTypeId();
        
        
        Account testAcc3 = new Account();
        testAcc3.RecordTypeId = docRecord;
        testAcc3.LastName = 'Test Account';
        testAcc3.Gender__c = 'Male';
        testAcc3.Nationality__c = 'Singapore';
        insert testAcc3;
        
        Id caseId = Schema.getGlobalDescribe().get('Case').getDescribe().getRecordTypeInfosByName().get('Business Development').getRecordTypeId();
        Case c = new Case();
        c.RecordTypeId = caseId;
        c.AccountId = acc.Id;
        c.Actual_Request_Date__c = System.today();
        c.Origin = 'Phone';
        c.Status = 'Closed';
        insert c;
        
        
        Appointments__c appt = new Appointments__c();
        appt.Name=system.today().year()+'-'+'00099';
        appt.Case_Ref__c = c.Id;
        appt.Doctors__c = testAcc3.id;
        appt.Confirmed_Date_of_Appointment__c = System.now();
        insert appt;
        
        
        Appointments__c appt1 = new Appointments__c();
        appt1.Name=system.today().year()+'-'+'00099';
        appt1.Case_Ref__c = c.Id;
        appt1.Doctors__c = testAcc3.id;
        appt1.Confirmed_Date_of_Appointment__c = System.now();
        insert appt1;
        
        appt.Name=system.today().year()+'-'+'00098';
        update appt;
        
        Appointments__c appt2 = new Appointments__c();
        appt2.Name=system.today().year()+'-'+'00999';
        appt2.Case_Ref__c = c.Id;
        appt2.Doctors__c = testAcc3.id;
        appt2.Confirmed_Date_of_Appointment__c = System.now();
        insert appt2;

        appt2.Name=system.today().year()+'-'+'00998';
        update appt;
                
    }
}
We have deleted email templates and a SOQL query that includes HtmlValue or Body works differently in Summer 18 than Spring 18.

Specifically, doing this in an Anonymous Apex window in Summer 18:
List<EmailTemplate> templates = [SELECT Id, HtmlValue FROM EmailTemplate];
Results in an "Internal Salesforce.com Error".

Running that SOQL in the Query Editor raises a dialog "entity is deleted".

Apex tests that have that SOQL fail with an Internal Salesforce.com Error.

It works fine if I omit HtmlValue, include a where clause that excludes deleted templates, or if I run it in a Spring 18 org.

I don't see a known issue about it - is it an issue for others? Is there a way to exclude all deleted templates in SOQL?

Thanks,
Peter
 
I have a lookup field to Account object on "Application" object with some filter criteria. The fieldname is Congressional_District__c on Application object.

Here is my visualforce code:
<apex:inputField required="true" id="CongressionalRepresentative" value="{!CongressionalDistrict.Congressional_District__c}" />

where CongressionalDistrict is the method name in the apex class.

Here is the method in my apex class:
 public Application__c getCongressionalDistrict()
    {
        return [select Congressional_District__c from Application__c limit 1];
        
    }

This returns me a text field(instead of a lookup) which constantly displays the first value in the lookup field(instead of multiple values in lookup so that user can select a value). Attached is the screenshot:

User-added image

Also if I remove limit 1 at the end and do
return [select Congressional_District__c from Application__c];

it gives me error.

Any help would be appreciated. 
Hi ,  I am new to Developer Console and in an installed package the code automatically assigns a file name to an attachment and then saves it. Staff use this when out in the field to gather and save signatures. The line of code is:
att.name = 'eSignature_dtd_' + Datetime.now().format('MM_dd_yyyy_HH_MM_ss'); 

The full code is as follows:
public class ZVFSignaturePadController {
    public ZVFSignaturePadController(ApexPages.StandardController stdController){
        
    }
    
    @RemoteAction
    public static String uploadSignature(String b64SignData, String id){
        returnData ret = new returnData();
        ret.success = true;
        ret.message = 'Signature uploaded successfully';
        try{
            Blob signature = EncodingUtil.base64Decode(b64SignData);
            Attachment att = new Attachment();
            att.body = signature;
            att.ContentType = 'image/png';
            att.name = 'eSignature_dtd_' + Datetime.now().format('MM_dd_yyyy_HH_MM_ss');
            att.IsPrivate = false;
            att.ParentId = id;
            insert att;
        }catch(Exception e){
            ret.success = false;
            ret.message = e.getMessage();
        }    
        
        return JSON.serialize(ret);
    }
    
    
     private class returnData{
        Boolean success {get;set;}
        String message {get;set;}
    }
}

I want to add the client name at the front of the file name. This is stored in a custom object called Client. The field names are Client First Name and Client Last Name and the API names are Client_First_Name__C and Client_Last_Name__C. These are formula fields that look up the Contact record.

I am not sure how to add the first and last names to this line of code. 
I am doing this in a sandbox at the moment.
Any help appreciated.

Sue
  • March 22, 2018
  • Like
  • 0
Hi Team,
I have created a VF page on opportunity, where user navigates to this page when clicked on a button. After navigating to my VF page based on the criteria of the record, picklist values on Vf page needs to be displayed.

for example:
This is my record criteria and the possible values to that record needs to be displayed in VF page:
Record criteria:
If record type is Full CSLC
stage: SS11 - discontinued
businness line: Products
Amount:>1000000
then in Vf page , it should display only below values for the below mentioned fields:
Status(Picklist ): Alternative offer
reason won/lost (picklist field dependent on status): Price
Price delta(picklist field dependent on reason Won or lost): 0 to 10%
Similarly there are around 200 record based criteria's .
Kindly suggest how can i achieve this.
Thanks..

My redirect button is not working.  Not sure why or where I'm missing the code.  Can anyone help?  The goal is when it updates I want it to go to a webpage.

This is my button

<apex:commandButton value="Update" action="{!save}" styleClass="btn pull-right" onclick="$j('#pleaseWaitDialog').modal('show')" oncomplete="$j('#pleaseWaitDialog').modal('hide')"/>
<div class="modal fade" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-body">
                        <h3>Processing...</h3><br/>
                        <div class="progress">
                            <div class="progress-bar progress-bar-striped active" role="progressbar"
                            aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
 

 


This is my APEX
public void save() {
        try {
            if(accountUpdate.Account__c == null) {
                accountUpdate.Account__c = accountId;
            }
            upsert accountUpdate;
            PageReference reRend = new PageReference('GOOGLE.COM');
        reRend.setRedirect(true);
        } catch(Exception e) {
            System.debug('------------- ERROR: ' + e.getStackTraceString());
            System.debug('------------- ERROR: ' + e.getMessage());
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'There was a problem while saving the account information.'));
            return;
        }
    }


Thanks
We're having an issue here. Here is my code. Everything works fine "after update" but the portion portion where it involves daysBetween calculation is not working "after insert" (API). 
 
trigger LeadReAssigment on Opportunity (after insert, after update) {
    
    // reference to static class to prevent from trigger firing once
        
                
        List<Opportunity> ops= [SELECT Id, StageName, OwnerId, Date_Begun__c, AccountId FROM Opportunity WHERE Id = :Trigger.New[0].Id];
        //list<Opportunity> ops= trigger.new;
        
        integer DaysOld = 0;
        
        for(Opportunity o: ops) {
        
            string OriginalOwnerId = o.OwnerId;
            
            Date StartDate =  System.Today();
            Date EndDate = o.Date_Begun__c;
            DaysOld = EndDate.daysBetween(StartDate);
            
            System.debug('Days Diff:'+DaysOld);
            
            //System.debug(o.StageName+' Records:'+ops.size()+' OWNER ID'+o.OwnerId+' Id: '+ o.Id);
            if(o.StageName == 'Funded'){
                o.OwnerId = 'bbb';
            }else if(o.StageName == 'Rejected'){
                o.OwnerId = 'ccc';
            }else if(o.StageName == 'Closed'){
                o.OwnerId = 'yyy';
            }else if(o.StageName == 'Pending' && DaysOld > 60){
                o.OwnerId = 'xxx';
            }else if(o.StageName == 'Opened' && DaysOld > 60){
                o.OwnerId = 'vvv';
            }
			System.debug('AccountId: '+o.AccountId+' Original Owner'+OriginalOwnerId+' New Owner:'+o.OwnerId);
            if(OriginalOwnerId != o.OwnerId){
                //update Account and Contact
				List<Account> acc= [SELECT Id FROM Account WHERE Id = :o.AccountId];
				for(Account o3: acc) {
					o3.OwnerId = o.OwnerId;
				}
				if(acc.size() > 0){
					update acc;
				}
				List<Contact> cont= [SELECT Id FROM Contact WHERE AccountId = :o.AccountId];
				for(Contact o4: cont) {
					o4.OwnerId = o.OwnerId;
				}
				if(cont.size() > 0){
					update cont;
				}
            }
        }
        
        if(counter > 0){
            System.debug('UPDATE DONE');
            update ops;
        }
    //}
}



 
Hi there,

I have a custom (parent) object that has two child objects related to it. I have also allowed (Notes &) 'Attachements' to be enabled for the (parent) custom object. One of the Child objects tracks 'Time' invovled in the particular entry in the (Parent) custom object. The other child object tracks 'Suspects' who are involved in a particular entry of the (Parent) custom object.The user has requested that when a 'Suspect' is entered into child object which are related to the parent object, that a entry be made into the 'Time' child object. Similarly, they have requested that whenever an 'Attachment' is added to the (Parent) custom object, that  another entry be made into the 'Time' child object.

I've tried both the 'Before Insert' and 'After Insert' type of trigger for the Attachments, and neither one seems to execute.
 
trigger Attachement_After_Add_Del on Attachment (before insert) {
    List<Request_Time_Entry__c> entryList = new List<Request_Time_Entry__c>();
    for(Attachment AttachmentObj : Trigger.new){
    system.debug('The Attachment Trigger fired.');
    Request_Time_Entry__c entry = new Request_Time_Entry__c();
      entry.Hours_Worked__c = '0';
      entry.Minutes_Worked__c = '15';
      string ParentID = AttachmentObj.parentId;
      entry.Work_Description__c = 'Added Suspect';
      entry.Name = ParentID.substring(0, 15);
      entry.Date_Worked__C = system.Today();
      entry.Related_Object__c = ParentID.substring(0, 15);
      entryList.add(entry);
     }
     if(entryList.size()>0){
      insert entryList;
     }
}


trigger Suspect_After_Add on Suspect__c (after insert) {
    List<Request_Time_Entry__c> entryList = new List<Request_Time_Entry__c>();
    for(Suspect__c SuspectObj : Trigger.new){
    system.debug('The Suspect Trigger fired.');
    Request_Time_Entry__c entry = new Request_Time_Entry__c();
      entry.Hours_Worked__c = '0';
      entry.Minutes_Worked__c = '15';
      string ParentID = SuspectObj.Investigation__c;
      entry.Work_Description__c = 'Added Suspect';
      entry.Name = ParentID.substring(0, 15);
      entry.Date_Worked__C = system.Today();
      entry.Related_Object__c = ParentID.substring(0, 15);
      entryList.add(entry);
     }
     if(entryList.size()>0){
      insert entryList;
     }
}



My 'Suspects' trigger works just fine. I have a 'System.debug' statement in it and it is showing up in my log just fine, including the entry being made in the 'Time' Child object.

My Attachment trigger does not work as best I can tell. There is no entry in the 'Time' Child object, and there is no entry in the Logs either. 

Does anyone have any insight for me on what the problem might be? Is there some obscure setting somewhere that I need to look for that will allow 'Attachments' of Custom objects to fire triggers?

I'd welcome any input I can get on this subject.

Thanks!

Eric Anderson
 
Hi All,

I have 3 fileds on opportunity. these are fields
1)status is picklist, values of status : Approved, Rejected and In progress
2)App_date 
3)App year.

But Here my reuirements is when ever status is Approved then i want update App_date  and App_year. .but  App year is only current year  .

I did not get year format "YYYY".. 

please see the below eample for year .

Note :App_year = 2018.

Here my trigger.
trigger approvalupadte on Opportunity (before update, before insert)
{
  for(Opportunity opp : Trigger.new){
      if(opp.Status__c=='Approved')
      {
      
      opp.App_year ='YYYY';
      opp.App_date =system.today();
      }
      
     
        
  }

}
Kindly help me for Current year format, how to i will get
Thanks,
Chanti.
I need to have an IF THEN statment to update a field. What I have so far is this: IF( Action_Taken_to_Close_Complaint__c <> " ",  Status__c = "CLOSED", Status__c = "IN PROGRESS")
Set<String> setConcurReportIds = new Set<String>();
for (Expense_Cache__c eCache: lstec_existed_merge) {
System.debug(' ec.Concur_Report_Id__c is here ' + ec.Concur_Report_Id__c);
System.debug('eCache.Concur_Report_Id__c is here ' + eCache.Concur_Report_Id__c);
System.debug('eCache.Expense_Report__c is here ' + eCache.Expense_Report__c);

line 725: if (eCache.Concur_Report_Id__c == ec.Concur_Report_Id__c && eCache.Expense_Report__c != '') {     setConcurReportIds.add(eCache.Expense_Report__c);
} }

Concur_Report_Id__c is text type.
Expense_Report__c is lookup id.

Can anybody help find out why the invalid id error happens?

16:00:57.26 (1446525074)|SYSTEM_METHOD_ENTRY|[722]|System.debug(ANY)
16:00:57.26 (1446530656)|USER_DEBUG|[722]|DEBUG|    ec.Concur_Report_Id__c is here 401328
16:00:57.26 (1446536314)|SYSTEM_METHOD_EXIT|[722]|System.debug(ANY)
16:00:57.26 (1446539625)|STATEMENT_EXECUTE|[723]
16:00:57.26 (1446546287)|HEAP_ALLOCATE|[723]|Bytes:41
16:00:57.26 (1446552175)|SYSTEM_METHOD_ENTRY|[723]|System.debug(ANY)
16:00:57.26 (1446555285)|USER_DEBUG|[723]|DEBUG|eCache.Concur_Report_Id__c is here 401328
16:00:57.26 (1446559344)|SYSTEM_METHOD_EXIT|[723]|System.debug(ANY)
16:00:57.26 (1446562165)|STATEMENT_EXECUTE|[724]
16:00:57.26 (1446583131)|SYSTEM_METHOD_ENTRY|[724]|String.valueOf(Object)
16:00:57.26 (1446589079)|HEAP_ALLOCATE|[724]|Bytes:18
16:00:57.26 (1446600036)|SYSTEM_METHOD_EXIT|[724]|String.valueOf(Object)
16:00:57.26 (1446604857)|HEAP_ALLOCATE|[724]|Bytes:51
16:00:57.26 (1446609913)|SYSTEM_METHOD_ENTRY|[724]|System.debug(ANY)
16:00:57.26 (1446613386)|USER_DEBUG|[724]|DEBUG|eCache.Expense_Report__c is here a1G6F000003VESYUA4
16:00:57.26 (1446618236)|SYSTEM_METHOD_EXIT|[724]|System.debug(ANY)
16:00:57.26 (1446768110)|HEAP_ALLOCATE|[725]|Bytes:16
16:00:57.26 (1446787793)|METHOD_EXIT|[397]|01p90000006RpI3|dldcExpenses.getExpenseReport(Expense_Cache__c)
16:00:57.26 (1446797257)|SYSTEM_MODE_EXIT|false
16:00:57.26 (1446804851)|METHOD_EXIT|[26]|01p90000006RpI3|dldcExpenses.Create(List<Expense_Cache__c>)
16:00:57.26 (1446883993)|FATAL_ERROR|System.StringException: Invalid id: 

Class.dldcExpenses.getExpenseReport: line 725, column 1
Class.dldcExpenses.Create: line 397, column 1
Trigger.dldcConcurExpenseUpload: line 26, column 1
16:00:57.26 (1446898598)|FATAL_ERROR|System.StringException: Invalid id: 

I tried hard and can't any reason Invalid Id error happens.

Can anybody help on this?

We have recently enabled support for Salesforce Files in our app however some of our clients do not want to enable Chatter for some users.

It seems enabling Chatter is a requirement to use Salesforce Files.

Our only solution appears to be to restrict those clients to only use Attachments rather than Salesforce Files.

Has anyone found a way around this?

As a developer I don't seem to be able to log a ticket with Salesforce to request this enhancement.  I am a newbie so maybe I just haven't been able to find the right channel. (And apologies if I have posted this in the wrong forum).

Your help would be greatly appreciated. Many thanks, Dan