• cantchanand
  • NEWBIE
  • 80 Points
  • Member since 2008

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

HI all

 

i'm planning to do sfdc dev401 exam by next week. please give me some useful sites to prepare

 

Hi I am getting the following  exception when I  try to run a test class.

I just remove the key based in condition from Map

 

So how to deal with this.

 

 

System.FinalException: Cannot modify a collection while it is being iterated

 

 

plz plz  reply   any one

 

 

 

 

  • January 19, 2011
  • Like
  • 0

Error: Compile Error: Initial term of field expression must be a concrete SObject: LIST<purchase_order_lines__c> at line 5 column 14

 

trigger MyFirstObjectTrigger on purchase_order_lines__c (after update) {

public purchase_order_lines__c[] pol=Trigger.new;

Integer diff=pol.received_quantity__c;

for (integer i=0 ;i<diff;i++){
Product_serial__c  obj = new Product_serial__c(product__c=pol.product__c,purchase_order_receipt__c=pol.purchase_order_receipt__c);
insert obj;
}

}

 

can anyone tell me how to resolve this error?????plz............

Hello,

When a  partner portal user saves an opportunity, I need to check whether that opportunity has a associated pricebook or not. If not, then pricebook shared with partner portal user role should be attached to opportunity.

 

I am not sure how to get the pricebook id for partner portal user. Please help.

 

Thanks in Advance,

Anand

Hello All,

 

I want to create Reminder Functionality using Workflow and Trigger. I want to send reminder every day upto 10 Days to Registered user for login on their portal.

 

For that i created Trigger to send the SMS reminder and I created a time based workflow to run on Given date. But problem i am facing that it run only for first day.

 

Kindly  help.

 

 

Hi,

 

I am extracting data from salesforce using dataloader command line interface.

 

Is there any way to change the delimiter to PIPE "|" rather than the comma "," in the output file? We want the generated file to be PIPE separated as the external system where we intent to use this file understands "|" as delimiter.

 

Please advice. 

 

Thanks

Anand Singh

 

Hi All,

          Can you explain me in which below mentioned scenario extension controller is used:

         

          1) StandaredController with ExtensioController

           2)Controller and Extensioncontroller

 

          Can you also tell me the difference in both Regarding Workflow:

 

          a)When a record is created, or when a record is edited and did not previously meet the rule criteria

          b)Every time a record is created or edited

 

    With Regards

    Prabhash Mishra

Hi

 

     I want to split Visual Force Page in 4 parts to display information

 

    Header , Centre (in 2 parts) , Footer

 

Thanks

Hi:

 

Can anyone provide a test class for this trigger that might work?  Thanks!

 

trigger UpdateCustomServicesBillingInvoiceObject_Trigger on Lead (after update) {

  Map<Id, Lead> leadMap = new Map<Id,Lead>();
  Lead parent;
 
  for (Integer i = 0; i < Trigger.new.size(); i++){
    if (Trigger.new[i].IsConverted == true && Trigger.old[i].isConverted == false) {
      leadMap.put( Trigger.new[i].Id, Trigger.new[i]);
    }
  }
   
  if( leadMap.size() > 0 ) {
      Set<Id> leadIds = leadMap.keySet();
      List<Custom_Services_Billing_Invoice__c> allChildren =
        [select Id, Account__c, Lead__c from Custom_Services_Billing_Invoice__c where lead__c in :leadIds];      
 
 System.debug(allChildren);
   
      for ( Custom_Services_Billing_Invoice__c child : allChildren ) {
        if ( leadMap.containsKey( child.Lead__c ) ) {
           parent = leadMap.get( child.Lead__c );
           child.account__c = parent.ConvertedAccountId;
        }
      }

System.debug(allChildren);

      update allChildren;

     
  }
}

 

HI all

 

i'm planning to do sfdc dev401 exam by next week. please give me some useful sites to prepare

Hi all,

 

I'm just starting Apex coding to try and get some custom functionality. I created a custom object called Settings__c in which I want to hold user configurable settings. There should only ever be one record there. I'm making a custom VF page to allow users to modify the settings.

 

I want my custom VF page to display the current settings. If a settings record does not exist, I want the code to insert a new record and populate it with the values from the form. If an existing record exists I want the form to  update the settings.

 

The problem is that the command button doesn't seem to do anything. I deleted all the records from my custom object so my understanding of the code I have written is that it should execute the insert statement resulting in a new record. But when I check, no record is created. I don't know why, can anyone tell me what the coding error is?

 

Controller code:

 

 

public class Settings {

  //Settings variables
  public String URL {get; set;}
  public ID SettingID{get; set;}
  
  //Constructor
  public Settings() {
    
    //Return list of settings
    list<Settings__c> settings = [select ID,URL__c from Settings__c limit 1];
    
    //Check for existing settings record
    if (!settings.isempty()) {
      //If one exists, loop through and assign settings variables
      for (Settings__c a : settings) {
        SettingID = a.ID;
        URL = a.URL__c;
      }
    }
  }
  
  //Save settings
  public void save() {

    //Check for existing settings record indicated by presence of SettingID
    if (SettingID == null) {
      //Create a new record
      Settings__c newSettings = new Settings__c(URL__c = URL);
        
        try {
            Insert newSettings;
        } catch (DMLException e) {
            newSettings.addError('There was a problem adding the settings. The error message returned is: ' + e.getMessage());
        }
    } else {
      //Update the existing settings record
      Settings__c updateSettings = new Settings__c(URL__c = URL);
        
        try {
            update updateSettings;
        } catch (DMLException e) {
            updateSettings.addError('There was a problem updating the settings. The error message returned is: ' + e.getMessage());
        }
    }
  }
}

 VF page code

 

 

<apex:page controller="Settings">
<apex:form >
  <apex:outputlabel value="URL"/>
  <apex:inputtext value="{!URL}"/>
  <apex:outputlabel value="Default Status"/>
  <apex:inputtext value="{!DefaultStatus}"/>
  <apex:inputText value="{!SettingID}"/>
  <apex:commandButton action="{!save}" value="Save Settings"/>
</apex:form>    
</apex:page>

 

 

 

  • April 27, 2011
  • Like
  • 0

I was thinking of modifying the "New Task" page and "Task Detail" page to give it a sales engineering look and feel.

 

Is there a way to copy the code from the New Task page so that I can edit the label and then save it as a new page called Sales Engineer proposal request page.

 

I also need to create a button that will be placed on the opportunity page that lets the owner request a quote proposal which would create a new "sales engineering proposal request" task.

 

Is there sample code somewhere on how to create a button that calls a new custom page?

 

Thanks

  • April 19, 2011
  • Like
  • 0

Hi guys, 

Can any one show me how to write this kind of text (Account)  in Page PDF ? 
Currently I can produce this view in HTML page only.

I am really appriciated to any idea of yall. 

 

Hi I am getting the following  exception when I  try to run a test class.

I just remove the key based in condition from Map

 

So how to deal with this.

 

 

System.FinalException: Cannot modify a collection while it is being iterated

 

 

plz plz  reply   any one

 

 

 

 

  • January 19, 2011
  • Like
  • 0

Hi All,

 

I have two object. First one is standard object"object A" and Second one is custom object "object B". Both object have a parent-child relationship. Object A is parent and Object B is child. I have a standard "New" button on custom object "object B".

 

I want to override the New button functionality. if anyone will try to create the "object B" by  "New" button directly then he can't do this. We can only create the "object B" through the "object A". In "object A", there is one button for "object B". So only by this button anyone can create the object B.

 

For this purpose i am trying to override the New button functionality of "Object B" by VF page and JavaScript but i am not getting any solution because in every case URL is repeting so my loop is not checking condition.

 

Please help me to findout the solution ASAP. Thanks in advance!

 

 

 

Error: Compile Error: Initial term of field expression must be a concrete SObject: LIST<purchase_order_lines__c> at line 5 column 14

 

trigger MyFirstObjectTrigger on purchase_order_lines__c (after update) {

public purchase_order_lines__c[] pol=Trigger.new;

Integer diff=pol.received_quantity__c;

for (integer i=0 ;i<diff;i++){
Product_serial__c  obj = new Product_serial__c(product__c=pol.product__c,purchase_order_receipt__c=pol.purchase_order_receipt__c);
insert obj;
}

}

 

can anyone tell me how to resolve this error?????plz............

Hello,

When a  partner portal user saves an opportunity, I need to check whether that opportunity has a associated pricebook or not. If not, then pricebook shared with partner portal user role should be attached to opportunity.

 

I am not sure how to get the pricebook id for partner portal user. Please help.

 

Thanks in Advance,

Anand

Hello Everyone,

I am very new to Salesforce.com, I need to read and write a CSV file using Apex code.

Functionality wants to implement : Read some records using query and write into a excel file and
read a CSV file and insert records into database.
this should be using apex code.

Please help me :)

Thanks