• Jonathan Wallace
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 18
    Replies
Hi,

I'm trying to figure out the best way to present the fields on a table to our end users so they have an understanding of what the fields are. 
I can export all of the field metadata by object thanks to the Config Workbook, but there is too much data for the standard user. I would like to be able to query the data myself. Also, I need to make this process dynamic so we can run it whenever we need to and it's the most up to date. 

I've done a lot of searching and I can't really find the best solution. Any help would be much appreciated! 
 
Hello,

Before I spend a ton of time researching the plausibility of what we want to do I wanted to ask the forum. 

We have many attachments on the Opportunity object, and part of our process when we close opportunities is to print all the attachments associated. 
Due to the clunkiness of printing each attachment it takes quite a bit of time to do this. Is it possible to print all the attachments from a visualforce page thats called by a button click? 

I've read similar requests but I haven't seen if it's actually plausible.

thanks in advance! 
I have a trigger that fires when an opportunity is closed, I'm using the IsClosed boolean. However i've noticed that opportunities that are set to "Awarded"  don't trigger when they are changed to closed. I'm thinking that this is because the flag has already been triggered with the "IsWon" boolean. Is there anyway to reset the flag ? 
here is my trigger.
trigger ClosedOpportunityTrigger on Opportunity (before insert, before update) {
    for(Opportunity opp : Trigger.New) {
        Id closedBy; // defaults to null
        
        Date closedOn;                                                                                                                                        
        
        if (opp.IsClosed) {
            // set closed by to last modified user
            closedBy = opp.LastModifiedById;
            closedOn = opp.LastModifiedDate.date();
            
            // reset closed by to original user if record already closed
            // handles when user changes another field but leaves Opp closed
            if (Trigger.isUpdate) {
                Opportunity old = Trigger.OldMap.get(opp.Id);
                if (old.IsClosed == opp.IsClosed) {
                    closedBy = old.Closed_By__c;
                    closedOn = old.Closed_date__c;
                }
            }   
        } 
        // setting these values here handle re-opening Opp
        opp.Closed_By__c = closedBy;
        opp.Closed_date__c = closedOn;
    }
}

 
New to triggers, and i've finally got my trigger working as needed in the sandbox. 
here it is .. 
 
trigger ClosedOpportunityTrigger on Opportunity (before insert, before update) {
    for(Opportunity opp : Trigger.New) {
        Id closedBy; 
        
        Date closedOn = opp.CreatedDate.date(); 
        
        if (opp.IsClosed) {
          
            closedBy = opp.LastModifiedById;
            closedOn = opp.LastModifiedDate.date();
            
  
            if (Trigger.isUpdate) {
                Opportunity old = Trigger.OldMap.get(opp.Id);
                if (old.IsClosed == opp.IsClosed) {
                    closedBy = old.Closed_By__c;
                    closedOn = old.CloseDate;
                }
            }   
        } 
        opp.Closed_By__c = closedBy;
        opp.CloseDate = closedOn;
    }
}
My test class isn't working, i'm getting "Your ClassID property is missing or null" error from Force IDE
here is my class
@isTest

public class OppCloseDateTest {

    static testMethod void TestChangeOpportunityClosedby() {
       
      Opportunity opp = new Opportunity();
       
      opp.Name= 'Opportunity';
      opp.StageName='Closed Grant';
      opp.CloseDate=System.today();
                                       
        Update opp;
        
        
        

    
    }
    
}

Please let me know if there is something i'm missing, i'm still learning 

 
Hello, 

new to Triggers, we want to populate a custom lookup field with the current user when an opportunity is closed. 

For example, we have a custom field called closed_by__c which is a lookup to the user object. When a user selects "Closed" from the standard stagename field we want to have the users name populated in the closed_by__c 

I've spent a ton of time looking through the forums but I haven't come across somebody with the same situation. 

any thoughts on how to do this ?
here is what I started with
trigger updateClosedByField on Opportunity (after insert, after update){
for(opportunity opp : trigger.new) 
 
 {
 
    opp.closed_by__c = opp.StageName;
    }
    
    }

 
we currently have a button that opens a static list of reports, what i would like to do is have a "location" be static, and be able to change what report is in that location without having to recode the button everytime. Any ideas? 
Hello, I'm a visualforce newbie, so be kind :). My org wanted to have conditional fields appear based on a picklist choice. I was able to accomplish this,  however I want to change the checkboxes that appear to outputfields after they have either been checked or after the quick save button has been clicked. I've tried a few different options and I haven't been able to accomplish this. I'm using the opportunity standard controller.
here is my code:

<apex:page standardController="opportunity">
   <apex:form >
   <apex:pageBlock >     
   <apex:pageblockButtons location="bottom">
   <apex:commandButton action="{!QuickSave}" value="Quick Save" rendered="{!opportunity.type = 'Program Improvement'}"/>
   </apex:pageblockButtons>
  <apex:pageBlockSection columns="1" collapsible="false" >
  <apex:inputField value="{!opportunity.type}">
  <apex:actionSupport event="onchange"  action="{!quicksave}" />
  </apex:inputField>
  <apex:inputField value="{!opportunity.Program_Improvement_Expansion__c}" rendered="{!opportunity.type = 'Program Improvement' }"/>
  <apex:inputField value="{!opportunity.Program_Improvement_Policies_Practices__c}" rendered="{!opportunity.type = 'Program Improvement'}"/>
  <apex:inputField value="{!opportunity.Program_Improvement_Skills_Training__c}" rendered="{!opportunity.type = 'Program Improvement'}"/>
  <apex:inputField value="{!opportunity.Program_Improvement_Equipment__c}" rendered="{!opportunity.type = 'Program Improvement'}"/>
  </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
 </apex:page>
  
Hello,

Before I spend a ton of time researching the plausibility of what we want to do I wanted to ask the forum. 

We have many attachments on the Opportunity object, and part of our process when we close opportunities is to print all the attachments associated. 
Due to the clunkiness of printing each attachment it takes quite a bit of time to do this. Is it possible to print all the attachments from a visualforce page thats called by a button click? 

I've read similar requests but I haven't seen if it's actually plausible.

thanks in advance! 
New to triggers, and i've finally got my trigger working as needed in the sandbox. 
here it is .. 
 
trigger ClosedOpportunityTrigger on Opportunity (before insert, before update) {
    for(Opportunity opp : Trigger.New) {
        Id closedBy; 
        
        Date closedOn = opp.CreatedDate.date(); 
        
        if (opp.IsClosed) {
          
            closedBy = opp.LastModifiedById;
            closedOn = opp.LastModifiedDate.date();
            
  
            if (Trigger.isUpdate) {
                Opportunity old = Trigger.OldMap.get(opp.Id);
                if (old.IsClosed == opp.IsClosed) {
                    closedBy = old.Closed_By__c;
                    closedOn = old.CloseDate;
                }
            }   
        } 
        opp.Closed_By__c = closedBy;
        opp.CloseDate = closedOn;
    }
}
My test class isn't working, i'm getting "Your ClassID property is missing or null" error from Force IDE
here is my class
@isTest

public class OppCloseDateTest {

    static testMethod void TestChangeOpportunityClosedby() {
       
      Opportunity opp = new Opportunity();
       
      opp.Name= 'Opportunity';
      opp.StageName='Closed Grant';
      opp.CloseDate=System.today();
                                       
        Update opp;
        
        
        

    
    }
    
}

Please let me know if there is something i'm missing, i'm still learning 

 
Hello, 

new to Triggers, we want to populate a custom lookup field with the current user when an opportunity is closed. 

For example, we have a custom field called closed_by__c which is a lookup to the user object. When a user selects "Closed" from the standard stagename field we want to have the users name populated in the closed_by__c 

I've spent a ton of time looking through the forums but I haven't come across somebody with the same situation. 

any thoughts on how to do this ?
here is what I started with
trigger updateClosedByField on Opportunity (after insert, after update){
for(opportunity opp : trigger.new) 
 
 {
 
    opp.closed_by__c = opp.StageName;
    }
    
    }

 
we currently have a button that opens a static list of reports, what i would like to do is have a "location" be static, and be able to change what report is in that location without having to recode the button everytime. Any ideas? 
Hello, I'm a visualforce newbie, so be kind :). My org wanted to have conditional fields appear based on a picklist choice. I was able to accomplish this,  however I want to change the checkboxes that appear to outputfields after they have either been checked or after the quick save button has been clicked. I've tried a few different options and I haven't been able to accomplish this. I'm using the opportunity standard controller.
here is my code:

<apex:page standardController="opportunity">
   <apex:form >
   <apex:pageBlock >     
   <apex:pageblockButtons location="bottom">
   <apex:commandButton action="{!QuickSave}" value="Quick Save" rendered="{!opportunity.type = 'Program Improvement'}"/>
   </apex:pageblockButtons>
  <apex:pageBlockSection columns="1" collapsible="false" >
  <apex:inputField value="{!opportunity.type}">
  <apex:actionSupport event="onchange"  action="{!quicksave}" />
  </apex:inputField>
  <apex:inputField value="{!opportunity.Program_Improvement_Expansion__c}" rendered="{!opportunity.type = 'Program Improvement' }"/>
  <apex:inputField value="{!opportunity.Program_Improvement_Policies_Practices__c}" rendered="{!opportunity.type = 'Program Improvement'}"/>
  <apex:inputField value="{!opportunity.Program_Improvement_Skills_Training__c}" rendered="{!opportunity.type = 'Program Improvement'}"/>
  <apex:inputField value="{!opportunity.Program_Improvement_Equipment__c}" rendered="{!opportunity.type = 'Program Improvement'}"/>
  </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
 </apex:page>