• Nzgon
  • NEWBIE
  • 125 Points
  • Member since 2011
  • Software Architect and Developer
  • Algonquin College


  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 35
    Replies

Spinning my wheels on this.  I'm not an APEX coder but this problem is within my skill set.

 

I am trying to check to see if "Account_Record__c" on "Lead" is null - and then insert a record if it is.  No errors when I save the code, but when I test none of the records are behaving as expected!  In my test records there are no values in "Account_Record__c" yet the related object record is not created.  If I remove the "&& newLead.Account_Record__c==null" element then the related record is created.

 

What am I missing?

 

 

trigger createSalesAssignment on Lead (after update) {     
List<Sales_Assignment__c> sa = new List<Sales_Assignment__c>();
    for (Lead newLead: Trigger.New)
         if (newLead.Status == 'Sales Ready' && newLead.Account_Record__c==null){
                 sa.add (new Sales_Assignment__c(
                     Lead__c = newLead.Id));   
         }
   insert sa;

 }

 

 

 

Hi All,

 

let me know difference b/w what id and who id?

 

Thanks

I need to add community members of a community to the campaign members list.

I tried querying in my own way but i cound not execute successfully.

 

this was the error it was giving

 

Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Attempted to add a campaign member where either the member id 'null' or the campaign id 'null' is null.: []

 

I was not sure what is member id whether it is a contact id or community id or any other fields are missing..

 

I appreciate any help on this.

 

Thx 

Hello,

 

I am new to salesforce and needed some help regarding passing records using checkbox to next VF page...

I have created a custom object with some text fields and i have created a VF page in which i have displayed these fields along with a checkbox.Its somewhat like a checkbox in a datatable kind of look.

Also i have created a wrapper class that holds the selected(checked) records.Now i want these checked records to be retrieved and displayed in the next VF page on passing it as a url parameter in page reference.

How is this done? Is there any other way of doing this apart from passing it as a url parameter.

Please help...

 

Thanks

I have a VF page with the Opportunity as the standard controller.  Within this page I have referenced the related Account with some input fields.  You can see this below in a small snippet I took:

 

................<apex:inputField Value="{!Opportunity.Reason_Won__c}" required="true" />
                <apex:inputField Value="{!Opportunity.Sale_Notes__c}"  style="width:125pt; height:50pt"/>
            </apex:pageblocksection>
            
            <apex:pageblocksection showHeader="true" columns="2" title="2 - Account Info" rendered="{!if(Opportunity.Amount=0, false, true)}">
                <apex:inputField Value="{!Opportunity.LeadSource}"  required="true"/>
 	 <apex:inputField Value="{!Opportunity.Account.Industry}" required="true" /> .................

 

 

The whole idea here is to allow my users to perform an operation that requires them to populate fields under the Account and Opportunity.  Unfortunately, what happens when they save the page is it only updates the Opportunity fields while disregarding any changes made to the Account fields.  In otherworsd, I may have selected "Fitness" for the Account.Industry inputField.  However, upon saving the page the Industry field is left blank under the Account.  Is this by design?  If so, how would I manipulate it with APEX to allow me to pass these changes to the Account?

Hi Guys,

 

I have requirement, I need to create a view on Contact  within the past two hours of the current time .

 

I think this cannot be done using  based on currentdate, because our call center is open 24 hours. so If a Contact is created at 11pm on tuesday then the view would display the record up untill 1 am on wednesday.

 

can any one suggest me on this how to create the viwe according to my requirement.

 

is it possible or not.

 

 

Thank you

Aruna

assign the account if contact is created with out account if account name is abc ,

i created the trigger , but i account abc is deleted , so how can i manage that .

i want to put a rule that , if contact is created without account , then the contacts aaccount is 'abc'.

if abc is deleted then no account is assigned to that contacts.  

I have created a trigger that creates a Contact called "Accunt Email" if a new Account is created and a custom field called "Company Email" is populated with an email address.

 

I have trigger working on "after insert" but when I try to add "after update" it duplicates the contact record. I'm not sure how to include the "after update" without creating duplicte contacts or how update the email address on the Contact record if the email address on the Account page is modified.

 

Thanks!

 

trigger CompanyEmail on Account (after insert, after update) {

   
  List<Contact> ct = new List <Contact>();
    for (Account newAccount: Trigger.New){
    
        if (newAccount.Company_Email__c != null){
                 ct.add (new Contact(
                     FirstName = 'Account',
                     LastName = 'Email',
                     Email = newAccount.Company_Email__c,
                     AccountId = newAccount.id,
                     OwnerId = '00530000001jaC1'));   
         }
 insert ct;  
        }
      if (Trigger.isUpdate) {
        List<Contact> cnt = [SELECT id FROM Contact WHERE Firstname = 'Account'];
       for(Account olduAccount : trigger.old){
            
              cnt.add (new Contact(
                    
                   
                    Email = olduAccount.Company_Email__c));
           {
    update cnt;
               {
                
      
 
 }}}}}

 

Hi there,

 

Does anyone know a way to build a visual force page that will display locations on a google map from account list views?

 

For example, when my accounts is chosen from accounts view, I would like to be able to see all of those locations mapped.

 

It can be a separate tab, or embedded somehow on the list view page.

 

I'm no expert but I'm learning :)

 

Thanks!!

 

 

Looking to recreate the buttons on the page layouts to my custom Visual Force page. How do you find the Methods in the objects standard controllers?

I have a test Visualforce app published on Sites in my developer org. One of the pages has a lookup field which should pop up a standard LookupPage (when the spyglass icon is clicked), but the LookupPage states that authorisation is required as if I have to explicitly specify public access settings for it in Sites.

 

Is this the case? If so how do I give it public access settings given its not in my 'Available Visualforce Pages' list?