CMS Development

thibauls
Contributor

How to use hs_object_id in crm_object or crm_association declaration

SOLVE

Hello, I would like to know how to make a statement in hubl using the contact ID without having to specify it coded in the statement.

For example, I would like to do this

<!-- by id -->
{% set contact = crm_object("contact", 123) %}
{{ contact.firstname }}
{{ contact.lastname }}

instead of using 123, I would like to use the current contact ID, i.e. hs_object_id

I tried several things like
{% set contact = crm_object("contact", contact.hs_object_id) %}

All that I have tried does not take into consideration contact.hs_object_id,
this value exists because I display it just before using it.

Someone could give me the solution, I am currently using this code in an email template.

0 Upvotes
1 Accepted solution
thibauls
Solution
Contributor

How to use hs_object_id in crm_object or crm_association declaration

SOLVE

I finaly found the solution.

All i need to do is using request_contact.contact_vid instead of contact.hs_object_id 

View solution in original post

0 Upvotes
1 Reply 1
thibauls
Solution
Contributor

How to use hs_object_id in crm_object or crm_association declaration

SOLVE

I finaly found the solution.

All i need to do is using request_contact.contact_vid instead of contact.hs_object_id 

0 Upvotes