• Prad@SFDC
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 13
    Replies

I'm trying to make a custom edit page for the Contact object. I'm trying to use <apex:inputField value="{!Contact.Account.name}" /> but after saving it does not save the account name. Does anyone have a solution for this?

  • March 20, 2012
  • Like
  • 0
 1	  global class batchTestClass implements database.Batchable<sObject>{
 2	   public String query='';
 3	   public batchTestClass(){
 4	   query ='select id,name,city__c from DataLoad__c';
 5	   }
 6	  
 7	   global Database.QueryLocator start(Database.BatchableContext BC){
 8	   return Database.getQueryLocator(query);
 9	   }
 10	  
 11	   global void execute(Database.BatchableContext BC, List<DataLoad__c> lstD){
 12	   for(Integer i=0;i<lstD.size();i++){
 13	   if(lstD[i].city__c =='hyd'){
 14	   lstD[i].city__c='Banglore';
 15	   }
 16	   }
 17	   update lstD;
 18	   }
 19	  
 20	   global void finish(Database.BatchableContext BC){
 21	   }
 22	  
 23	   public static testmethod void testm1(){
 24	   test.startTest();
 25	   DataLoad__c objD = new DataLoad__c(name='DataLoadTest',city__c='hyd');
 26	   insert objD;
 27	  
 28	   batchTestClass objb = new batchTestClass();
 29	   database.executebatch(objb);
 30	   test.stopTest();
 31	   }
 32	  }

 Why 14th line is not covered.

Hi,

 

I am getting this error "System.LimitException: Too many SOQL queries: 101"   in trigger can any one please help its urgent.

 

trigger TrgUpdateStore on Lead (Before Update) {
    List<Participating_Store__c> storeList=new List<Participating_Store__c>();
    

    map<id,RecordType> Apac_lead_RecordType = new map<id,RecordType>([select id,name from RecordType where sObjectType = 'lead' 
                                                                    and Name IN ('AP Lead','AP Sur')]);
    for(Lead lead:Trigger.new)
    {    
     
        if(!Apac_lead_RecordType.isEmpty() && Apac_lead_RecordType.containsKey(lead.RecordTypeId))
        {
           storeList=[Select Account__c from Participating__c where id=:lead.Associate__c limit 1];
           if(storeList.size()>0){
               lead.Selected__c =storeList[0].Account__c;
               lead.Status='Store Allocated';
           }else{
               lead.Selected_Outlet__c =null;
           }            
        }

    }
}

 

 

Here i need to write the Query out side the for loop can any one suggest me pls urgent.

 

Regards,

Rajesh.

I have a vf page with the pannel bar 

<apex:page>

<apex:panelbar>

<apex:panelbaritem> item1 </apex:panelbaritem>

<apex:panelbaritem> item2 </apex:panelbaritem>

<apex:panelbaritem> item3 </apex:panelbaritem>

</apex:panelbar>

</apex:page>

When i reload the page 1 is open and 2 and 3 close 

but i need  all panel bar items are to be close .

I want to change the background color 

all these panel baritems are in green , i want to change these colors. 

2 issues.

 

1.  var a never gets the actual salesforce 15 digit id for the custom object "Location__c". How do I get this value?

2. When I build the query I ge the message "unexpected token".  How do I use a variable like "a" in a query statement such as below?:

 

 

{!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")}

 

var a = {!Location__c.Id}

var result = sforce.connection.query("SELECT Id FROM Promo_Material_Snapshot__c"+
" WHERE Location__c = a limit 1")

 

var records = result.getArray("records")

var IdsToClone = String(records[0]).substring(40, 55)

 

window.open("/"+IdsToClone +"/e?clone=1&retURL=/"+IdsToClone )

Hi Guys,

 

while generating apex class from wsdl i am getting this error.

 

Apex Generation Failed

Unsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType

 

Thanks,

Bujji

  • March 22, 2012
  • Like
  • 0

Hi All,

 

On my custom "add opportunity product" VFpage I currentyl call a method in my custom controller (priceBookCheck) in the page action.

 

This works fine but I now need to add an if statment to the page action to ensure that the system administrator can only run the new VF page.

 

The following works:-

action="{!if(($Profile.Name == 'System Administrator'),
null,
urlFor($Action.OpportunityLineItem.AddProduct, Opportunity.Id,
null, true))}">

 

But I need to call the priceBookCheck method when the if statement is true. I have tried the following but get a syntax error

 

action="{!if(($Profile.Name == 'System Administrator'),
{!priceBookCheck},
urlFor($Action.OpportunityLineItem.AddProduct, Opportunity.Id,
null, true))}">

 

Does anyone know how to accompkish my goal?

 

Thanks

I'm trying to make a custom edit page for the Contact object. I'm trying to use <apex:inputField value="{!Contact.Account.name}" /> but after saving it does not save the account name. Does anyone have a solution for this?

  • March 20, 2012
  • Like
  • 0

Hi all,

 

How to create alert popups when inputText is empty using Apex class?

 

can u please help me and give with example....

 

 

Thanks for u r help......