• Ed055
  • NEWBIE
  • 235 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 65
    Questions
  • 46
    Replies
Hi all  -  I need help with apex and soql
Account object has a custom date field called "Last followup"
I would like to update this field on insert/edit/update/delete of CONTACT. I have a contact trigger and "Last followup" needs to be updated in this trigger
"Last followup" field on account object should be updated with  MAX of  ActivityDate field FROM  ActivityHistories object.of all contacts tied to that account.. As per my understanding, ActivityHistories  records can only be queried as a subquery.

Thanks for help


 
  • April 07, 2017
  • Like
  • 0
Hi All -  I need help coding custom VF page.  
Users will come to this VF page(AssignContact) with url something like apex/AssignContact?ID=066540000000XzK
The ID that is passed in the URL is one of  the record  in my custom object(Team__c)
On this custom VF page I need a Contact lookup field which the users can lookup a particular contact , select and click save button
when users click save I would like the contact record that user selected be added to my  custom object(Team) 
Thanks for your help.  




 
  • April 06, 2017
  • Like
  • 0
I'm trying to create a custom link button with "execute javascript" behavior. I'm getting error on line 
var cont = records[0].top_firm__r.Coverage_Channel__c;

Coverage_Channel__c is a picklist type field. Query using dev console does not throw an error and there is a value in that field. Also, I see values by doing the console.log(records );  I'm not quite sure why it throws  error "cannot read property 'Coerage_Channel__c' of undefined "
 
{!REQUIRESCRIPT("/soap/ajax/34.0/connection.js")}

 
    var result = sforce.connection.query(
        "SELECT Name,top_firm__r.Coverage_Channel__c " + 
        "FROM Contact " + 
        "WHERE Id = '{!Contact.Id}' " 
    );

    var records = result.getArray("records");

 
    if(records.length != 0){
        var cont = records[0].top_firm__r.Coverage_Channel__c;
window.top.location.href="someting........";
        }

 
  • March 02, 2017
  • Like
  • 0
I have installed a custom app and that installed lot of custom objects. I'm trying to update a particuar field manually and all I have is api name of that field. I cannot find that field in custom objects . I looked at the wsdl and found that field  belongs to somne object which is defined as complex type and that object name is api name.

How do I find the lable of an object from the field api name ?   
Thanks,
Ed
  • May 09, 2016
  • Like
  • 0
Hi All my current OWD for account is private. I have an  user who is manager in role hierarchy who can see account record but cannot edit. It throws insufficient access level message. Is there a way to give full access to this account for this manager?

Tahnks for help.. 
  • April 07, 2016
  • Like
  • 0
I have custom field "Email__c"  on Account . If I try to run below query, 

If I run below query,  I get "Unknown error parsing query"  error. Not sure what I'm doing wrong here. 
SELECT ID , Account.Email__c  ,Email  FROM Contact WHERE   Account.Email__c  != Email

Below query runs successfully 
SELECT ID , Account.Email__c  ,Email  FROM Contact WHERE   Account.Email__c  !=''

Thanks for help.
  • January 20, 2016
  • Like
  • 0
Hi all ,

I need help with SOQL query . I have two objects namely "Account" and "Relationship"
Account object has custom field call "Current Value"
Relationship  object has 2 lookup fields( acc1 and acc2)  to Account. It also has custom field called "Total Value"

I'm trying to write a query that will return me SUM of all the "Current Value" for list of AccountID's  grouped by Relationship 

Thanks for help.
  • January 06, 2016
  • Like
  • 0
Hi all - need help with formula in validation rule of campaign members to resrict adding new members if campaign status = "Complted" 

Thanks.
  • October 06, 2015
  • Like
  • 0
Hi all , I need help figuring this out.
Contact has a lookup field called topParent to account. Also, Contact is associated to an account.
I have a related list on contact  called "REQUEST" . I have to overirde the new button in this related list.
When I create custom new button for this related list how will I access the "channel"  on account object  through topParent lookup field relationship .

I did sosql query   select  Contact.topParent __r.channel__c from contact where id='003E000000XWVGZ'  and I can get channel field data.   I'm not sure why I cannot get the channel  in the custom button  by doing {!Contact.topParent __r.channel__c }
  • August 21, 2015
  • Like
  • 0
I have a custom object called "Request" and that has lookup relationship with contact. Contact has a field called "topParent"  which has lookup relationship to an ACCOUNT . I have a custom field in account called CHANNEL .

I want to use a custom button when user clicks "New"  in the "Request" related list on contact page .  I have created a custom button called "New Request" on "Request" object. I'm trying to access CHANNEL(which is at account level) field in this custom button by doing {Contact.topParent __r.Channel__c} .. but it throws "field does not exist error" when I try to save.   Not sure if I'm missing something. 

Thanks.
  • August 20, 2015
  • Like
  • 0
I have a custom object with some text fields. I created a custom VF page . I want to prepoulate one of the fields with some value. I refered the URL hacking mentioned here http://raydehler.com/cloud/clod/salesforce-url-hacking-to-prepopulate-fields-on-a-standard-page-layout.html

I created a custom new link button and passing (&00N29000000Jat5=test) the value that I want prepoluated. The issue I'm having is that the field does not prepoulate  when in NEW mode. It does however populate the value in EDIT mode. This tells me that the ID of the field is correct , but not sure wht is going on. 

Thanks.
  • August 18, 2015
  • Like
  • 0
I'm trying to cerate a  VF page and want to add dropdown list. The picklist values will be hardcoded and  do not depend on anything. When the form is submitted , I just want to mail the form values to an email address.  

Thanks for help.
  • July 24, 2015
  • Like
  • 0
I have a trigger on contact which fires after insert and update. I have created a helper class where all my logic exist.  I have created a static set  at class level . I add values to this SET inside my onInsertAndUpdate  method so as not to process those records again. At the top of my method I check if this static variable is null and only then do additional logic in the onInsertAndUpdate  method. The issue I'm having is that there are multiple workflow rules that fire and update contact record which result in this trigger firing multiple times.  I checked the debug log and looks like the static variable == null is true every time this onInsertAndUpdate   is called again and hence it goes though rest of the logic.  Please help me understand what is going on. 

Thanks.
 
public without sharing class ContactTriggerHandler {

private boolean m_isExecuting = false;
    private integer BatchSize = 0;
     public static Set <String> EmailSet = null;
    public ET_ContactTriggerHandler (boolean isExecuting, integer size){
        m_isExecuting = isExecuting;
        BatchSize = size;
    }
    
   
    
    
    public void onInsertAndUpdate (Contact[] updatedContacts, Map<ID, Contact> OldMap) 
    {
                if(EmailSet==null){ 
                //do something
                
                    EmailSet.add(something); 
                }
    }

}

 
  • July 22, 2015
  • Like
  • 0
Hi all - My trigger and handler class is a s below. I'm getting error when I try to save the trigger 

error message  Compile Error: Method does not exist or incorrect signature: [ET_ContactTriggerHandler].onInsertAndUpdate(List<Contact>, List<Contact>, Map<Id,Contact>, ContactTrigger.triggeredAction) 
trigger ContactTrigger on Contact (after insert,  after update,before delete) {
     
    ET_ContactTriggerHandler  EThandler = new     ET_ContactTriggerHandler(Trigger.isExecuting, Trigger.size);
    
     
     public enum triggeredAction {afterInsert, afterUpdate , beforeDelete}
     
    if(Trigger.isInsert && Trigger.isAfter){
    System.debug('*******INSERT'   );
      
        EThandler.onInsertAndUpdate (Trigger.old, Trigger.new, Trigger.oldMap, triggeredAction.afterInsert) ;
    }

}
 
public without sharing class ET_ContactTriggerHandler {

private boolean m_isExecuting = false;
    private integer BatchSize = 0;
    public ET_ContactTriggerHandler (boolean isExecuting, integer size){
        m_isExecuting = isExecuting;
        BatchSize = size;
    }
    
    public enum triggeredAction {afterInsert, afterUpdate , beforeDelete}
    
    public void onInsertAndUpdate (Contact[] oldContacts, Contact[] updatedContacts, Map<ID, Contact> OldMap, triggeredAction ta) 
    {   

//do something

}

}

 
  • July 09, 2015
  • Like
  • 0
I need help with writing query. I have a contact and that contact is related to an account which has a parent account(one level hierarchy) . I want to write a sosql query  to get the parent account ID if I pass contact ID. 

Thanks for help.
  • June 25, 2015
  • Like
  • 0
I have a custom object which has lookup relationship with Account and Contact. On the account and contact page I have related list to that object. I have created 2 VF pages to display fields related to this custom object in the format I want. One of the VF page is for users who click on edit/new/view in the related list of the custom object on Account page and other is if the user comes from Contact page.
I'm trying to figure out how to redirect user to a particuar VF page depending on whether they click view/edit/new in the related list on Account or Contact page. 

Thanks for help.
  • June 04, 2015
  • Like
  • 0
I'm new to flow trigger. I created a flow trigger that does some updates on user object. This is fired by a workflow when new user is created and updated. This works fine when insert and update is done on single record. I have external program that does a mass updates on user object. I get Too many SOQL's: 101 error on flow when there is mass update.  
Is there a way to disable the qwork/flow during mass updates ?  
Is there better way ?

Thanks for help. 
  • May 19, 2015
  • Like
  • 0
I have two account record types for e.g. A and B. Account with record type B is a child of Account of record type A. My requirement is such that only couple of users should be allowed to enter new contact under the parent account whose record type is A .
What is the best way to do this ?  There will only be one level of hierarchy  such that  account whose record type is B will not any any child records below it.

Thanks
  • April 24, 2015
  • Like
  • 0
I'm trying to show all contacts related to child accounts at parent account level. I created a custom account lookup field on contact. When I try to add or edit a contact and select the name of my parent account in the custom lookup field, it does not save. Not sure what is going on. Any suggestions

Thanks for help.
 
  • April 22, 2015
  • Like
  • 0
I have a custom object A. One of the field on custom object is of type master-Detail(account). On the account page layout I added this related list but cannot see this field in related list properties. I'm able to include all other fields.
Thanks for help.
 
  • April 14, 2015
  • Like
  • 0
Hi all  -  I need help with apex and soql
Account object has a custom date field called "Last followup"
I would like to update this field on insert/edit/update/delete of CONTACT. I have a contact trigger and "Last followup" needs to be updated in this trigger
"Last followup" field on account object should be updated with  MAX of  ActivityDate field FROM  ActivityHistories object.of all contacts tied to that account.. As per my understanding, ActivityHistories  records can only be queried as a subquery.

Thanks for help


 
  • April 07, 2017
  • Like
  • 0
Hi All -  I need help coding custom VF page.  
Users will come to this VF page(AssignContact) with url something like apex/AssignContact?ID=066540000000XzK
The ID that is passed in the URL is one of  the record  in my custom object(Team__c)
On this custom VF page I need a Contact lookup field which the users can lookup a particular contact , select and click save button
when users click save I would like the contact record that user selected be added to my  custom object(Team) 
Thanks for your help.  




 
  • April 06, 2017
  • Like
  • 0
I'm trying to create a custom link button with "execute javascript" behavior. I'm getting error on line 
var cont = records[0].top_firm__r.Coverage_Channel__c;

Coverage_Channel__c is a picklist type field. Query using dev console does not throw an error and there is a value in that field. Also, I see values by doing the console.log(records );  I'm not quite sure why it throws  error "cannot read property 'Coerage_Channel__c' of undefined "
 
{!REQUIRESCRIPT("/soap/ajax/34.0/connection.js")}

 
    var result = sforce.connection.query(
        "SELECT Name,top_firm__r.Coverage_Channel__c " + 
        "FROM Contact " + 
        "WHERE Id = '{!Contact.Id}' " 
    );

    var records = result.getArray("records");

 
    if(records.length != 0){
        var cont = records[0].top_firm__r.Coverage_Channel__c;
window.top.location.href="someting........";
        }

 
  • March 02, 2017
  • Like
  • 0
I have a custom object called "Request" and that has lookup relationship with contact. Contact has a field called "topParent"  which has lookup relationship to an ACCOUNT . I have a custom field in account called CHANNEL .

I want to use a custom button when user clicks "New"  in the "Request" related list on contact page .  I have created a custom button called "New Request" on "Request" object. I'm trying to access CHANNEL(which is at account level) field in this custom button by doing {Contact.topParent __r.Channel__c} .. but it throws "field does not exist error" when I try to save.   Not sure if I'm missing something. 

Thanks.
  • August 20, 2015
  • Like
  • 0
I have a custom object with some text fields. I created a custom VF page . I want to prepoulate one of the fields with some value. I refered the URL hacking mentioned here http://raydehler.com/cloud/clod/salesforce-url-hacking-to-prepopulate-fields-on-a-standard-page-layout.html

I created a custom new link button and passing (&00N29000000Jat5=test) the value that I want prepoluated. The issue I'm having is that the field does not prepoulate  when in NEW mode. It does however populate the value in EDIT mode. This tells me that the ID of the field is correct , but not sure wht is going on. 

Thanks.
  • August 18, 2015
  • Like
  • 0
I have a custom object which has lookup relationship with Account and Contact. On the account and contact page I have related list to that object. I have created 2 VF pages to display fields related to this custom object in the format I want. One of the VF page is for users who click on edit/new/view in the related list of the custom object on Account page and other is if the user comes from Contact page.
I'm trying to figure out how to redirect user to a particuar VF page depending on whether they click view/edit/new in the related list on Account or Contact page. 

Thanks for help.
  • June 04, 2015
  • Like
  • 0
I'm trying to show all contacts related to child accounts at parent account level. I created a custom account lookup field on contact. When I try to add or edit a contact and select the name of my parent account in the custom lookup field, it does not save. Not sure what is going on. Any suggestions

Thanks for help.
 
  • April 22, 2015
  • Like
  • 0
I have a custom object A. One of the field on custom object is of type master-Detail(account). On the account page layout I added this related list but cannot see this field in related list properties. I'm able to include all other fields.
Thanks for help.
 
  • April 14, 2015
  • Like
  • 0
I'm trying to create asimple validation rule such that when an user is trying ot convert lead and enters "System" in the the "Record Owner" file, it should display error. Formula I'm using is  - >  Owner:User.LastName='System'
System is an integration user and does not have first name in the user profile.
1. I'm not sure why the formula is not working . Joshn Smith is valid user .
2. Why does the error keeps displaying below the "convert" field when I mentioned in the validation rule to display the erorr next to lead owner field. (screenshot below)

User-added image

Thanks
  • March 26, 2015
  • Like
  • 0
I'm trying to pull all the users who have not posted anything (user feed , group feed etc) on chatter. Is there a way to query SOSQL  or report to find out users who have never posted anything on chatter. Thanks.
  • March 05, 2015
  • Like
  • 0