• Michael Bobee
  • NEWBIE
  • 20 Points
  • Member since 2014
  • Salesforce Administrator


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
When a new Opportunity Product record is added to an Opportunity, I would like to take the value from a custom picklist on the selected/associated product and transfer that value to a custom picklist on the Opportunity Product. This would preserve the ability to edit the value if the default picklist value needs to be edited. I explored several workflow/field update options, but because it's a picklist,- it creates some unique challenges. Maybe a trigger?
I have a custom object(ShipTo__c) that has a field (customer_code__c) that holds a value that is common to the account object. When I insert the Ship To record, I would like to use an Apex trigger to get the account id based on the (SELECT id from Account WHERE customer_code__c = XXXX) then populate that value on the custom object to link it to the account object. Am I over-thinking this and should I be joining the tables differently other than trying to SFDC ID's?

trigger SetAccountField on ShipTo__c (before insert, before update) {
    for (ShipTo__c shipto : Trigger.new) {
        String accid = shipto.Customer_Code__c;
        List<Account> account = [SELECT Id FROM Account WHERE Customer_Code__c = :accid];
        shipto.Account__c = account.get(0).Id;
    }
}
 Is it possible to dynamically select a Static Resource based on a user variable to load an image on a Visualforce page? I know it is not a best practice to use conditional logic on a VF page. I want to change a logo on the top of a VF PDF based on the division of the user genrating the PDF. Thank you.
I would like to traverse the relationship between an Opportunity and the ContactRole related list. We only choose one contact for each Opportunity, so there's no need to filter a sub-query. We are rendering a VisualForce page as a PDF, so the intention is to use <apex:outputField value="{!Opportunity ..." - dot notation. The Opportunity is the StandardController. Can a related list be referenced? (<apex:relatedList list="Contacts" ...) This is my second day trying to drink from a fire hose.(I'm getting bloated!) Thank you. Are there any good books to start from ground zero?
I have a custom object(ShipTo__c) that has a field (customer_code__c) that holds a value that is common to the account object. When I insert the Ship To record, I would like to use an Apex trigger to get the account id based on the (SELECT id from Account WHERE customer_code__c = XXXX) then populate that value on the custom object to link it to the account object. Am I over-thinking this and should I be joining the tables differently other than trying to SFDC ID's?

trigger SetAccountField on ShipTo__c (before insert, before update) {
    for (ShipTo__c shipto : Trigger.new) {
        String accid = shipto.Customer_Code__c;
        List<Account> account = [SELECT Id FROM Account WHERE Customer_Code__c = :accid];
        shipto.Account__c = account.get(0).Id;
    }
}
I would like to traverse the relationship between an Opportunity and the ContactRole related list. We only choose one contact for each Opportunity, so there's no need to filter a sub-query. We are rendering a VisualForce page as a PDF, so the intention is to use <apex:outputField value="{!Opportunity ..." - dot notation. The Opportunity is the StandardController. Can a related list be referenced? (<apex:relatedList list="Contacts" ...) This is my second day trying to drink from a fire hose.(I'm getting bloated!) Thank you. Are there any good books to start from ground zero?

Hi,

 

Colleagues are required to add attachments to Opportunities that they do not own, however there is no possible way using standard salesforce functionality to send an email alert to the Opportunity owner.

 

Does anyone know how I can achieve this using triggers?

 

Your help would be much appreciated! Thanks...

  • May 28, 2010
  • Like
  • 0

Hi there,

 

Is it possible to make the standard Close Date field to be NOT required?  I cannot even remove it from the page layout, it does not move.

 

Basically, the Sales users cannot predict when the Oppty would be closed so they are reluctant to enter the Close Date field.

 

Thanks