开发者

Can Salesforce.com Rich text data be used offline in an Adobe Flex Application?

I am building an offline Salesforce.com application in Adobe Flex. 开发者_开发百科Can we use Salesforce.com's Rich Text Area fields in the offline application? I do not see the field returned in a query.

Thanks


I have the answer to my own question. I hope this helps others. The custom field in Salesforce is Rich Text Area and is used to store jpeg pictures. This work fine in the UI and VF with Apex. Within Flex, however, you cannot use the ForceforFlex tools, but have to store the picts in the local database and upload to SF with the webservices API (Also included with Flexbuilder) when the app is online. The jpeg must be Base64 encoded and included in an tag with a data uri as follows.

buildSO.image__c = '<img src="data:image/jpeg;base64,'+base64EncodedImage+'" alt="Penguins" />';

Thanks to James Ward and all on SO.


You should be able to, it's really just an HTML enabled text field. In the Enterprise WSDL, the field is available as a standard field. In this snippet from the WSDL, Description__c is a Rich Text Area:

<element name="Description__c" nillable="true" minOccurs="0" type="xsd:string"/>

You can also select it natively via Apex using simple SOQL. It's typed as a textarea (string):

string myRichTextDescription = [select Description__c from myCustomObject__c];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜