Primary Contact on Transaction: How to reference i...
# advancedpdf
r
Primary Contact on Transaction: How to reference in an Advanced PDF/HTML Template? Hi - I'm trying to include the name of the Primary Contact associated with a Transaction on an Invoice template and can't seem to get the syntax correct. The field name within a saved search that delivers the correct results is {contactPrimary} and I've tried {record.contactPrimary}, {record.contactPrimary.entityid} in the template with no results. As we know the, Primary Contact on a Transaction can be different than the default primary contact at the Customer level. Any tips would be much appreciated! Thanks -
n
Looks like a column in a sublist not a field to me and probably not one exposed in the template since it'll be dynamically populated and not stored.
m
I’ve had to do a workaround on this. I added two custom fields if it’s a company for first and last name of contact. Then in the email source code, i add a conditional to show either the regular individual first and last name or the custom first and last name. <#if customer.isperson?? && customer.custentity_comp_first_name?length !=0><span style=“font-family:Arial,Helvetica,sans-serif;“>Dear Dr.&nbsp;${customer.custentity_comp_first_name} ${customer.custentity_comp_last_name},</span> <#elseif customer.isperson?? && customer.custentity_comp_first_name?length = 0 && entity.firstName?length !=0><span style=“font-family:Arial,Helvetica,sans-serif;“>Dear Dr.&nbsp;${entity.firstName} ${entity.lastName},</span> #else<span style=“font-family:Arial,Helvetica,sans-serif;“>${customer.companyName},</span></#if>