Tag: salesforce service cloud

使用连接器将文件上载到salesforce

我在mule中建立了一个流程,使用“Salesforce”连接器在Salesforce中创建一个案例。 现在我需要使用相同的mule流将文件上传到该案例。 这可以通过以下代码以编程方式完成: 尝试{ File f = new File(“c:\java\test.docx”); InputStream is = new FileInputStream(f); byte[] inbuff = new byte[(int)f.length()]; is.read(inbuff); Attachment attach = new Attachment(); attach.setBody(inbuff); attach.setName(“test.docx”); attach.setIsPrivate(false); // attach to an object in SFDC attach.setParentId(“a0f600000008Q4f”); SaveResult sr = binding.create(new com.sforce.soap.enterprise.sobject.SObject[] {attach})[0]; if (sr.isSuccess()) { System.out.println(“Successfully added attachment.”); } else { System.out.println(“Error adding attachment: ” […]