Code: Select all
@RecordTriggerInfo(object = "welotranslate__c", events = {RecordEvent.BEFORE_INSERT})
public class HelloWorld implements RecordTrigger {
public void execute(RecordTriggerContext recordTriggerContext) {
final HttpGet request = new HttpGet("https://www.google.com"); // this class not found
HttpClient httpClient = HttpClients.createDefault(); // this class not found
HttpGet httpGet = new HttpGet("http://www.google.com"); // this class not found
HttpResponse response = null;
try {
response = httpClient.execute(httpGet);
} catch (IOException e) {
throw new RuntimeException(e);
}
String responseString = null;
try {
responseString = EntityUtils.toString(response.getEntity(), "UTF-8");
} catch (IOException e) {
throw new RuntimeException(e);
}
System.out.println(responseString);
RecordService recordService = ServiceLocator.locate(RecordService.class);
List recordList = VaultCollections.newList();
for (RecordChange inputRecord : recordTriggerContext.getRecordChanges()) {
String name = inputRecord.getNew().getValue("demo__c", ValueType.STRING);
inputRecord.setError("amazing", responseString.substring(0,3));
}
}
org.apache.http.httpesponse;
^
javasdk/src/main/java/com/veeva/vault/custom/triggers/helloworld.java:8: IRRAGE: ERROR: ERROR: ERROR: : paket org.apache.http.client existiert nicht
org.apache.http.client.httpclient;
^< /p>