[Vtigercrm-developers] DetailJson.php

Adam Heinz amh at metricwise.net
Wed May 15 19:06:48 UTC 2013


I don't know why I didn't think of this earlier, but it certainly is handy
to be able to grab arbitrary entity data as JSON.  The only thing I've
noticed is that dates come out with the back end format, so I've been
casing those out with DateTimeField::convertToUserFormat.

<?php
global $module, $record;
if ($record && isPermitted($module, 'DetailView', $record) == 'yes') {
$focus = CRMEntity::getInstance($module);
$focus->retrieve_entity_info($record, $module);
header("Content-type: text/javascript");
echo json_encode($focus->column_fields);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20130515/bfeee2df/attachment.html>


More information about the vtigercrm-developers mailing list