+ Start a Discussion
sam_matsam_mat 

Merge Field problem

Hi,

 

I have custom object CPS.

CPS object has 2 lookups.

One look up to Contact object.

And other to custom object called PS.

 

I have to create merge template for CPS object.

I am able to access CPS fields by specifying merge field as <<CPS_Name>>

 

But now i want to access field of Contact and PS object.

I tried different merge field formats like:

 

«CPS_Contact__r.LastName»

«CPS_Contact_LastName»

«CPS_Contact__r.LastName»

«CPS_Contact__r_LastName»

«CPS_Contact__r_LastName»

«CPS_Contact_LastName»

«CPS_Contact_LastName»

«CPS_Contact.LastName»



but they show blank lines in generated documents.

 

Also i tried Connect to office. But does not support MS office 2010 that i have on my windows 7 machine.

 

How to write merge fileds for parent object fields ?

What is the format?

 

Thanks,

Sam

Shashikant SharmaShashikant Sharma

Hi, 

 

I think you want to get related objects field in a Email template using merge fields. If so let me tell you that in email template you can not access related objects field. YOu can only access field of targetIObject. TargetObject is the object on which the eamil alert is created on. Now you have only onesolution taht you have to copy all information from related object to the target objects field. Only then you can access these values.

sam_matsam_mat

Hi,

 

Thanks for suggestion.

But my problem is not related to Email Template.

My problem is related to "Mail Merge Template".

 

 

Shashikant SharmaShashikant Sharma

HI, 

I am sorry I completely misunderstood your issue. I hope you are looking for it.

 



  • For custom objects, the field label is preceded with the type of record and all spaces are converted to underscores. For example:{!Stockforce_CreatedDate}references the standard field calledCreated Datefor the Stockforce custom object.
  • For formulas that allow you to reference fields on related objects across multiple relationships, the field name is prefixed by the name of the relationship. For standard relationships, the name of the relationship is the master object. For example, you can reference the account name merge field from a contact validation rule usingAccount.Name; you can reference the phone number of the account creator from an opportunity product formula field usingOpportunity.Account.CreatedBy.Phone. For custom relationships, the name of the relationship is theField Namegiven when creating the relationship with “__r” appended to it. For example, reference the contact email merge field from a custom object validation rule using theContact__r.Emailmerge field name.

 

For more you must read this : https://help.salesforce.com/apex/HTViewHelpDoc?id=valid_merge_fields.htm&language=en

 

Please ensure no two fields have same label name, that could create a issue.