On load pop-up message

Dawid2
Giga Guru

Hi, I want to display pop-up when form loads when contact field is guest (his userID is guest).

I wrote the script, but it fails. Any ideas why?

function onLoad() {
   //Type appropriate comment here, and begin script below
   var user = g_user.UserID();
	   
	if (user == 'guest'){
		   
		   alert("Please update Contact field to actual customer reporting the issue before proceeding");
}
				 }

 

1 ACCEPTED SOLUTION

Gaurav Bajaj
Kilo Sage

Hi,

I was wondering how you have allowed the guest user to login to the system. What you can do is to fetch the contact field value itself by

g_form.getValue('name of contact field')

 

var user = g_form.getValue('name of contact field');

if (user == 'guest'){

alert("Please update Contact field to actual customer reporting the issue before proceeding");

}

View solution in original post

6 REPLIES 6

Nevermind, I changed type to before since running abort on After didn't make any sense.

Harish Ragz
Kilo Guru

Once try the below script. Modify the guest with his sysId.

function onLoad(){ 

var user = g_user.UserID();

if (user == 'sysIdOfGuestUser'){

alert("Please update Contact field to actual customer reporting the issue before proceeding");

}

}