• Abraham Durojaiye
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies
Hi All,

I have created a custom checkbox field in the Opportunity object called "Confidential". The purpose of this checkbox is to restrict access to the record to only the Opportunity owner and any listed team members in that Opportunity when the checkbox is selected.

Please advise on how I can do this.

Thanks
Hi,

I currently have an Apex Trigger that auto-poulates a custom field called Natural Partner in my Opportunity object. This field is auto-populated from an Account object.

Here is the current tirgger:

1. trigger NaturalPartner on Opportunity (before insert, before update) {
2.     map<id,account> accounts = new map<id,  account>();
3.     for (opportunity o:trigger.new) {
4.           accounts.put(o.accountid,null);
5.      }
6.      accounts.remove(null);
7.      accounts.putAll([Select id, name, Natural_Partner__c from account where id in :accounts.keyset()]);
8.      for(opportunity o:trigger.new) {
9.          if(accounts.containskey(o.accountid)) {
10.        
11.        o.Natural_Partner__c = accounts.get(o.accountid).Natural_Partner__c;
12.        
13.        
14.        }
15.    }
16. }

What I need is to change this trigger so that the custom field (Natural Partner) is auto-populated from the standard field (Opportunity Owner) which already auto-populates with the user's name that is making the entry. Both of these fields are in the Opportunity object.

Thanks
Hi,

Still getting my feet wet with the developer thing, so I am not sure where to start on this one. 

I have a custom lookup field in my Contacts object called Relationship Manager, which is manually populated with a user name. I also have a custom picklist(multi select) field called Relationship Type, which includes Donor and Board Member as choices. 

I want a trigger that will make the Relationship Manager field mandatory to populate by the user when either the Donor and/or Board Member types are selected.

Thanks
Hi,

I am new to developing so I am not sure how to approach this task. I created a custom lookup field in my Accounts object called Relationship Manager. This field is manually populated with a user name. I also addes the same Relationship Manager field into my Opportunity object and would like that field to auto-populate the user name based on the Account name entered.

Here is my attempt at creating the apex trigger below. I am getting an error message that states:
Error: Compile Error: unexpected token: '<EOF>' at line 6 column 0

trigger RelationshipManager on Opportunity (before insert) {

    for (Opportunity o = Trigger.new; 
        o.AccountId = true;
        )
    
I appreciate any assistance I can get.

Thanks