• Hobie
  • NEWBIE
  • 0 Points
  • Member since 2008
  • Director of Training & Support Services
  • EQD

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 11
    Replies
I have a Custom Button that is on a Custom Object called Reviewer that will update a checkbox called "On Project" back on a Contact record.  I need a little help putting this on the List View of the Custom Object called Reviewer.  Is this possible?

Thank you very much for your help!  My code is below. 

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 

var selectedReviewers = 
{!GETRECORDIDS("Contact")}; 

if(selectedReviewers.length > 0){ 
var reviewersToUpdate = []; 
for(var i=0; i<selectedReviewers.length; i++){ 
var updatedReviewer = 
new sforce.SObject("Contact"); 

updatedReviewer.Id = selectedReviewers[i]; 
updatedReviewer.On_Project__c = '1'; 

reveiwersToUpdate.push(updatedReviewer); 


var result = 
sforce.connection.update(reviewersToUpdate); 

location.reload(); 

else{ 
alert( 
"Please select at-least one record." 
); 
}
  • July 06, 2016
  • Like
  • 0
I'm trying to modify the code from Grid Buddy to put this VF page at the bottom of the Related List section.  
Here is the original code that works great:


<apex:page standardController="Opportunity" sidebar="false" showHeader="false">
    <apex:variable var="gridPage" value="{!URLFOR($Page.GBFree__Grid)}" />
    <apex:variable var="gridPage" value="{!gridPage & IF(CONTAINS(gridPage, '?'), '&', '?')}" />
    <iframe id="gridFrame" scrolling="auto" height="480" width="100%" frameborder="0" src="{!gridPage}gname=Add Reviewers to Opportunity&id={!Opportunity.Id}&sbb=1&sh=0&ssb=0"></iframe>
</apex:page>

I tried using the apex:detail statement and received errors.  Can someone give me a hand with this?  Thank you!
  • August 20, 2015
  • Like
  • 0
Does anyone have any experience with Salesforce and Chain of Custody forms?  We are looking at creating a process that will eliminate our paper forms and make them totally electronic.  

We currently have DocuSign integrated and could possible have our developers create an app that would utllize this process.  A Chain of Custody form is a living document that travels with data. 
  • May 08, 2015
  • Like
  • 0
I do not have Flow Triggers installed in my Org.  I have written a Headless Flow and need to just have it run in the background when a user enters a Case No on an Opportunity Record.

Is this possible?  Thanks so much as I'm not a developer!  
  • August 12, 2014
  • Like
  • 0

I have a trigger that works when adding and deleting records, it is not firing when updating a record.

 

Below is the trigger.  Thanks for your help!

 

trigger ContactsOnAccount on Contact (after insert, after delete,after undelete,after update) {

    Set<Id> aId = new Set<Id>();
    
    if(Trigger.isInsert || Trigger.isUndelete){
        for(Contact opp : Trigger.New){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,Total_Number_of_Contacts__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        for(Account a : acc){
            a.Total_Number_of_Contacts__c=con.size();
            
        }update acc;
    }
    
    if(Trigger.isDelete){
        for(Contact opp : Trigger.old){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,Total_Number_of_Contacts__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        for(Account a : acc){
            a.Total_Number_of_Contacts__c=con.size();
            
        }update acc;
    }
   
    if(Trigger.isUpdate){
       Set<Id> OldAId = new Set<Id>(); 
        for(Contact opp : Trigger.new){
        if(opp.AccountId != Trigger.oldMap.get(opp.id).AccountId || opp.Primary_Contact__c != Trigger.oldMap.get(opp.id).Primary_Contact__c)
            aId.add(opp.AccountId);
            OldAId.add(Trigger.oldMap.get(opp.id).AccountId);
        
        }
        if(!aId.isEmpty()){
        //for new Accounts
        List<Account> acc = [select id,Total_Number_of_Contacts__c from Account where Id in:aId];
        //For New Account Contacts
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        /*
        This is For Old Contacts Count
                              */
        
        //for Old Accounts
        List<Account> Oldacc = [select id,Total_Number_of_Contacts__c from Account where Id in:OldAId];
        
        //For Old Account Contacts
        List<Contact> OldCon = [select id from contact where AccountId in :OldAId];
       
        //For New Accounts
        for(Account a : acc){
            a.Total_Number_of_Contacts__c=con.size();
            
            
        }update acc;
        
        //For Old Accounts
        for(Account a : Oldacc){
            a.Total_Number_of_Contacts__c=OldCon.size();
            
        }update Oldacc;
        }
    }
}

 

 

  • September 04, 2013
  • Like
  • 0

I have a custom field called "Bounced ET email" that is a check box.   I need a trigger to fire and send the user who sync'd the email that the bounced email box is checked (True) on the Contact record.

 

Is this easy to do?  Thanks so much in advance for help!

 

 

  • July 17, 2013
  • Like
  • 0

I'm a newbie just learning to write Apex Code.  I wrote an Apex Trigger to set Type_Of_Activity__c  to equal Type.  This works great:

 

trigger SyncType on Task (before insert, before update){
  Task myTask = trigger.new[0];
        if(myTask.Type != null){
            myTask.Type_of_Activity__c = myTask.Type;
        }
}

 

How do you do this same thing when doing an Event?  I want to set Type_of_Activity__c equal to Event Type.

 

Thanks!

  • April 24, 2013
  • Like
  • 0
I have a Custom Button that is on a Custom Object called Reviewer that will update a checkbox called "On Project" back on a Contact record.  I need a little help putting this on the List View of the Custom Object called Reviewer.  Is this possible?

Thank you very much for your help!  My code is below. 

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 

var selectedReviewers = 
{!GETRECORDIDS("Contact")}; 

if(selectedReviewers.length > 0){ 
var reviewersToUpdate = []; 
for(var i=0; i<selectedReviewers.length; i++){ 
var updatedReviewer = 
new sforce.SObject("Contact"); 

updatedReviewer.Id = selectedReviewers[i]; 
updatedReviewer.On_Project__c = '1'; 

reveiwersToUpdate.push(updatedReviewer); 


var result = 
sforce.connection.update(reviewersToUpdate); 

location.reload(); 

else{ 
alert( 
"Please select at-least one record." 
); 
}
  • July 06, 2016
  • Like
  • 0
I'm trying to modify the code from Grid Buddy to put this VF page at the bottom of the Related List section.  
Here is the original code that works great:


<apex:page standardController="Opportunity" sidebar="false" showHeader="false">
    <apex:variable var="gridPage" value="{!URLFOR($Page.GBFree__Grid)}" />
    <apex:variable var="gridPage" value="{!gridPage & IF(CONTAINS(gridPage, '?'), '&', '?')}" />
    <iframe id="gridFrame" scrolling="auto" height="480" width="100%" frameborder="0" src="{!gridPage}gname=Add Reviewers to Opportunity&id={!Opportunity.Id}&sbb=1&sh=0&ssb=0"></iframe>
</apex:page>

I tried using the apex:detail statement and received errors.  Can someone give me a hand with this?  Thank you!
  • August 20, 2015
  • Like
  • 0
First, I'm not a programmer, but know enough to be dangerous!  This is a Custom List View button on the Contact Record using the DocuSign script.  I'd like to loop around the DocuSign java.

My error is I do not understand how to push the correct SourceID into the DocuSign script from the array that is stored.  I need to send one contact ID (SourceID={!Contact.Id}) to the Page Callout routine below.  

How do I do that or is that even possible?

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")} 

var records = {!GETRECORDIDS($ObjectType.Contact)};
var strIDs=''; 
if (records[0] == null) 

alert('Please select a record'); 

else 

for (var n=0; n<records.length; n++) 

if(strIDs == '') 
strIDs = records[n]; 
else 
strIDs = strIDs + "," + records[n] ; 



{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}
//********* Option Declarations (Do not modify )*********//
var RC = ''; var RSL=''; var RSRO=''; var RROS=''; var CCRM='';
var CCTM=''; var CCNM=''; var CRCL=''; var CRL=''; var OCO='';
var DST=''; var LA=''; var CEM=''; var CES=''; var STB='';
var SSB=''; var SES=''; var SEM=''; var SRS=''; var SCS ='';
var RES=''; 
//*************************************************// 
CRL = 'Email~{!Contact.Email};LastName~{!JSENCODE(Contact.LastName)};Role~A;RoutingOrder~1';
CCRM = 'A~Signer 1';
CCTM = 'A~Signer';
CRCL = '';
OCO = 'Send'; 
DST = 'ABD09037-D838-4FB7-AB14-6C685547DD4B'; 
LA = '0'; 
CEM = ''; 
CES = ''; 
RES = ''; 
CES = '{!JSENCODE(Contact.Name)} - HR Documentation Packet 2015';
CEM = '{!Contact.FirstName},\\n\\nPlease review, complete and sign the attached HR Documentation Packet 2015.\\n\\nKind Regards,\\n{!User.FirstName}\\n\\n{!User.FirstName} {!User.LastName}\\n{!User.Title}\\n\\nMain {!User.Main_Phone__c}\\nDirect {!User.Phone}\\nFax {!User.Fax}';
//********* Page Callout (Do not modify) *********// 
window.location.href = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!Contact.Id}&RC="+RC+"&RSL="+RSL+"&RSRO="+RSRO+"&RROS="+RROS+"&CCRM="+CCRM+"&CCTM="+CCTM+"&CRCL="+CRCL+"&CRL="+CRL+"&OCO="+OCO+"&DST="+DST+"&CCNM="+CCNM+"&LA="+LA+"&CEM="+CEM+"&CES="+CES+"&SRS="+SRS+"&STB="+STB+"&SSB="+SSB+"&SES="+SES+"&SEM="+SEM+"&SRS="+SRS+"&SCS="+SCS+"&RES="+RES;
//*******************************************/

}
}
Does anyone have any experience with Salesforce and Chain of Custody forms?  We are looking at creating a process that will eliminate our paper forms and make them totally electronic.  

We currently have DocuSign integrated and could possible have our developers create an app that would utllize this process.  A Chain of Custody form is a living document that travels with data. 
  • May 08, 2015
  • Like
  • 0
Hi,
I am using a flow to allow a user to edit a record.
I can display the current value of all the fields in the record except for picklists - is there any way to do this?

Also all my picklists in the flow are mandatory - do they have to be?

I have a trigger that works when adding and deleting records, it is not firing when updating a record.

 

Below is the trigger.  Thanks for your help!

 

trigger ContactsOnAccount on Contact (after insert, after delete,after undelete,after update) {

    Set<Id> aId = new Set<Id>();
    
    if(Trigger.isInsert || Trigger.isUndelete){
        for(Contact opp : Trigger.New){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,Total_Number_of_Contacts__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        for(Account a : acc){
            a.Total_Number_of_Contacts__c=con.size();
            
        }update acc;
    }
    
    if(Trigger.isDelete){
        for(Contact opp : Trigger.old){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,Total_Number_of_Contacts__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        for(Account a : acc){
            a.Total_Number_of_Contacts__c=con.size();
            
        }update acc;
    }
   
    if(Trigger.isUpdate){
       Set<Id> OldAId = new Set<Id>(); 
        for(Contact opp : Trigger.new){
        if(opp.AccountId != Trigger.oldMap.get(opp.id).AccountId || opp.Primary_Contact__c != Trigger.oldMap.get(opp.id).Primary_Contact__c)
            aId.add(opp.AccountId);
            OldAId.add(Trigger.oldMap.get(opp.id).AccountId);
        
        }
        if(!aId.isEmpty()){
        //for new Accounts
        List<Account> acc = [select id,Total_Number_of_Contacts__c from Account where Id in:aId];
        //For New Account Contacts
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        /*
        This is For Old Contacts Count
                              */
        
        //for Old Accounts
        List<Account> Oldacc = [select id,Total_Number_of_Contacts__c from Account where Id in:OldAId];
        
        //For Old Account Contacts
        List<Contact> OldCon = [select id from contact where AccountId in :OldAId];
       
        //For New Accounts
        for(Account a : acc){
            a.Total_Number_of_Contacts__c=con.size();
            
            
        }update acc;
        
        //For Old Accounts
        for(Account a : Oldacc){
            a.Total_Number_of_Contacts__c=OldCon.size();
            
        }update Oldacc;
        }
    }
}

 

 

  • September 04, 2013
  • Like
  • 0

Hi,

 I want to display an image from attached file on vf page.

 

//vf

<apex:page standardController="stdCust_obj__c" extensions="displayImageExtension">
<table><tr>
<td><h1>Photo:</h1></td>
<td>
<apex:image url="/servlet/servlet.FileDownload?file=file.Id"/>
</td>
</tr>
</table>
</apex:page>

 

//apex

 

public class displayImageExtension {

private id StCustId;
List<Attachment> file;

 

public displayImageExtension(ApexPages.StandardController stdController) {
this.StCustId = ApexPages.currentPage().getParameters().get('id');
}

public List<Attachment> getfile(){

file=[Select Id,Name,LastModifiedDate from attachment where ParentId=:StCustId];
return file; 
}

 

}

 

Thanks in advance.

  • July 20, 2013
  • Like
  • 0

We are looking to replace our ERP and Syteline seems to be a good fit, but hesitant about the integration with Salesforce.com? 

I'm a newbie just learning to write Apex Code.  I wrote an Apex Trigger to set Type_Of_Activity__c  to equal Type.  This works great:

 

trigger SyncType on Task (before insert, before update){
  Task myTask = trigger.new[0];
        if(myTask.Type != null){
            myTask.Type_of_Activity__c = myTask.Type;
        }
}

 

How do you do this same thing when doing an Event?  I want to set Type_of_Activity__c equal to Event Type.

 

Thanks!

  • April 24, 2013
  • Like
  • 0