• Hpandey_ForceLabs
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Trigger : 

 

public class ContactBulkTest {


public static void ContactBulkMethod(Contact[] conts){
List<Country__c> CountryName = [SELECT Id, Phone_Prefix__c FROM Country__c WHERE Name = :MailingCountry LIMIT 1];

map<String, ID> map_cntry = new map<String, ID>

for(Contact c: conts){
map_cntry.put(c.Id,c.Phone_Prefix__c);

}

}
}

 

Error recieved :  Error: Compile Error: unexpected token: 'for' at line 9 column 6 

 

I have some other issues with bulk . But suddenly I am stucked in this issue .

 

Thanks. 

 

I just hit a strange Apex bug this morning. I have a set of concrete sobjects. If you debug the set, there is only one item. If you debug the set.size() it says that there are two items. When I .addAll() the set to a list, the list has two identical Sobjects. To solve the problem, I need to use a map of the concrete sobjects and then add the .values() of the map to the list.

 

My guess is that there is a bug in the code does the SObject comparison within the set class.

Hi All, I have written a batch class and am not getting the expected results. I have tried everything possible and could not find out where I am wrong with my logic. Let me explain the issue in detail and with an example. I have a sales executive John who has total 412 opportunities and number of won opportunities for him are 256. When i run the batch, What I get is three set of won opportunities i.e. 197, 18,41 total of these are exactly 256.

 

What i think is that the results i am getting this because the data is being passed into three batches and a batch gets processed and its gets updated then the next one and then the third one. But what is expected is that number of won opportunities field should be updated with 256 not with three different values i.e. all the opportunities get processed for one opportunity owner and then updated not for 1 batch at a time.

 

I would like to mention here that I am getting the expected results for the opportunities owners who have less 200 opportunities. Please suggest me what change I need to make so that I can get the expected result and what the mistake is.

 

Hi Everyone

 

Can we create custom fields using apex code ?? if anybody have any code sample or link then do let me know....

 

 

 

Thanx in advance

Vishal

Hi,

 

I am Suhasini, I have been working in Salesforce for the past 1 year or so.  I have Dev 401 Certification scheduled in another 20 days. I am tensed as I have not yet started preparing for the certification because of hectic workload in Office.

 

I request you to kindly send me the Certification Dumps to my mail suhasinireddyg@gmail.com, which would be of great help to me.

 

Also, please advice me on the way to prepare for Dev in these 15-20 days and the important areas to focus more in preparation.

 

Thanks a lot for your help in advance,

Suha.

  • December 31, 2011
  • Like
  • 0

I was browsing on my problem in this community and saw many faced similar issue but not found any exact solution .

 

Problem is simple..I've a map like this 

Map<id,integer> MapAppstoRating = new Map<id,integer>();

 

Controller populates this Map. Now what I want is to show values of this map in my VF page. Other thing is..I want to display name of the associated custom object 'record Name' instead of 'record ID' and integer value.

 

Now thing is, I was able to populate id with integer value with something like :

 

<apex:pageblockTable var="c" value="{!MapAppstoRating }" >
<apex:repeat value="{!MapAppstoRating [c]}" var="temp">
<apex:column value="{!c}" />
</apex:repeat>

<apex:repeat value="{!MapAppstoRating [c]}" var="temp">
<apex:column value="{!temp}" />
</apex:repeat>
</apex:pageblockTable>

 

But it has 2 problems..

 

Firstly..it is populating just first element of associated map. Other rows are not getting populated. But major problem is..I 've to populate name 

instead of IDs... Is that possible somehow. or I need to change my map to get names instead of ids?( changing that will be more cumbersome for me ) 

 

thanks for help!

 

I have a list of objects and I need to be able to remove a specific object from the list. I've been trying to remove it by the ID or the object itself but neither seem to be working. 

 

I've seen it suggested on here that the best practice is to just move everything to a new list and exclude the unwanted object, but this list can be changed as many times as the user changes their mind which could get ugly fast. Is there no better solution?

 

Thanks!

Phil

I am trying to iterate through the result of a soql result and I am getting a number of errors.

 

 public ApexPages.StandardSetController accountRecords{
        get {
            if(accountRecords ==null){
                return new ApexPages.StandardSetController(
                         Database.getQueryLocator(
          [SELECT name FROM Service_Region__C WHERE Service_Region__c.Advisor_Account__c NOT IN 
                (SELECT AccountId FROM Opportunity 
                 WHERE IsClosed =false)] ));
            }
            return accountRecords;
            
   Iterator<sObject> accountsIterator = accountRecords.getRecords().iterator();
      while ( accountsIterator.hasNext() ){
        sObject recordEach =  accountsIterator.next();
        recordEach.put('GEOPointe', geopointe.API(id1, accountRecords.Id, geopointe.API.units.MILES));
      }
          
        }   

        
        private set;
    }

 

 

 One error is "Save error: Non-void method might not return a value or might have statement after a return statement."

 

and the second one is related to the geopointe.API :

: Method does not exist or incorrect signature: geopointe.API(Id, Id, geopointe.API.units)

 

Any help would be appreciated.