function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AmitpAmitp 

Problem calling a servlet in a trigger

Hi All
       I am quite new to SalesForce. I am trying to send the id of a custom object to a servlet in request, on creation of a new record.Can any body have any idea how to call a servlet URL in Trigger or in Apex Code.

Thanks in Advance
AmitP
SuperfellSuperfell
You can't make a synchronous callout while you have an open transaction. You should look at the workflow Outobund messaging feature instead.
AmitpAmitp
Hi Simon

             Thanks for the reply. I tried Workflow outbound message. But it is not suitable for my situation, because
    workflow outbound message is sending a SOAP message. But i don't want to invoke a webservice. My URL     is not not a webservice endpoint ,it is a normal URl and i want to send some values appended in request url.
    Have any idea to solve this problem.  

Thanks and regards
Amitp

SuperfellSuperfell
Write a servlet that take the soap message and turns around and makes your HTTP request.
AmitpAmitp
Simon

           I have created a workflow rule that sends a outbound message on the Evaluation Criteria : every time a record is created or edited. But when i create a new record the message it not sended , i saw in message delivery status in outbound messages i go the message is awaiting in queue and the Reason : org.xml.sax.SAXParseException: Premature end of file. Any idea why the message it is not sending the message .


Thanks and regards
Amitp