Enter Email address option on glide_list type field

DB1
Tera Contributor

Hi All,

 

We have glide_list field type that references sys_user table.

DB1_0-1711368249379.pngDB1_1-1711368312044.png

 

DB1_2-1711368357390.png

If I try to enter any email address on "Enter email address" Option from the form itself it gets updated with the email that does not exist on sys_user table.

 

var comp =  $sp.getParameter('comp'); 				
		var graddnonpIsr = new GlideRecord('core_company'); 
		graddnonpIsr.addQuery('sys_id',comp);
		graddnonpIsr.query();
		if(graddnonpIsr.next())
		{			
			
			graddnonpIsr.u_sup_cont = input.nonpcontacts.u_support_cont;
			graddnonpIsr.update();	
			flag = true;
		}		

However I am trying to update the same field via server side script with code (above) what happens is it checks if email exist on sys_user table and updates that user on the field which we do not want to happen. I do not want it to look up to user records instead just update the email address entered by user and update the field. How do I do the same?

 

DB1_3-1711368642670.png

 

 

5 REPLIES 5

Jagadish Sanadi
Kilo Sage

Hello @DB1 

 

Could you  please check email id exists in system or not

I do not want it to check the email id if it exist on the system. I just want the field to update the email address entered by the user. 
Current behaviour of the form is if you enter any email address, if it exist on system or if it does not it just updates the email address to the field which I think happens via "Enter email address" option I need the same to happen from backend. How do I do it

Hello @DB1 

 

If you do not want to look user table while updating. It will update whole record.

 

On what condition/query  you need to update email if the email doesn't exists  get confirmed from your requirement.

 

Or you can add query as email!=empty and run script to update

 

 

Please mark helpful if I have answered you

 

 

 

DB1
Tera Contributor

For example,

DB1_0-1711369160898.png

I entered test@fake.com on "select a target record" which pulled the existing record however I entered the same email id on "enter email address" which took the input test@fake.com and the form just updated the field

DB1_1-1711369272742.png

But, I try to update the field via server script as 

graddnonpIsr.u_sup_cont = input.nonpcontacts.u_support_cont;

 

It looks the user record but I do not want that to happen. Please help

@Ankur Bawiskar @Dr Atul G- LNG @James Chun @Harish KM