• Ritesh__
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 37
    Questions
  • 5
    Replies

I have been working on salesforce cloud for the last couple of months. I met a client interested in making an app. I suggested to him that we can build it using cloud computing, but he argue that using cloud computing is costly so we should use dedicated server. I read many articles some are saying its not cutting the cost of app but its increasing. I want to know using cloud computing specially salesforce cloud. Will it increase the production for example its making development easy, so easy the development you can very fast develop the app only or it reduces the cost of hosting or increasing the cost of hosting ??please give some guideline on cost affected for hosting the app increases or decreases ??

 

i have created an object with name PS_Detail__c .in this custom object i created a custom field of picklist type.in this picklist i defined two values Dollar ,Unit. when i go to P/S Detail Tab for creating a new PS_Detail__c object then i get None also as a value in picklist field .i want only Dollar and Unit as Picklist values .some one please help how to remove this None from Picklist

i a testing my app . it is giving me error

System.UnexpectedException: No more than one executeBatch can be called from within a testmethod. Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation.

i am trying to call a Batch apex class when this app is based on Google Calendar Api.thats why json response .but i am facing the above error unable to resolve.

@isTest public class TestBatchCleanGCalendars {

    static testMethod void testBatchJob() {

        GoogleTestHelper.createfullGSettings(10);
        GoogleTestHelper.createCampaigns();

        List<Campaign> campaigns = [Select Id, Name from Campaign];

        system.assertEquals(5,campaigns.size());

        GoogleTestHelper.createTestCalendars();

        GCalendarUtil.testResponse = GoogleTestHelper.returnGCalendarResp();
            BatchCleanGCalendars bJob = new BatchCleanGCalendars('Select Id, Name, CalendarId__c,CalendarQuery__c,FieldToDisplay__c from CalendarSettings__c');

        bJob.testResponse = '{'
+' "kind": "calendar#events",'
+' "summary": "Saarthak",'
+' "description": "",'
+' "updated": "2013-03-26T10:17:05.354Z",'
+' "timeZone": "Asia/Calcutta",'
+' "accessRole": "owner",'
+' "items": ['
+'  {'  +'  "kind": "calendar#event",'   +' "id": "c3gmu1me12tmujuifgmbrr33rc",'  +'  "status": "confirmed",'
+  ' "htmlLink": "https://www.google.com/calendar/event?eid=YzNnbXUxbWUxMnRtdWp1aWZnbWJycjMzcmMgamg5NWRyMDhpNDdwZ3RkMzFmMzQ5Z25uZmdAZw",'
+'  "created": "2013-03-26T10:17:03.000Z",'   +' "updated": "2013-03-26T10:17:03.552Z",'   +' "summary": "GC Product Webinar - Jan 7, 2002",'   +' "description": "null",'   +' "creator": {'   +'  "email": "riteshmehandiratta@gmail.com"'   +' },'   +' "organizer": {'
+'  "email": "jh95dr08i47pgtd31f349gnnfg@group.calendar.google.com",'   +'  "displayName": "Saarthak",'   +'  "self": true'   +' },'   +' "start": {'    +' "date": "2006-09-04"'   +' },'  +'  "end": {'   +'  "date": "2006-09-04"'   +' },'   +' "iCalUID": "c3gmu1me12tmujuifgmbrr33rc@google.com",'   +' "sequence": 0,'   +' "reminders": {'    +' "useDefault": true'  +'  }'  +' },'  +' {'   +' "kind": "calendar#event",'   +' "id": "6se2vm8guhbh2tekc7scnpcudc",'  
+' "status": "confirmed",'   +' "htmlLink": "https://www.google.com/calendar/event?eid=NnNlMnZtOGd1aGJoMnRla2M3c2NucGN1ZGMgamg5NWRyMDhpNDdwZ3RkMzFmMzQ5Z25uZmdAZw",'
+' "created": "2013-03-26T10:17:04.000Z",'   +' "updated": "2013-03-26T10:17:04.096Z",'   +' "summary": "User Conference - Jun 17-19, 2002",'   +' "description": "null",'   +' "creator": {'   +'  "email": "riteshmehandiratta@gmail.com"'   +' },'   +' "organizer": {'
+'  "email": "jh95dr08i47pgtd31f349gnnfg@group.calendar.google.com",'   +'  "displayName": "Saarthak",'   +'  "self": true'   +' },'   +' "start": {'   +'  "date": "2007-02-12"'   +' },'   +' "end": {'    +' "date": "2007-02-14"'   +' },'   +' "iCalUID": "6se2vm8guhbh2tekc7scnpcudc@google.com",'   +' "sequence": 0,'   +' "reminders": {'    +' "useDefault": true'   +' }'  +' },'  +' {'  +'  "kind": "calendar#event",'  +'  "id": "8of1l1ffqbfmm582und3q42k10",' 
+'  "status": "confirmed",'   +' "htmlLink": "https://www.google.com/calendar/event?eid=OG9mMWwxZmZxYmZtbTU4MnVuZDNxNDJrMTAgamg5NWRyMDhpNDdwZ3RkMzFmMzQ5Z25uZmdAZw",'
+' "created": "2013-03-26T10:17:04.000Z",'   +' "updated": "2013-03-26T10:17:04.707Z",'   +' "summary": "DM Campaign to Top Customers - Nov 12-23, 2001",'   +' "description": "null",'   +' "creator": {'   +'  "email": "riteshmehandiratta@gmail.com"'   +' },' 
+'"organizer": {'   +'  "email": "jh95dr08i47pgtd31f349gnnfg@group.calendar.google.com",'   +'  "displayName": "Saarthak",'   +'  "self": true'   +' },'   +' "start": {'   +'  "date": "2006-07-10"'   +' },'   +' "end": {'    +' "date": "2006-07-21"'  +'  },'   +' "iCalUID": "8of1l1ffqbfmm582und3q42k10@google.com",'   +' "sequence": 0,'   +' "reminders": {'   +'  "useDefault": true'   +' }'  +' }'
+' ]'
+',"nextPageToken": "CigKGjFhaW9oc25nZTFhZzBxYTY4bjZhOGlrdG5nGAEggICA0arZqecT"'
+'}';

 bJob.testResponse1 = '{'
+' "kind": "calendar#events",'
+' "summary": "Saarthak",'
+' "description": "",'
+' "updated": "2013-03-26T10:17:05.354Z",'
+' "timeZone": "Asia/Calcutta",'
+' "accessRole": "owner",'
+' "items": ['
+'  {'  +'  "kind": "calendar#event",'   +' "id": "c3gmu1me12tmujuifgmbrr33rc",'  +'  "status": "confirmed",'
+  ' "htmlLink": "https://www.google.com/calendar/event?eid=YzNnbXUxbWUxMnRtdWp1aWZnbWJycjMzcmMgamg5NWRyMDhpNDdwZ3RkMzFmMzQ5Z25uZmdAZw",'
+'  "created": "2013-03-26T10:17:03.000Z",'   +' "updated": "2013-03-26T10:17:03.552Z",'   +' "summary": "GC Product Webinar - Jan 7, 2002",'   +' "description": "null",'   +' "creator": {'   +'  "email": "riteshmehandiratta@gmail.com"'   +' },'   +' "organizer": {'
+'  "email": "jh95dr08i47pgtd31f349gnnfg@group.calendar.google.com",'   +'  "displayName": "Saarthak",'   +'  "self": true'   +' },'   +' "start": {'    +' "date": "2006-09-04"'   +' },'  +'  "end": {'   +'  "date": "2006-09-04"'   +' },'   +' "iCalUID": "c3gmu1me12tmujuifgmbrr33rc@google.com",'   +' "sequence": 0,'   +' "reminders": {'    +' "useDefault": true'  +'  }'  +' },'  +' {'   +' "kind": "calendar#event",'   +' "id": "6se2vm8guhbh2tekc7scnpcudc",'  
+' "status": "confirmed",'   +' "htmlLink": "https://www.google.com/calendar/event?eid=NnNlMnZtOGd1aGJoMnRla2M3c2NucGN1ZGMgamg5NWRyMDhpNDdwZ3RkMzFmMzQ5Z25uZmdAZw",'
+' "created": "2013-03-26T10:17:04.000Z",'   +' "updated": "2013-03-26T10:17:04.096Z",'   +' "summary": "User Conference - Jun 17-19, 2002",'   +' "description": "null",'   +' "creator": {'   +'  "email": "riteshmehandiratta@gmail.com"'   +' },'   +' "organizer": {'
+'  "email": "jh95dr08i47pgtd31f349gnnfg@group.calendar.google.com",'   +'  "displayName": "Saarthak",'   +'  "self": true'   +' },'   +' "start": {'   +'  "date": "2007-02-12"'   +' },'   +' "end": {'    +' "date": "2007-02-14"'   +' },'   +' "iCalUID": "6se2vm8guhbh2tekc7scnpcudc@google.com",'   +' "sequence": 0,'   +' "reminders": {'    +' "useDefault": true'   +' }'  +' },'  +' {'  +'  "kind": "calendar#event",'  +'  "id": "8of1l1ffqbfmm582und3q42k10",' 
+'  "status": "confirmed",'   +' "htmlLink": "https://www.google.com/calendar/event?eid=OG9mMWwxZmZxYmZtbTU4MnVuZDNxNDJrMTAgamg5NWRyMDhpNDdwZ3RkMzFmMzQ5Z25uZmdAZw",'
+' "created": "2013-03-26T10:17:04.000Z",'   +' "updated": "2013-03-26T10:17:04.707Z",'   +' "summary": "DM Campaign to Top Customers - Nov 12-23, 2001",'   +' "description": "null",'   +' "creator": {'   +'  "email": "riteshmehandiratta@gmail.com"'   +' },' 
+'"organizer": {'   +'  "email": "jh95dr08i47pgtd31f349gnnfg@group.calendar.google.com",'   +'  "displayName": "Saarthak",'   +'  "self": true'   +' },'   +' "start": {'   +'  "date": "2006-07-10"'   +' },'   +' "end": {'    +' "date": "2006-07-21"'  +'  },'   +' "iCalUID": "8of1l1ffqbfmm582und3q42k10@google.com",'   +' "sequence": 0,'   +' "reminders": {'   +'  "useDefault": true'   +' }'  +' }'
+' ]'
+'}';
        Test.StartTest();

        System.assertEquals(2,[Select count() from CalendarSettings__c ]);

               DataBase.executeBatch(bJob); 


        Test.StopTest();


    }

after completing Batch request in finish method i am calling one more Batch class.can any one please point me why i am getting this error when i am calling one Batch class in testmethod ?? please some one help

 

i am calling a batch class from finish method of another batch class and facing the above error

my finish method code is public class BatchPublicCampaignsToGoogle implements Database.Batchable, Database.Stateful, Database.AllowsCallouts {

public void finish(Database.BatchableContext BC){

        if(newBatch == true)
        {           CalendarSettings__c c= [Select Id, Name, CalendarId__c,CalendarQuery__c,FieldToDisplay__c from CalendarSettings__c WHERE Name = 'Internal marketing Calendar' LIMIT 1] ;
       BatchPublicCampaign bjob = new BatchPublicCampaign();
                Database.executeBatch(bjob);

        }
    }

} but i was facing error Database.executeBatch cannot be called from a batch or future method.

after finishing Batch request i am trying to call it(i have to call it for two times) again.so i call it.

How to get rid of error.i know we can call a batch class from finish method of a Batch Class but why i am getting this error ??

 

i am calling a batch class instance and after completing batch class i am calling two other batch class instance. finish() method code for first batch class is

 public void finish(Database.BatchableContext BC){ 

    List<Event__c> events =[SELECT Id from Event__c];

    delete events;
    System.debug('Executing finish');
      for(CalendarSettings__c c: [Select Id, Name, CalendarId__c,CalendarQuery__c,FieldToDisplay__c from CalendarSettings__c])
      {System.debug('Calendar Id is'+c.CalendarId__c);
           BatchPublicCampaignsToGoogle bjob = new BatchPublicCampaignsToGoogle(c.CalendarQuery__c,c.CalendarId__c,c.FieldToDisplay__c);
            Database.executeBatch(bjob,9);
        }

        }

the problem i am facing is i am expecting that Batch class BatchPublicCampaignsToGoogle will be called two times but it is called only one time and loop is running for two times (i analysed debug log ).why it is called only one time please some one explain??

i am sure i am doing a very small mistake.i created a visualforce page with code

<apex:page standardController="RuleCriteria__c" extensions="AW_RuleCriteriaController3">
<apex:form >
<apex:pageBlock title="Rule Criteria Detail">
         <apex:pageBlockButtons >
             <apex:commandButton value="Save" />
             <apex:commandButton value="Save and New" />
             <apex:commandButton value="Cancel" />
         </apex:pageBlockButtons>
         <apex:pageBlockSection title="Information">
         </apex:pageBlockSection>
         <apex:pageBlockSection columns="1">
         <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Related Object"></apex:outputLabel>
                         <apex:selectList value="{!objType}" size="1" onchange="fieldNamesList(this.options[this.selectedIndex].value);">
                             <apex:selectOptions value="{!objOptions}"/>
                         </apex:selectList>
                 </apex:pageBlockSectionItem>
                 <apex:pageBlockSectionItem >
                       <apex:outputLabel value="Field Name"></apex:outputLabel>
                         <apex:outputPanel id="fieldPanel"> 
                             <apex:outputPanel layout="block" styleClass="requiredInput">
                                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                             <apex:selectList value="{!fieldName}" size="1" onchange="setFieldApiName(this.options[this.selectedIndex].value)">
                                 <apex:selectOptions value="{!fieldOption}"/>
                             </apex:selectList>
                             </apex:outputPanel>
                          </apex:outputPanel> 

                     </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem >
                  <apex:outputLabel value="Field Type"></apex:outputLabel>
                         <apex:outputPanel id="fieldTypeApiPanel"> 
                             <apex:outputText value="{! fieldType}"/>
                          </apex:outputPanel>
                 </apex:pageBlockSectionItem>  
                 <apex:pageBlockSectionItem >
                 <apex:outputLabel value="Operator" />
                 <apex:outputPanel id="operatorPanel"> 
                 <apex:selectList value="{!newRuleCriteria.Matching_Type__c}"  size="1" >
<apex:selectOptions value="{! Operator}" ></apex:selectOptions> 
</apex:selectList>
</apex:outputPanel>  
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem rendered="{! isPicklist}" id="picklist">
<apex:outputLabel value="Matching Value"> </apex:outputLabel>
<apex:selectList value="{!newRuleCriteria.Matching_Value__c}" size="1"  >
                            <apex:selectOptions value="{! PickListValues}"/>                            
                        </apex:selectList>


</apex:pageBlockSectionItem >
<apex:pageBlockSectionItem rendered="{! isInput}" id='input1'>
<apex:outputLabel value="Matching Value"></apex:outputLabel>
<apex:inputFIeld value="{! newRuleCriteria.Matching_Value__c}"  />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem rendered="{! isCheckBox}" id='check'>
<apex:outputLabel value="Matching Value"></apex:outputLabel>
                        <apex:inputCheckBox value="{! newRuleCriteria.Matching_Value__c}"/>

</apex:pageBlockSectionItem>
                 </apex:pageBlockSection>
         </apex:pageBlock>
         <apex:actionRegion >
       <apex:actionFunction name="fieldNamesList" action="{!getFieldNames}" reRender="fieldPanel">
        <apex:param assignTo="{!parentName}" value="" name="parentName"/>
        </apex:actionFunction>
     </apex:actionRegion>
         <apex:actionRegion >  
       <apex:actionFunction name="setFieldApiName" action="{!setFieldApiName}" reRender="picklist,input1,check,operatorPanel,fieldTypeApiPanel">
        <apex:param  value="" name="fieldName"/>
       </apex:actionFunction>   
     </apex:actionRegion>

         </apex:form>
</apex:page>

 

 

and the extension code function is this

public pageReference setFieldApiName(){
fieldName = Apexpages.currentPage().getParameters().get('fieldName');
if(fieldName != null && fieldName.length() >0){
fieldType = Schema.getGlobalDescribe().get(objType).getDescribe().fields.getMap().get(fieldName).getDescribe().getType().name();
if(Schema.DisplayType.PickList == Schema.getGlobalDescribe().get(objType).getDescribe().fields.getMap().get(fieldName).getDescribe().getType()) {isPicklist=true; isCheckBox = false;
isInput =false; isMinMax = false;}
if(Schema.DisplayType.Boolean == Schema.getGlobalDescribe().get(objType).getDescribe().fields.getMap().get(fieldName).getDescribe().getType())
{isPicklist=false; isCheckBox=true; isInput= false; isMinMax= false; }
}else {fieldType=''; isMinMax=isCheckBox=isPickList=false; isInput=true; }
System.debug('pick list is '+isPickList); return null; }

 

 in this page in one select list i am showing Label of objects when user select label then in second list i show fields corresponding to that label but when i select a field actionFunction selectFieldApiName called.and in debug log it is showing pick list is true. but there is not picklist is rendering i think after selecting a picklist field ispickList getting true and then this pageblocksection item should render but it is not rendering can any one please tell where i am wrong.please help!!

 i created a visualforce page in which there is a code segment

<apex:column ><apex:commandButton value="{!if(item.i == size-1,'Add','Delete')}" action="{!if(size == 1,addElement(),removeElement())}"></apex:commandButton></apex:column>

i created a custom controller containing function

public PageReference addElement(){

return null;

}
public PageReference removeElement(){

return null;

}

but when i try to save the visualforce page it is giving me error

Error: Unknown function addElement. Check spelling  

can any one please tell me how to use if structure in action attribute so that it will properly work

i have create an apex class

public class sampleCon {
public PageReference setFieldApiName() {
System.debug('field are '+ Apexpages.currentPage().getParameters().get('fieldName'));
return null;
}
String[] countries = new String[]{};

public PageReference test() {
return null;
}

public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('US','US'));
options.add(new SelectOption('CANADA','Canada'));
options.add(new SelectOption('MEXICO','Mexico'));
return options;
}

public String[] getCountries() {
return countries;
}

public void setCountries(String[] countries) {
this.countries = countries;
}
}

 

and my visualforce page is 

 

<apex:page controller="sampleCon">
    <apex:form>
        <apex:selectList value="{!countries}"  multiselect="true" onchange="setFieldApiName({! countries})"> <apex:selectOptions value="{!items}"/> </apex:selectList><p/> </apex:form> <apex:outputPanel id="out"> <apex:actionstatus id="status" startText="testing..."> <apex:facet name="stop"> <apex:outputPanel> <p>You have selected:</p> <apex:dataList value="{!countries}" var="c">{!c}</apex:dataList> </apex:outputPanel> </apex:facet> </apex:actionstatus> </apex:outputPanel> <apex:form> <apex:actionRegion > <apex:actionFunction name="setFieldApiName" action="{!setFieldApiName}" reRender="out"> <apex:param value="" name="fieldName"/> </apex:actionFunction> </apex:actionRegion> </apex:form> </apex:page>

 

when i select an item from the list and actionFunction will be called and from which there is a call to apex class function setFieldApiName i am expecting that country which i selected in debug but getting "field are null" .how to get the country value when it is changed in list please some one explain

 

i am creating a visualforce page in this visualforce page there is a pageblocktable in each table row there are two selectlist one depends on other.first select list contains list of standard objects and other contain list of fields related to that object.there are several rows each contains these two lists.how to change content of second list related to first please give some guideline.firstly i created a wrapper class

 

public with sharing class AW_RuleCriteriaController2{
public String hello{get;set;}
public List<wrapper> wrap1{get;set;}
public AW_RuleCriteriaController2(ApexPages.StandardController controller){
wrap1 =new List<wrapper>();
wrap1.add(new wrapper());
wrap1.add(new wrapper());
}

public class wrapper{

public List<SelectOption> objOption{get;set;}
public List<SelectOption> fieldOption;
public List<SelectOption> matchType;
public String hello{get;set;}
public wrapper(){
objOption = new List<SelectOption>();
Map<String, Schema.SObjectType> mapObj = Schema.getGlobalDescribe();

Rule__c rule = [select object__c from Rule__c where id=:Apexpages.currentPage().getParameters().get('Id')];

String objType = rule.object__c;
Schema.SObjectType sobj;
if(objType !=null){
sobj = mapObj.get(objType);
Schema.DescribeSObjectResult objinfo = null;

objinfo = sobj.GetDescribe();
List<Schema.ChildRelationship> listChild = sobj.getDescribe().getChildRelationships();

for(Schema.ChildRelationship child: listChild){
Schema.DescribeSObjectResult descRes = child.getChildSObject().getDescribe();
system.debug(' PGB Children ' + descRes.getName());
system.debug(' PGB Children ' + descRes.getLabel());
objOption.add(new SelectOption(descRes.getName(),descRes.getLabel()));
}
objOption.add(new SelectOption(objInfo.getName(), objInfo.getLabel()));
}
}

}

}

after this i added objOption this contain the list of available objects .its giving the correct list in visualforce page

<apex:page standardController="Rule__c" extensions="AW_RuleCriteriaController2">

<apex:form >
<apex:pageBlock title="Filter Criteria" >
<apex:pageBlockSection >

<apex:inputtext value="{! hello}" />
</apex:pageBlockSection>

<apex:pageBlockTable value="{!wrap1}" var="item">

<apex:column >
<apex:selectList value="{! item.hello}" size="1">
<apex:selectOptions value="{! item.objOption}"></apex:selectOptions></apex:selectList></apex:column>

</apex:pageBlockTable>

</apex:pageBlock>

</apex:form>
</apex:page>

how to create a second selectlist in the pageblock table whose value changes with the selected value of the first selectlist.i hope i described well the situation.now please guideline how to accomplish this . 

 

i have created a visualforce page.with this page i have override with a customobject New and Edit Button but now i want to change the label of New to some other value.there are two custom object Rule__c and Rule_Criteria__c. i added this relationship in the standard layout of Rule__c custom object.for adding a new Rule_Criteria__c object now the label is New Rule Criteria to Manage Rule Criteria is there a way to change standard button label or we have to create a custom Button ??

i first save a project from eclipse to my dev org that project contain a custom application. it is showing app when i go to Create>Apps but when i click on the right hand side to Help for selecting a custom app it is not showing that app.How to select this custom app please guideline!!

 

i am trying to access the Report objects in apex but getting limited fields my apex source code is

public Class MyController{
public List<Report> getReports(){

List<Report> rep1 = new List<Report>();
rep1=[Select Id,Developername,Description,Name,OwnerId from Report];


return rep1;

}

}

but i want to get the value of the sObject type to which it is related to for example 1.i click on new Report 2.then select Opportunities 3.then click create

how to get this opportunity object and how to get filters applied to reports please explain it.

i am writing a test class for my apex custom controller

@isTest
public class TestGoogleLoginController {
public static testMethod void testGoogleLogin(){
PageReference pageRef = Page.GoogleLogin;
        Test.setCurrentPage(pageRef);
GoogleLoginController testCon = new GoogleLoginController();
 testCon.googleApp.Name        = 'Test Google';
       testCon.googleApp.ClientId__c     = 'TestClientID';
       testCon.googleApp.ClientSecret__c = 'TestClientSecret';
       testCon.googleApp.Scope__c        = 'Full';

       testCon.saveGoogleSettings();

        system.assertEquals(false,testCon.isEditMode);

      testCon.getfieldsToDisplay();

      testCon.setfieldsToDisplay(new List<String>());
       testCon.getOptionalFields();
       testCon.getTimes();
       testCon.getFrequencies();
       testCon.editSettings();
       testCon.resetSettings();
       HttpResponse res = new HttpResponse();
       res.setStatusCode(200);
       res.setBody('{"access_token":"testtoken","expires_in":3600,"refresh_token":"testrefresh"}');

     //  testCon.testnewToken = GoogleTestHelper.returnGCalendarResp();


       testCon.testStringResponse='{'
 +'"kind": "calendar#calendarList",'
 +'"etag": "\"ornOQ71wXvJyYxXJastrexEVbhI/cahY1tW4ufW7_T7RZX6lctFgxTs\"",'
 +'"items": ['
  +
  '{'

   +'"kind": "calendar#calendarListEntry",'
   +'"etag": "\"ornOQ71wXvJyYxXJastrexEVbhI/O2iwFWmuTeTtE-FHvIebAXyATNA\"",'
   +'"id": "#contacts@group.v.calendar.google.com",'
   +'"summary": "Contacts\' birthdays and events",'
   +'"description": "Your contacts\' birthdays and anniversaries",'
   +'"timeZone": "Asia/Calcutta",'
   +'"colorId": "12",'
   +'"backgroundColor": "#fad165",'
   +'"foregroundColor": "#000000",'
   +'"selected": true,'
   +'"accessRole": "reader"'
  +'},'
  +'{'

   +'"kind": "calendar#calendarListEntry",'
   +'"etag": "\"ornOQ71wXvJyYxXJastrexEVbhI/EuXdDiUebGTzeu_H2b77ywuPg5I\"",'
   +'"id": "en.indian#holiday@group.v.calendar.google.com",'
   +'"summary": "Indian Holidays",'
   +'"description": "Indian Holidays",'
   +'"timeZone": "Asia/Calcutta",'
   +'"colorId": "9",'
   +'"backgroundColor": "#7bd148",'
   +'"foregroundColor": "#000000",'
   +'"accessRole": "reader"'
  +'},'
  +'{'

   +'"kind": "calendar#calendarListEntry",'
   +'"etag": "\"ornOQ71wXvJyYxXJastrexEVbhI/Mwoop52s5b3-Jh82u4_w_xVY4Nc\"",'
   +'"id": "riteshmehandiratta@gmail.com",'
   +'"summary": "riteshmehandiratta@gmail.com",'
   +'"timeZone": "Asia/Calcutta",'
   +'"colorId": "15",'
   +'"backgroundColor": "#9fc6e7",'
   +'"foregroundColor": "#000000",'
   +'"selected": true,'
   +'"accessRole": "owner",'
   +'"defaultReminders": ['
    +'{'
     +'"method": "email",'
     +'"minutes": 10'
    +'},'
    +'{'
     +'"method": "popup",'
     +'"minutes": 10'
    +'}'
   +'],'
   +'"primary": true'
  +'}'
 +']'
+'}';
       testCon.getCalendars();


}

}

when i run this test i am getting error

System.JSONException: Unexpected character ('o' (code 111)): was expecting comma to separate OBJECT entries at [line:1, column:45]

    (System Code)
    Class.JSON2Apex.parse: line 14, column 1
    Class.GoogleLoginController.getCalendars: line 557, column 1
    Class.TestGoogleLoginController.testGoogleLogin: line 110, column 1

i am clueless why i am facing this error

my JSON2Apex class is public class JSON2Apex {

public String kind; 
public String etag; 
public List<Items> items; //this list represent google Calendar list  in the Authenticated Calendar 

//parse Method for converting a JSON response into JSON2Apex
public static JSON2Apex parse(String json) {
    return (JSON2Apex) System.JSON.deserialize(json, JSON2Apex.class);
}}

and code for Items class is

public class Items {
        public String kind; //kind of the Google Calendar
        public String etag; //etag of the Google Calendar
        public String id;  //id of the Google Calendar
        public String summary; //summary of the Google Calendar
        public String description; //Description of google Calendar
        public String timeZone; //timeZone of the Google Calendar
        public String colorId; //ColorId of the Calendar
        public String backgroundColor; //Background Color of the Calendar
        public String foregroundColor; //ForeGround Color Of the Calendar
        public Boolean selected;  
        public String accessRole;
        public List<DefaultReminders> defaultReminders; //Default Remainder Configuration of the Calendar

        public class DefaultReminders {
        public String method; //Method For Reminding for an event
        public Integer minutes; 
    }

    }

and code for getCalendar method is

public void getCalendars(){
 536        GCalendarUtil.GResponse response;
 537        
 538          if(googleapp.ExpiresIn__c < system.now()){
 539       if(!Test.isRunningTest())
 540                  response = GCalendarUtil.getNewToken(googleapp);
 541              else
 542                  response = testnewToken;
 543             
 544              accessToken  = response.access_token;
 545           
 546            }else{
 547      
 548              accessToken = googleapp.AccessToken__c;
 549      
 550            }
 551            String resp;
 552            if(!Test.isRunningTest())
 553                  resp = GCalendarUtil.doAPICall(null, 'GET','https://www.googleapis.com/calendar/v3/users/me/calendarList',accessToken);
 554              else
 555                  resp = testStringResponse;       
 556            
 557          JSON2Apex apexObject=JSON2Apex.parse(resp);
 558      
 559       ls = new Map<String,String>();
 560      
 561      List<Items> itemlist= apexObject.items ; 
 562      
 563      for(Items item:itemlist)
 564      ls.put(item.id,item.summary);
 565        
 566        for(CalendarSettings__c c: newCalSettings){
 567        c.Google_Calendar_Name__c = ls.get(c.name);  
 568             }
 569        }

why i am facing this error please some one help ??

in my visualforce page i have some campaign object first user select an object then there is a multi picklist. in this picklist there is Label for all the fields user selects some fields then i have to show the value of these fields in the selected campaign object for showing multiple picklist my apex function is

 public List<SelectOption> getOptionalFields(){


   Map <String, Schema.SObjectField> fieldMap= Campaign.sObjectType.getDescribe().fields.getMap();
       List<SelectOption> fieldsName =new List<SelectOption>();

   for(Schema.SObjectField sfield : fieldMap.Values())
{
schema.describefieldresult dfield = sfield.getDescribe();
fieldsName.add(new SelectOption(dfield.getName(),dfield.getLabel()));

}

but i have no idea how to show value for the the field for exmple i have object instance like

Campaign c;

now i have to get value of any field whose Name is in string form.how to get corresponding value for that field.one solution is just write like say

String fieldName;

and use multiple if

if(fieldName=='Name')
c.Name=
if(fieldName=='Id')
c.Id=

is there any other convenient method??please explain!!

hi i have created a DataBase.Batchable class in which i am inserting a custom object named it Event__c

 

public class BatchCreateGCalendars implements Database.Batchable<SObject>, Database.Stateful, Database.AllowsCallouts {

 private List<Event__c> event_id;

}

i am creating say 1000 records of type events and then using the statement

insert event_id;

is this good or inserting each element one by one is more appropriate.

in my custom object i created only one  custom field of type text(255).so what is the maximum size of list can be(approximate)??

please guideline 

i write a visualforce page with source code

<apex:page controller="MyController1">
<apex:form>
<apex:pageBlock >
<apex:pageBlockSection  id="search">
<apex:commandLink action="{!commandLinkAction}" value="Advance Search"  reRender="thePanel" id="theCommandLink"/>
<apex:outputPanel id="thePanelWrapper">
<apex:outputPanel id="thePanel" rendered="{! rend}" layout="block">My div</apex:outputPanel>
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

and the MyController1 class is

public class MyController1{
public Boolean rend{get;set;}
public PageReference commandLinkAction(){
rend=true;
return null;
}

}

when i click on Advanced Search link nothing happens but i was expecting outputPanel with id "thePanel" should render.why it is not rendering please someone explain??

i have to create a ui for searching Opportunity . user fullfill the criteria and he will get the opportunity List accordingly  what i was thinking create a inputTextField when user enters any character then it will show result on keyup event .and one more section for Advance search in which there are various filter based on different Fields for Opportunity i am thinking of creating a PageBlock  and in that i will put select list or other visualforce component but the problem is by default pageblock is  in expand mode i want to show it in collapse mode initially when page renders so that user will click on the pageblock and then it expands how to accomplsih this and any other suggestion are welcomed please suggest ??

i am creating a visualforce page . i am using dynamic component in it. my visual force page code is

<apex:page title="Opportunity Display" controller="MyPageController1" showHeader="true" sidebar="false" readOnly="true" cache="false">
<apex:sectionHeader subtitle="SOQL Offset Example w/Dynamic Page Buttons" title="Opportunity Display Table"/>
<apex:form >
<apex:pageBlock >   
<apex:dynamicComponent componentValue="{!myCommandButtons}"/>   
    <apex:actionFunction action="{!refreshGrid}"  name="queryByPage" reRender="myPanel,myButtons" >
        <apex:param name="firstParam" assignTo="{!selectedPage}" value="" />
    </apex:actionFunction>



 <apex:pageBlockSection title="Opportunity Display (Total List Size: {!total_size})" collapsible="false">
    <apex:outputPanel id="myPanel">
    <apex:pageMessages id="theMessages" />
    <apex:pageBlockTable value="{!opportunity}" var="n" align="center">
   <apex:column ><apex:inputCheckbox value="{!n.checked}"/></apex:column>
        <apex:column value="{!n.cat.Id}" />
        <apex:column value="{!n.cat.Name}" />
        <apex:facet name="footer">Showing Page # {!pageNumber} of {!totalPages}</apex:facet>
    </apex:pageBlockTable>
    </apex:outputPanel>
    </apex:pageBlockSection>  


</apex:pageBlock>  

</apex:form>
</apex:page>

and the code segment from where i am retrieving dynamic component is

public Component.Apex.pageBlockButtons getMyCommandButtons() {

        //the reRender attribute is a set NOT a string
        Set<string> theSet = new Set<string>();
        theSet.add('myPanel');
        theSet.add('myButtons');

        integer totalPages;
        if (math.mod(total_size, list_size) > 0) {
            totalPages = total_size/list_size + 1;
        } else {
            totalPages = (total_size/list_size);
        }

        integer currentPage;        
        if (selectedPage == '0') {
            currentPage = counter/list_size + 1;
        } else {
            currentPage = integer.valueOf(selectedPage);
        }

        Component.Apex.pageBlockButtons pbButtons = new Component.Apex.pageBlockButtons();        
    pbButtons.location = 'both' ;
        pbButtons.id = 'myPBButtons';

        Component.Apex.outputPanel opPanel = new Component.Apex.outputPanel();
        opPanel.id = 'myButtons';

        //the Previous button will alway be displayed
        Component.Apex.commandButton b1 = new Component.Apex.commandButton();
        b1.expressions.action = '{!Previous}';
        b1.title = 'Previous';
        b1.value = 'Previous';
        b1.expressions.disabled = '{!disablePrevious}';        
        b1.reRender = theSet;

        opPanel.childComponents.add(b1);        

        for (integer i=0;i<totalPages;i++) {
            Component.Apex.commandButton btn = new Component.Apex.commandButton();

            if (i+1==1) {
                btn.title = 'First Page';
                btn.value = 'First Page';
                btn.rendered = true;                                        
            } else if (i+1==totalPages) {
                btn.title = 'Last Page';
                btn.value = 'Last Page';
                btn.rendered = true;                            
            } else {
                btn.title = 'Page ' + string.valueOf(i+1) + ' ';
                btn.value = ' ' + string.valueOf(i+1) + ' ';
                btn.rendered = false;             
            }

            if (   (i+1 <= 5 && currentPage < 5)
                || (i+1 >= totalPages-4 && currentPage > totalPages-4)
                || (i+1 >= currentPage-2 && i+1 <= currentPage+2))
            {
                btn.rendered = true;
            }

            if (i+1==currentPage) {
                btn.disabled = true; 
                btn.style = 'color:blue;';
            }  

            btn.onclick = 'queryByPage(\''+string.valueOf(i+1)+'\');return false;';

            opPanel.childComponents.add(btn);

            if (i+1 == 1 || i+1 == totalPages-1) { //put text after page 1 and before last page
                Component.Apex.outputText text = new Component.Apex.outputText();
                text.value = '...';        
                opPanel.childComponents.add(text);
            } 

        }

        //the Next button will alway be displayed
        Component.Apex.commandButton b2 = new Component.Apex.commandButton();
        b2.expressions.action = '{!Next}';
        b2.title = 'Next';
        b2.value = 'Next';
        b2.expressions.disabled = '{!disableNext}';        
        b2.reRender = theSet;
        opPanel.childComponents.add(b2);

        //add all buttons as children of the outputPanel                
        pbButtons.childComponents.add(opPanel);  

        return pbButtons;

    }    
    at this line i am setting 
 pbButtons.location = 'both' ;

so it will render bottom and top but button is rendering only at top not at bottom and when i set this line to pbButtons.location='bottom' then there is no pageblock button in the page .can any one please tell why its not rendering at the bottom??

i am writing a visualforce in which i am using dynamic components my visualforce code is

<apex:pagetitle="Salesforce SOQL Offset Example Using Visualforce"standardStylesheets="false"controller="dynamic_visualforce_with_soql_offset"sidebar="false"readOnly="true"cache="false"showHeader="false"><scriptsrc="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><scriptsrc="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script><scripttype="text/javascript">$(function(){$("[id$=prev]").click(function(){alert('Hello World');});});</script><apex:sectionHeadersubtitle="SOQL Offset Example w/Dynamic Page Buttons"title="Square Root Table"/><apex:form><apex:pageBlock><apex:actionFunctionaction="{!refreshGrid}"name="queryByPage"reRender="myPanel,myButtons"><apex:paramname="firstParam"assignTo="{!selectedPage}"value=""/></apex:actionFunction><apex:dynamicComponentcomponentValue="{!myCommandButtons}"/><apex:pageBlockSectiontitle="Numbers and their Square Roots (Total List Size: {!total_size})"collapsible="false"><apex:outputPanelid="myPanel"><apex:pageMessagesid="theMessages"/><apex:pageBlockTablevalue="{!numbers}"var="n"align="center"><apex:columnvalue="{!n.Id}"/><apex:columnvalue="{!n.Name}"/><apex:facetname="footer">Showing Page # {!pageNumber} of {!totalPages}</apex:facet></apex:pageBlockTable></apex:outputPanel></apex:pageBlockSection></apex:pageBlock></apex:form></apex:page>

and segment for generating dynamic component is

 

i have a batch class  with code

 

public class BatchDeleteEvents implements Database.Batchable<SObject>, Database.Stateful, Database.AllowsCallouts {
    
    private String query;
    private String pageToken ;
    private String CalendarId;
    private String accessToken;
    public BatchDeleteEvents(String CalendarId, String accessToken){
    
        this.query = 'Select Id, Name from Event__c'; // Query to get the CalendardID (Google ID)
    this.CalendarId =CalendarId;
    this.accessToken =accessToken;
    }
    
    public Database.Querylocator start(Database.BatchableContext BC){

        return Database.getQueryLocator(query);
        
    }
    
    public void execute(Database.BatchableContext BC, List<sObject> scope){
    System.debug('Entered in delete Batch');
    for(Event__c c : (List<Event__c>)scope)
     GCalendarUtil.doApiCall(null,'DELETE','https://www.googleapis.com/calendar/v3/calendars/'+CalendarId+'/events/'+c.name,accessToken);
       
        
        delete scope;
        }
    public void finish(Database.BatchableContext BC){   
      for(CalendarSettings__c c: [Select Id, Name, CalendarId__c,CalendarQuery__c,FieldToDisplay__c from CalendarSettings__c])
         {  BatchPublicCampaignsToGoogle bjob = new BatchPublicCampaignsToGoogle(c.CalendarQuery__c,c.CalendarId__c,c.FieldToDisplay__c);
            Database.executeBatch(bjob,9); // This is set to process 9 records, allowing 1 extra callout for refresh token in case needed.
        }
        }
        
        }

 

 

and i am running it with batch of 9

 

BatchDeleteEvents del = new BatchDeleteEvents(c.CalendarId__c,accessToken);
Database.executeBatch(del,9);

 

and i am facing error

FATAL_ERROR|System.DmlException: Delete failed. First exception on row 0 with id a0290000007fCbEAAU; first error: ENTITY_IS_DELETED, entity is deleted: []

Class.BatchDeleteEvents.execute: line 26, column 1

there is no place where i am using delete command why i am facing this error any one please help ??

I have been working on salesforce cloud for the last couple of months. I met a client interested in making an app. I suggested to him that we can build it using cloud computing, but he argue that using cloud computing is costly so we should use dedicated server. I read many articles some are saying its not cutting the cost of app but its increasing. I want to know using cloud computing specially salesforce cloud. Will it increase the production for example its making development easy, so easy the development you can very fast develop the app only or it reduces the cost of hosting or increasing the cost of hosting ??please give some guideline on cost affected for hosting the app increases or decreases ??

 

i am writing a visualforce in which i am using dynamic components my visualforce code is

<apex:pagetitle="Salesforce SOQL Offset Example Using Visualforce"standardStylesheets="false"controller="dynamic_visualforce_with_soql_offset"sidebar="false"readOnly="true"cache="false"showHeader="false"><scriptsrc="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><scriptsrc="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script><scripttype="text/javascript">$(function(){$("[id$=prev]").click(function(){alert('Hello World');});});</script><apex:sectionHeadersubtitle="SOQL Offset Example w/Dynamic Page Buttons"title="Square Root Table"/><apex:form><apex:pageBlock><apex:actionFunctionaction="{!refreshGrid}"name="queryByPage"reRender="myPanel,myButtons"><apex:paramname="firstParam"assignTo="{!selectedPage}"value=""/></apex:actionFunction><apex:dynamicComponentcomponentValue="{!myCommandButtons}"/><apex:pageBlockSectiontitle="Numbers and their Square Roots (Total List Size: {!total_size})"collapsible="false"><apex:outputPanelid="myPanel"><apex:pageMessagesid="theMessages"/><apex:pageBlockTablevalue="{!numbers}"var="n"align="center"><apex:columnvalue="{!n.Id}"/><apex:columnvalue="{!n.Name}"/><apex:facetname="footer">Showing Page # {!pageNumber} of {!totalPages}</apex:facet></apex:pageBlockTable></apex:outputPanel></apex:pageBlockSection></apex:pageBlock></apex:form></apex:page>

and segment for generating dynamic component is

 

i created a custom object with name Meeting Master in this i have to create a custom formula text field value of this custom field hould be name of owner of this record i select formula then field type to text after that when formula window come 

then i write OwnerId its a correct field but when i write Owner.name it is saying owner is not a valid field??please tell the formula how to set value of formula field to owner name??

i am testing my rest api its working fine i tested on a tool and send request and getting expeected result but when i am testing it with this class its giving me error

 

global class Feedpost9 {

// your methods here...

static testMethod void testRest() {
// set up the request object
System.RestContext.request = new RestRequest();
RestContext.request.requestURI = '/v.9/notifications/preferences/ritesh';
// Invoke the method directly
Member__c member=new Member__c(name='ritesh');
insert member;

Notification_Settings__c no=new Notification_Settings__c(member__c=member.Id);
no.Event__c='Category|Cloud Foundry' ;
no.Event_Per_Member__c='12';
insert no;

NotificationRestService.retrievingNotificationSettings();

//RestContext.request.requestURI = '/v.9/notifications/preferences/rashmi.xml' ;

NotificationRestService.retrievingNotificationSettings();
RestContext.request.requestURI ='/v.9/notifications/preferences/ritesh.xml';
NotificationRestService.retrievingNotificationSettings();

RestContext.request.requestURI='/v.9/notifications/preferences/ritesh.xml';
RestContext.request.addparameter('fields','id,name,Do_Not_Notify__c,Event__c,Event_Per_Member__c,Notification_Method__c,Member__r');
NotificationRestService.retrievingNotificationSettings();
System.RestContext.request=new RestRequest();
RestContext.request.requestURI='/v.9/notifications/preferences/rashmi';
NotificationRestService.retrievingNotificationSettings();
}
}

 

 

i am getting error in testing at this line

 

 

RestContext.request.requestURI='/v.9/notifications/preferences/rashmi';
NotificationRestService.retrievingNotificationSettings();

 

and segment of my RestService class is

@RestResource(urlMapping='/v.9/notifications/preferences/*')
global class NotificationRestService
{
@HttpGet
global static String retrievingNotificationSettings(){

RestRequest req=RestContext.request;

RestResponse res=RestContext.response;

List<Notification_Settings__c> note1=new List<Notification_Settings__c>();
note1.addAll([SELECT id,name,Member__r.name,Do_not_Notify__c,Event__c,Event_Per_Member__c,Notification_Method__c from Notification_Settings__c WHERE

note1.clear();

Member__r.name= :userName Limit 1]);

if( note1.size() >0 )
{
note=note1.get(0);
}

 

in line note1.size() i am getting Null pointer exception when i check for wheather note1.is null or not then its passing and showing that note1 is not null if i change this if statement to 

if(note1!=null){

if(note1.size() >0)

note=note1.get(0);}

 

if i omit conditional if statement then and call directly note1.get(0) then i am getting index out of bound exception expecting NullPointer excetion. can any one please explain weired behaviour of List class in testing when i run this url its work fine no null pointer exception i know size of list is zero but i am checking for negative case in testing there should be no null pointer exception i think please explain this behaviour of List class??

i have a class in dev org with code is

 

name of class is ManageRules.cls

 

/**
* This class is used for creating and editing Rule
**/

public with sharing class ManageRules{
public Rule__c newrule {get;set;}
public String objType {get;set;}
public string SearchEvalRule {get;set;}
public string Descr {get;set;}
public List<SelectOption> objOptions {get;set;}
// public String descr {get;set;}
public boolean edit {get;set;}
String ruleId;

public ManageRules(Apexpages.StandardController stdcon){
ruleId = stdcon.getId();
newrule = new Rule__c();
objOptions = new List<SelectOption>();

edit=false;
/**
* Add standard Objects
*/
objOptions.add(new SelectOption('',''));
objOptions.add(new SelectOption('Account','Account'));
objOptions.add(new SelectOption('Contact','Contact'));
objOptions.add(new SelectOption('Opportunity','Opportunity'));
objOptions.add(new SelectOption('Case','Case'));
objOptions.add(new SelectOption('Lead','Lead'));
objOptions.add(new SelectOption('Campaign','Campaign'));
objOptions.add(new SelectOption('Quote','Quote'));
objOptions.add(new SelectOption('Product2','Product'));
//objOptions.add(new SelectOption('ForeCast','Forecast'));

Map<String, Schema.SObjectType> mapObj = Schema.getGlobalDescribe();
for(String objname:mapObj.keySet()){
Schema.SObjectType sobj = mapObj.get(objname);
Schema.DescribeSObjectResult descRes = sobj.getDescribe();
/**
* Add custom objects
*/
if(descRes.isCustom() && !descRes.isCustomSetting()){
String objLabel = descRes.getLabel();
objOptions.add(new SelectOption(objName,objLabel));
}
}

/* Edit Rule */
if(ruleId!=null){
edit=true;
newrule = [select name,object__c,Rule_Execution_Plan__c,Available__c,Evaluation_Rule__c,Description__c from rule__c where id=:ruleId];
if(newrule!=null){
objtype=newrule.object__c;
Descr =newrule.Description__c;
SearchEvalRule =newrule.Evaluation_Rule__c ;

}
}

}

Public List<SelectOption> getEvalRule() {

List<selectOption> options = new List<selectOption>();
options.add(new selectOption('', '- None -'));
Schema.DescribeFieldResult field = Rule__c.Evaluation_Rule__c.getDescribe();
for (Schema.Picklistentry picklistEntry : field.getPicklistValues())
{
options.add(new SelectOption(pickListEntry.getValue(),pickListEntry.getLabel()));
}
return options;

}
public PageReference saveRule(){
newrule.object__c = objtype;
newrule.Evaluation_Rule__c=SearchEvalRule;
newrule.Description__c= Descr;

try{
Database.upsert(newrule);
return(new PageReference('/'+newrule.id));
}
catch(Exception e){
ApexPages.Message msg = new ApexPages.Message(ApexPages.severity.Error,e.getDMLMessage(0));
ApexPages.addMessage(msg);
return null;
}

}

public PageReference saveAndNewRule(){
newrule.object__c = objtype;
newrule.Evaluation_Rule__c=SearchEvalRule;
newrule.Description__c= Descr;
edit=false;
try{
Database.upsert(newrule);
newrule = new Rule__c();
return(new PageReference('/apex/manageRules'));
}
catch(Exception e){
ApexPages.Message msg = new ApexPages.Message(ApexPages.severity.Error,e.getDMLMessage(0));
ApexPages.addMessage(msg);
return null;
}

}


}

 

 

i created an object its giving me error

 

Description Resource Path Location Type
Save error: Rule__c : managerules does not exist or is not a valid override for action Edit. Rule__c.object /RuleCriteria/src/objects line 0 Force.com save problem

 

my Rule__c object code segment is

 

<actionOverrides>
<actionName>Edit</actionName>
<content>ManageRules</content>
<skipRecordTypeSelect>false</skipRecordTypeSelect>
<type>Visualforce</type>
</actionOverrides>

 

i am unable to figure why its showing me this error its an existing project so i have to deploy it on my dev org .on others org its working perfectly fine.i first i remove actionOverride tag from object and save it to my org then i save class code it is also working fine and after that i add this code segment in my object code  and then try to save this object code and getting this error.can any one please how to resolve this issue??