• Bradlee
  • 0 Points
  • Member since 2012

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 6

I am trying to integrate NetDocuments with Salesforce. Specifically, I am trying to pass a CSV formatted string to NetDocuments which will grant certain permissions on NetDocuments. The code with an issue is below:

public String createProjectAndSecurity(String sessionId) {
	String resultStatus;
	HttpRequest externalRequest = new HttpRequest();
	externalRequest.setHeader('Content-Type', 'text/xml; charset=utf-8');
	externalRequest.setHeader('SOAPAction', 'http://netdocuments.com/ndApi/UpdateLookupTable');//
	externalRequest.setHeader('Cookie', sessionId);
	String bodyString = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';
	bodyString += '<soap:Body>';
	bodyString += '<UpdateLookupTable xmlns="http://netdocuments.com/ndApi/">';
	bodyString += '<repository>XX-XXXXXXXX</repository>';
	bodyString += '<emailAddr>greg@interactiveties.com</emailAddr>';
	bodyString += '<completionEmail>True</completionEmail>';
	bodyString += '<updateMode>add</updateMode>';
	bodyString += '<tableData>Project, Project Type, Project Closed, Project Access, Project Hold\nTESTING - 001,,,XYZ Company|VES,</tableData>';
	bodyString += '</UpdateLookupTable>';
	bodyString += '</soap:Body>';
	bodyString += '</soap:Envelope>';
	Http http = new Http();
	try {
		HTTPResponse externalResponse = http.send(externalRequest);
		resultStatus = externalResponse.getStatus();
	} catch(System.CalloutException e) {
		//Exception handling goes here....
	return resultStatus;


I keep receiving an internal server error response from NetDocuments. I am able to login to NetDocuments and get a session variable, which is what gets passed to this class and used in the request. I think the problem is with the value being passed in the tableData portion of the request but I am not sure. This tableData value should be a CSV formatted string.


Does anyone have any ideas?


  • September 27, 2012
  • Like
  • 0
I am trying to access NetDocuments API from Salesforce. 
I am not sure how do we maintain session between successive calls to API.
Please let me know if you could help me out.
Thanks in advance.



Salesforce Community

I am new to Apex & trigger

I have created two custom objects Member & Member2, and same fields for both the object, now i want to insert the values of member fields into Member2 fields, such as Firstname and lastname,

Help me to get code for this