• lizkshannon
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I have a VF page that was written by a former coworker.  It uses the URLFOR action for a "New" button.

 

<apex:pageBlock >
                <apex:pageBlockButtons >
                    <apex:commandButton value="New" action="{!URLFOR($Action.Case.NewCase)}" />
                </apex:pageBlockButtons>

This is to create a new case in our Partner Portal, but I'd like to default the Contact on the Case to be the Partner User creating the case (like standard behavior on the Customer Portal).  Is there a way to do that here?  I'm trying to get by since our developer left, so any assistance is appreciated.

LKS

Our sandbox was updated to Winter 13 over the weekend, and now the HTML we had in the Messages & Alerts component of the Home Page is displaying as the html code and not the formatted text result.  I tested the html outside of salesforce, and it displays correct.  Nothing changed with the code.  Thoughts/Suggestions for what changed with Winter 13?

 

Thanks!

LizKS

Hi,

 

I'm not a developer, but I'm attempting to learn since I've reached a point where I need code to customize and automate further.  I've created a custom "Sales Price" field for Opportunity Products that I am using to replace the standard Sales Price field.  I want the custom field to default with the price book entry list price (unitprice) value as does the standard Sales Price field.  Then I have the standard Sales Price field getting updated to equal the custom Sales Price times the number of month terms (custom field that will be updated at Opportunity level and automatically populated in reflective custom field on Opportunity Products via trigger).  I've created triggers for both the Sales Price value to default and the Month Terms to default, but neither seems to be working now.   Below is the trigger for the Sales Price value when creating a new opportunity line item.  I could have sworn this worked last Friday and now doesn't.  Not sure how to get the price to default when adding a new product line item?  It should only default when adding new since I don't want it to override any amount that they put in and save. But it also needs to work if they go back into the opp and add additional items later.  Any input on this is greatly appreciated. I've spent hours searching other posts in the community and all the other documentation, but I don't have that natural developer brain, and I'm banging my head now!

 

trigger SalesPricecustom on OpportunityLineItem (before insert) {
    Set<Id> pbeIds = new Set<Id>();
        for (OpportunityLineItem oli : Trigger.new) 
        pbeIds.add(oli.pricebookentryid);
        
    Map<Id, PricebookEntry> entries = new Map<Id, PricebookEntry>(
        [select UnitPrice from pricebookentry 
         where id in :pbeIds]);     
            
for (OpportunityLineItem oli :trigger.new){
     if(pricebookentry.unitprice <> null && oli.sales_price__c == null){
    
    oli.sales_price__c = entries.get(oli.pricebookEntryId).UnitPrice;  
  }
}} 

 

Thanks!

Hi,

 

I'm not a developer, but I'm attempting to learn since I've reached a point where I need code to customize and automate further.  I've created a custom "Sales Price" field for Opportunity Products that I am using to replace the standard Sales Price field.  I want the custom field to default with the price book entry list price (unitprice) value as does the standard Sales Price field.  Then I have the standard Sales Price field getting updated to equal the custom Sales Price times the number of month terms (custom field that will be updated at Opportunity level and automatically populated in reflective custom field on Opportunity Products via trigger).  I've created triggers for both the Sales Price value to default and the Month Terms to default, but neither seems to be working now.   Below is the trigger for the Sales Price value when creating a new opportunity line item.  I could have sworn this worked last Friday and now doesn't.  Not sure how to get the price to default when adding a new product line item?  It should only default when adding new since I don't want it to override any amount that they put in and save. But it also needs to work if they go back into the opp and add additional items later.  Any input on this is greatly appreciated. I've spent hours searching other posts in the community and all the other documentation, but I don't have that natural developer brain, and I'm banging my head now!

 

trigger SalesPricecustom on OpportunityLineItem (before insert) {
    Set<Id> pbeIds = new Set<Id>();
        for (OpportunityLineItem oli : Trigger.new) 
        pbeIds.add(oli.pricebookentryid);
        
    Map<Id, PricebookEntry> entries = new Map<Id, PricebookEntry>(
        [select UnitPrice from pricebookentry 
         where id in :pbeIds]);     
            
for (OpportunityLineItem oli :trigger.new){
     if(pricebookentry.unitprice <> null && oli.sales_price__c == null){
    
    oli.sales_price__c = entries.get(oli.pricebookEntryId).UnitPrice;  
  }
}} 

 

Thanks!