You need to sign in to do that
Don't have an account?
Bob DeRosier
The VF page
The controller
When I check the SELECT statement, it produces a SF Object ID for a SF document and a body
015i0000001CB3yAAG
/services/data/v33.0/sobjects/Document/015i0000001CB3yAAG/Body
The SF document has a location link for a Google doc which is similar to, but not the text displayed.
I would appreciate any help to locate the actual text.
text in document and display differ -where does the displayed text come from ?
The VF page
<apex:inputTextarea id="waiver" value="{!waiver.Waiver_Text__c}" style="width: 600px" rows="10" disabled="true"/>
The controller
Waiver_Text__c = getWaiverText() private String getWaiverText(){ // Get document from document, document name hard coded right now ... not long-term String docContent = 'Waiver text is missing; make sure there is a document with the UNIQUE NAME HAI_Global_Waiver.'; List<Document> doc = [SELECT Id, Body from Document WHERE DeveloperName = 'HAI_Global_Waiver']; if(!doc.IsEmpty()){ try { docContent = doc[0].Body.ToString(); } catch (Exception ex) { docContent = 'Error in loading waiver text. Check with the office or event registration desk.'; ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'SYSTEM ERROR: There was an error loading the waiver file, please contact the office.')); } } return docContent; }
When I check the SELECT statement, it produces a SF Object ID for a SF document and a body
015i0000001CB3yAAG
/services/data/v33.0/sobjects/Document/015i0000001CB3yAAG/Body
The SF document has a location link for a Google doc which is similar to, but not the text displayed.
I would appreciate any help to locate the actual text.
The body of a document is in Base64 - read through this board post and see if that helps you out: https://developer.salesforce.com/forums/?id=906F00000008wGDIAY
Alternatively, I have a similar document defined in Sandbox and I can't get it to display anything as the above code throws errors. The document uses the same URL for location as the production code and also has a size of 0 bytes. How can I create a document that I can edit ?