3

I'm absolutely embarrassed. I try to get value as it in this thread (and sorry for the wrong use of the topic).

I try get a custom value via CRM API. With the API Explorer I can create the expression:

{crmAPI var='result' entity='Contact' action='getvalue' sequential=0 return="custom_13" id=$contactId}
{foreach from=$result.values item=contact}
  {$contact.some_field}
{/foreach}

I can see the right result in the API Explorer. I insert it as it is into my tpl file, and I get back only the first character of the result.

What do I wrong?

4

Since you are using getvalue, $result will be the contact's custom_13 value, so you don't need a foreach loop.

Try using below snippet

{crmAPI var='result' entity='Contact' action='getvalue' sequential=0 return="custom_13" id=$contactId}
Custom 13: {$result}

Pradeep

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.