<div dir="ltr">Thanks for the tip!  We don't allow any unauthenticated access, so I always have global $current_user handy.  Then it's just a matter of using vtws_getWebserviceEntityId to combine $record+$module to get $wsid.<div>
<br></div><div style>It does seem kind of backwards though, as VtigerModuleOperation.retrieve is just going to split the id apart again, then call VtigerCRMObject.read, which calls CRMEntity.retrieve_entity_info, which is what I'm already doing!</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 15, 2013 at 3:43 PM, Stefan Warnat <span dir="ltr"><<a href="mailto:ich@stefanwarnat.de" target="_blank">ich@stefanwarnat.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Hy Adam,<br>
      <br>
      You could do this easier.<br>
      If you use vtws_retrieve($wsid, $user), you get the date and
      number formats like the user use it. <br>
      The only challenge is, you needs an valid user object, which makes
      this way slower.<br>
      <br>
      Stefan<br>
      <br>
      Am 15.05.2013 21:06, schrieb Adam Heinz:<br>
    </div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>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.</div>
        <div><br>
        </div>
        <div><?php</div>
        <div>global $module, $record;</div>
        <div>if ($record && isPermitted($module, 'DetailView',
          $record) == 'yes') {</div>
        <div><span style="white-space:pre-wrap"> </span>$focus =
          CRMEntity::getInstance($module);</div>
        <div><span style="white-space:pre-wrap"> </span>$focus->retrieve_entity_info($record,
          $module);</div>
        <div><span style="white-space:pre-wrap"> </span>header("Content-type:
          text/javascript");<br>
        </div>
        <div>
          <span style="white-space:pre-wrap"> </span>echo
          json_encode($focus->column_fields);</div>
        <div>}</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a></pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br></div>