• Peter.G
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies

Hi,

 

Please help to resolve following error:

 

unexpected token: '.'

 

Error is coming for below code can anyone please suggest to resolve the following:

 

  List<Monthly_Plant_Hour__c> mph= Database.query('SELECT Name,Month__c,Reporting_Month__c,Employee__c,Man_hours__c,'
                                            +'Reporting_Year__c FROM Monthly_Plant_Hour__c '
                                                +'where '+ firstWhereClause + ' ' +secondWhereClause + ' order by Reporting_Month__c ');
                                                
        for(Integer i=0; i<mph.size();i++){


            finalmph.add(mph[i]);
        }
                                                
        return finalmph;
    }

 

 

Thanks in advance:))))

  • November 25, 2012
  • Like
  • 0

I am getting a user to use their customer portal manager credentials to log into an application we are building, but when the API call goes out, it says that a SECURITY_TOKEN is required.  I have added the IP to the trusted IPs but still the same error.  So, is there a way to get a security token for a Customer Portal Manager user?

  • November 23, 2012
  • Like
  • 0

Hello All,

 

This is my first attempt at writing an apex trigger. I got the code from another post on this board at http://boards.developerforce.com/t5/Apex-Code-Development/Trigger-Update-Lookup-Field/m-p/354509/highlight/true#M62906

 

I am trying to update the Store__c field on the standard Case object. This Store__c field is a lookup to a custom object called Store.

 

Below is my code. Any ideas?

 

trigger UpdateStoreName on Case (before update, before insert) {
List<String> StoreNames = new List<String>();
for (Case a: Trigger.new)
{
StoreNames.add(a.Store__c);
}
List <Store__c> StoreNameList = [Select Id from Store__c where Name in :StoreNames];
for (integer i = 0; i < Trigger.new.size(); i++)
{
if(Trigger.new[i].Store__c != null)
{
Trigger.new[i].Store__c = StoreNameList[i].ID;
}
else
{
Trigger.new[i].Store__c = null;
}
}
}