• Buenavad
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I'm trying to query an account's contact by recordtypeid and account name. How would my soql statement look? Currently I have this but nothing is returned.
 

SELECT ID,FirstName, LastName, Primary_Contact_Title__c, Email, Phone, Fax, MailingStreet, MailingCity, MailingState, MailingPostalCode FROM Contact WHERE Account.= '" + strAccount + "' AND RecordTypeId = '" + strRecordTypeId + "'"

  • October 09, 2008
  • Like
  • 0
I have 2 custom objects, Locations and Systems, which both have a
Master-Detail relation with Account: Systems also has a Locations
lookup field.
 
After I created a New Location (record) I would like to create New
Systems (records) from Locations.
 
How do I set the default value for the (Master-Detail) field Account.Name,
which has already been entered in Locations?
 
I have tried it with a formula field called Account_ID and a trigger
but I do not get it work:
 
Code:
trigger CopyAccountID on System__c (before update, before insert) {
For (System__c accid:Trigger.new)
// 
      { 
       accid.Account__c = accid.Account_ID__c;
       }
//    }

}

 


Message Edited by Peter van Heck on 09-22-2008 05:29 AM