70、saleforce的Json输出

来源:互联网 发布:阿里云 图片处理服务 编辑:程序博客网 时间:2024/05/21 10:55
List<Merchandise__c> merchandise = [select Id,Name,Price__c,Quantity__c from Merchandise__c limit 1];String goodsToJson = JSON.serialize(merchandise);//通过serialize方法序列化成JSON内容String goodsToJsonPretty = JSON.serializePretty(merchandise);//通过serializePretty方法序列化成JSON内容,以精美的输出格式输出System.debug(goodsToJson);System.debug(goodsToJsonPretty);

 

原创粉丝点击