• mmrr
  • 5 Points
  • Member since 2011

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 31



I have a simple trigger on the Opportunity object that fires when an Opportunity is edited and forces an edit/save on the OpportunityLineItems associated with the Opportunity.  When I try to Data Load some bulk changes, I get the following error:


System.LimitException: Too many SOQL queries: 101


I'm fairly new to Apex code.  I believe the problem is that I am running SOQL inside a FOR loop, but I'm not quite sure how to resolve it.  My trigger is below.  Any help would be appreciated.  Thanks.



trigger UpdateDeliverables on Opportunity (after insert, after update) {
   // Forces Edit/Save on Deliverables in order to fire Workflow field Update to update quantity field with Q__c value    

FOR(Opportunity opp : Trigger.new)  {

    LIST<OpportunityLineItem> oppLine = [SELECT Id
    FROM OpportunityLineItem
    WHERE OpportunityId = :opp.Id
    AND Flat_Price__c != TRUE];
    IF(oppLine.size() > 0)
    update oppLine;


Hi there,


On opportunities I want to use a picklist field ('Stage') to trigger opening a VF page if a certain value in selected (i.e. Project Lost).


I have already created the VF page (which includes some addtional input fields like who is the winning competitor) but my issue is how can I trigger the VF page to appear / pop-up once 'Project Lost' is selected in the 'stage' field.


I assume I'd have to use Java for this but I have no / not much experience with it.


Does anyone has some sample code or can point me in the right direction?

Help is highly appreciated...

Many thanks!!! 



I would like to know how to store data, after a database query, for using this data in a Ajax script?


I have a custom object. Called "Calendar". I need to store, to collect data from this custom object "Calendar", but i don't know how?


I need to have my data in this 'format' :


{ResourceId: 'LastName FirstName', Type : 'Type_1', Title : 'Type_title', Ip : 'LastName FirstName',  NBapprenants : '10', StartDate : '2011-08-15 09:00:00', EndDate : '2011-08-15 18:00:00'},



I can display this data with a Controller and a Visualforce using apex tags, but i need to store this data for an ajax application.



If somebody can help me?






  • November 09, 2011
  • Like
  • 0


I have Created a Radio Button with options 'YES' & 'NO' .   and created a Multi select picklist field below.

Now my requirement is
1. In Radio button, If YES is selected then picklist values on below has to be enable and give choice to select from the  multi picklist
2. In radio Button, If NO is selected then Picklist values has to be disable. 

Can any one help me to do this functionality. If so it would be helpfull to me.

Suresh Goud

I want to insert OpportunityContactRole into an existing Opportunity in a controller extended from opportunity standard controller.


Below is my code:

/* Set CampaignId */
opportunity.CampaignId = sCampaignId;

OpportunityContactRole oppContactRole = new OpportunityContactRole(ContactId=sId, OpportunityId=opportunity.Id, IsPrimary=false, Role='Economic Decision Maker');
insert oppContactRole;



After I insert oppContactRole, it has ID but I can not access this object and it is not displayed in opportunities contact roles list after the whole action is over. There is no any exception throwed.

BTW: I can update or delete the existing opportunity's OpportunityContactRole.


  • March 15, 2011
  • Like
  • 0

hi guys,

i have a requirement to make a dynamic inputText, where it should disabled or enabled according to the value of a checkbox field in an object, for example:


<apex:inputText value="{!My_Object__c.Quantity__c}" disabled="{!My_Object__c.Disable__c}" />


where Disable__c field is a checkbox field.



but i keep getting this error when i try to insert the My_Object__c.



<apex:inputText> element value must resolve to a String type!



can anyone help me with this?

thank you in advance.





Hi Guys,


          I need help for a functionality in VF page to hide one of two fields based on picklist value in the same page.


             Here we have :     1)Opportunity type (PICKLIST) with options NEW, EXISTING.

                                            2)Opportunity LookUp

  3) Opportunity Name Text Field


Here, i need to disable the Opportunity Lookup if the picklist value is NEW. Sameway, i need to disable Opportunity Name text field, if the piklist value in EXISTING


                                 Please let me know whether i can do this or not,  suggest me the code to disable appropriate fields in my custom object's new record page.



   Tons of Thanks,


I don't see Notes in the Customize menu and I need to add a trigger to a Note object. How can I do it?



I'm new to this site (well SFDC in general).  The company that set up the system for us isn't very helpful, so I was hoping that someone here could help me.


For 2010 I did a mass re-allocation of our accounts, but I soon realised that I would have to set a separate mass change for both Contact & opportunity as the record owners for those do not lookup to the account record owner.  (We want the Contact Owener, Account Owner, & Opportunity Owner to all match)


Is there any way to change it so Contact Owner will lookup to account object and bring back the account record owner instead of looking up to the user object?





  • January 19, 2010
  • Like
  • 0

How can we  redirect a trigger to a standard salesforce URL? Like when the user updates a cutom field in Opportunity, I want him to go to the new Partner reated list page directly when he hits save. Usually you can only see the new partner page only when you click New in Partner subsection from the opportunity details page. But I want to mandate the partner related list page when user selects YES for a custom field in Opportunity page.

Is it possible to fire off a trigger on the Note object and if one can not what is the possible work around for this?





    Hi All! I have two formulas. The first one I created to keep a running ticker of the number of days, hours, & minutes a case has been open. It looks like this:

Text(FLOOR(NOW() - CreatedDate)) &" "&"day(s)"&" "&Text(FLOOR(MOD( (NOW() - CreatedDate) * 24 ,24))) &" "&"hrs"&" "&Text( FLOOR(MOD(((NOW() - CreatedDate) * 24)*60 ,60)))&" "&"min")
The second formula I got off the boards and it keeps track in business hrs the number of hrs a case has been open:

IF(AND(MOD(TODAY()-DATE(1900,1,7),7)< (NOW() - CreatedDate ), ((NOW() - CreatedDate )<7)),((NOW() - CreatedDate)-2) * 24, ((NOW() - CreatedDate)-(2 * ((NOW() - CreatedDate)/7))) * 24)

Both of these formulas work great, however, I would like to have the business hrs formula in the same format as the first formula. So it would be business hrs in days, hrs, and minutes. Does anyone have any ideas?? I keep playing with it but it is always off.