function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shubham Bansal 45Shubham Bansal 45 

Can we get object name along with with other information of prec-chat form fields.

Can we get the object name along with other information of pre-chat form fields?

I have a custom field language present in contact and case both and I want to differentiate between them but the API name is also the same. 

Therefore I want the fields object names so that I can differentiate between them.
Any help is appreciated , Thanks in Advance
AnudeepAnudeep (Salesforce Developers) 
As far as I know, you only get API names. To differentiate you have to use the object names
 
<input type="hidden" name="liveagent.prechat.findorcreate.map:Contact" value="FirstName,ContactFirstName;LastName,ContactLastName;Email,ContactEmail;Phone,ContactPhone" />

 

<input type="hidden" name="liveagent.prechat.findorcreate.map:Case" value="Subject,CaseSubject;Status,CaseStatus;Origin,CaseOrigin;RecordTypeId,CaseRecordType" />
 

Let me know if it helps

Shubham Bansal 45Shubham Bansal 45
Hi Anudeep, 
Thanks for reply

Actually I ma using Prechat api to get all field by this:  var prechatFields = cmp.find("prechatAPI").getPrechatFields();

By this, I get all fields label, API name used in pre-chat form but for a scenario like a have a custom field in both case and contact then I can differentiate between them because of same label as well as the same name.