mandatory field in catalog item in service portal issue

Codi
Tera Contributor

Hi guys,

we encountered an issue in the ticket created via service portal. What happened is when this ticket was created one of the mandatory field in catalog item is blank. So the problem is we cannot change the state of the ticket since they are asking for the value of the mandatory field.

1 ACCEPTED SOLUTION

Hi @Codi 

 

I assume its a drop-down

 

There is one way...!! check if it works for you...!!

 

Open the form - 

press below keys on keyboard , don't remove your fingers from button unless you press 'J' 

 

ctrl + shift + alt + j 

 

the below executer will open -- 

 

VishalBirajdar7_0-1695643990645.png

 

Write below code & click on "Run my code"  [upper right corner]

 

//use your variable backend name

//add one dummy option 

g_form.addOption('type of licence','test','test');
g_form.setValue('type of licence','test');

 

This will set the value to type of licence variable.

Now close the executor and save the form.

 

Let me know if this worked..!!

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

13 REPLIES 13

Hi @Codi 

 

Can you send the screenshot...??

is it reference field or dropdown...??

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Hi @Vishal Birajdar here is the screenshot, but when I click the drop down no value is available

markoy_0-1695643666368.png

 

Hi @Codi 

 

I assume its a drop-down

 

There is one way...!! check if it works for you...!!

 

Open the form - 

press below keys on keyboard , don't remove your fingers from button unless you press 'J' 

 

ctrl + shift + alt + j 

 

the below executer will open -- 

 

VishalBirajdar7_0-1695643990645.png

 

Write below code & click on "Run my code"  [upper right corner]

 

//use your variable backend name

//add one dummy option 

g_form.addOption('type of licence','test','test');
g_form.setValue('type of licence','test');

 

This will set the value to type of licence variable.

Now close the executor and save the form.

 

Let me know if this worked..!!

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Hi @Codi 

 

Did you get chance to try the above solution...? it worked ?

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Hi @Vishal Birajdar it worked in the test environment but we haven't try to used it if no value on the field but thanks for this solution, we can used it in the future