Friday, November 2, 2012

#205 Fusion CRM - Accessing child objects via Groovy

Thanks to my colleague MireilleD. for this.

Scenario: An Opportunity can have many contacts.




I need to pass on the email address of the primary contact to a 3rd party system. I have defined a link on the page with the following Groovy script to retrieve the email of the primary contact.

Here it is -

// get primary contact Email
def primaryEmail=""
def contacts=OpportunityContact
if (contacts != null){
contacts.reset()
while (contacts.hasNext()) {
  def curRecord = contacts.next()
   if (curRecord.PartyId == PrimaryContactPartyId){
     primaryEmail=curRecord.EmailAddress
   }
}


4 comments:

  1. HI , I am a Siebel veteran and now want to learn Fusion CRM. Your posts are much helpful. Can you please guide me how to get the access to Fusion CRM Application Composer. I want to learn on my own and get my hands dirty.

    ReplyDelete
  2. HI , I am a Siebel veteran and now want to learn Fusion CRM. Your posts are much helpful. Can you please guide me how to get the access to Fusion CRM Application Composer. I want to learn on my own and get my hands dirty.

    ReplyDelete
  3. Hi Pankaj,

    Application composer is a constituent part of the Fusion CRM install, so you will need access to a Fusion CRM instance.

    ReplyDelete
  4. Hello Niall

    Is there any test environment or trial access to Fusion CRM available because Fusion CRM can not be installed on a laptop give the high specs.

    ReplyDelete