• Cdolan04
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hello community,

 

I need to update a custom field in my standard Contact, that fires after a different, Custom Object is updated, validated by a lookup relationship. (The Custom Object has the Contact, and Contact's Account, listed as Lookups)

 

I've tried to write a trigger that passes the field value from my Custom Object to the Contact, but I keep getting a variety of errors - the most recent of which has stumped me. The end goal is to update Passing__c from Passing_Field__c. At the moment, the system does not recognize 

p.Passing_Field__c

As a variable, which leads me to assume I'm not identifying the fields correctly to begin with. Is there a better way to do what I'm trying to accomplish here?

 

trigger ContactUpdater on Custom_Object_Name__c (after update) {

 List<Contact> updatedContacts = new List<Contact>();
 Set<Id> ObjectIds = new Set<Id>();
 Set<String> ObjectCont = new Set<String>();
 Set<Boolean> ObjectActive = new Set<Boolean>();
 Set<String> ObjectPass = new Set<String>(); 

 for(Custom_Object_Name__c p : trigger.new){
     If(p.Active__c == true){ 
       ObjectIds.add(p.Id);
       ObjectCont.add(p.Contact__c);
       ObjectActive.add(p.Active__c);
       ObjectPass.add(p.Passing_Field__c);
 }
 }
    try{
        for(Contact c : [SELECT Id, Passing__c FROM Contact WHERE (AccountId IN (Select Account__c from  Custom_Object_Name__c )) AND ObjectActive = true])
        {
          set(c.Passing__c = p.Passing_Field__c);
          c.FieldToUpdate = c.Passing__c;
          updatedContacts.add(c);
         }
         update updatedContacts; 

}

     catch(exception e){
        throw e;
 }

*Notes: Active_c is a checkbox. Passing_c and Passing_Field__c are both text boxes.*

Force community,

 

I've been reading up on license types, and realized that a new feature I'm trying to add is not going to work. Currently, my Site displays customized user information based off of their Contact ID, and then uses that information to authenticate through the various pages of the site, viewing records assocaited with their account. 

Its working pretty well, but the problem is that they are seen by Salesforce as Guest License users, and are unable to Update the Contact object. I'd like people to be able to input a new email address, billing address, etc, so that my clients can imrpove my database's integrity, without my team having to do so all the time.

 

What is the best way to update the contact field's I'd like to user to change? A webform, with a workflow on my organization? Some other manner? 

 

Any help is appriciated!

Force community, 

 

I'm new to writing Apex triggers, and wanted to get some feedback on my issue. I currently have two Custom Objects - lets call those CO1 and CO2.

 

CO1 records are created as children of Opportunities, and contain about 20 fields. When my company signs on a client, we change a field called 'Type' on the Account object to 'Customer' instead of 'Prospect'. When this happens, I'd like to have an Apex Trigger create a new CO2 record, and copy all the data from existing CO1 records (which are, again, children of the opportunity), to CO2 records, which are merely related to Accounts.

 

I'm pretty new to this, but my two biggest questions are these: Do I have to compare a map to notice if the Type = Customer? And how exactly do I navigate related objects to find the correct CO1 record to copy? 

 

Thanks, any help is apprecaited! 

 

Force community,

 

I've been reading up on license types, and realized that a new feature I'm trying to add is not going to work. Currently, my Site displays customized user information based off of their Contact ID, and then uses that information to authenticate through the various pages of the site, viewing records assocaited with their account. 

Its working pretty well, but the problem is that they are seen by Salesforce as Guest License users, and are unable to Update the Contact object. I'd like people to be able to input a new email address, billing address, etc, so that my clients can imrpove my database's integrity, without my team having to do so all the time.

 

What is the best way to update the contact field's I'd like to user to change? A webform, with a workflow on my organization? Some other manner? 

 

Any help is appriciated!

Force community, 

 

I'm new to writing Apex triggers, and wanted to get some feedback on my issue. I currently have two Custom Objects - lets call those CO1 and CO2.

 

CO1 records are created as children of Opportunities, and contain about 20 fields. When my company signs on a client, we change a field called 'Type' on the Account object to 'Customer' instead of 'Prospect'. When this happens, I'd like to have an Apex Trigger create a new CO2 record, and copy all the data from existing CO1 records (which are, again, children of the opportunity), to CO2 records, which are merely related to Accounts.

 

I'm pretty new to this, but my two biggest questions are these: Do I have to compare a map to notice if the Type = Customer? And how exactly do I navigate related objects to find the correct CO1 record to copy? 

 

Thanks, any help is apprecaited! 

 

Hi all,

I'd like to dynamically  render an Sobject to a VF page.

Here is my controller:

Code:
private list<SObject> obj;

public void setobj(list<SObject> s){obj=s;} public list<Sobject> getobj(){return obj;}
public PageReference init() {
 obj=[select Name from Account limit 10]; return null; }

Here my VF Page:

Code:
<apex:page Controller="Test" action="{!init}">
<apex:form>
<apex:repeat value="{!obj}" var="field">
   <apex:inputField value="{!field.Name}"/>
</apex:repeat>
</apex:form>
</apex:page>

I've got this error message :
Read access not found for null.
I've also tried with outputText, inputText with no success.The only field I've managed to retrieve is the ID.

Any Idea ?