• Saranya M
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
I have written a trigger on event for contact object. If I try to create an event for Merchandise object, the below trigger is getting fired and throws an error.

How I can restrict the below trigger to work only for events created on contact object.

trigger ContactSysIDEvent on Event (before insert) {
    ID evid;
   for (event e:trigger.new)
    { evid=e.whoid;
    contact m123 =[select name,id_type__C,sys_id__c,siebel_id__C from contact
                          where id=:evid];
    if(m123.id_type__C=='Sys ID')
        { e.Contact_sys_ID__c=m123.sys_id__c; }
        else{ e.contact_sys_id__C=m123.siebel_id__C; }
}
}
I'm trying to update activity custom field - contact sys id with the value from sys id or siebel id based on the id type field

trigger ContactSysID on Event (before insert) { ID evid; for (event e:trigger.new){ evid=e.whatid; } event e=[select id,contact_sys_id__c from event where whatid=:evid]; Merchandise__c merch=[SELECT TYPEOF What WHEN Merchandise__C THEN name,id_type__C,sys_id__c,siebel_id__C END FROM event where WHAT.TYPE='Merchandise__c' limit 1]; For (Merchandise__C m:merch){ if(m.id_type__C=='Sys ID'){ e.Contact_sys_ID__c=m.sys_id__c; } else{ e.contact_sys_id__C=m.siebel_id__C; }
}
Hi I am trying to integrate salesforce.com with Oracle Apps using BPEL. I have published my BPEL as a webservice in our test server and had created an apex class which calls this webservice. Later I am invoking this using an S-control button in Accounts tab.

But I am getting the following error when I invoke the button.

**
{faultcode:’soapenv”Client’, faultstring:’System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element ‘http://schemas.xmlsoap.org/soap/envelope/:Envelope’ but found ‘:html’

Class.wwwTrianzCom.Create_AccountPort.process: line 15, column 13
Class.AccountWrapper.CreateFunction: line 5, column 10
**

Please help me to figure out the problem.

Thank you, Aneesh