
Announcements
Hello
I'm using a basic form for the portal, which has a system required field for contact.
I need to set the contact either by the logged in user, which I have managed by using entity metadata. However if the user is not logged in I would like the field to be populated from the answer of another field, answers would be anonymous or guest. So if anonymous was selected the system required contact field would be populated with the anonymous contact. If guest was selected the system required contact field would be populated with guest.
Contact field is system required and I am not able to alter this.
Is there a low code/no code way of doing this?
Any help or advice is greatly received.
Hi @BOB007 ,
Since you have an anonymous contact record and you want to set it in case of select an anonymous option, then you can trigger the on-change function on the option-set and based on the selected value if it is equal to anonymous then set the anonymous contact like below
$(“#contact_name”).attr(“value”,contactName); /*contact_name = record name*/
$(“#contact”).attr(“value”,contactId); /*contactId= Guid of the record*/
$(“#contact_entityname”).attr(“value”,”contact”);/*contact = entity name*/
If this post helps you with your problem, please mark this answer as Accepted Solution.
If you like my response, please give it a Thumbs Up.