Auto populating phone number

kishorkumar
Tera Contributor

Hi folks , 

     I have a requirement in catalog item. In that i have 2 variables 1. requested for 2 . phone number

based on the request below points need to be executed

     

  1. If user's has only one Phone Numbers, then the Phone Number should be auto populated.
  2. If user's have multiple Phone Numbers, then the user should be presented with the drop-down/reference list to select the Phone Number.

How i can achieve this?

2 REPLIES 2

piyushsain
Tera Guru
Tera Guru

Hi,

You have to create a two field, one is a String field if single phone number, and other is a dropdown when multiple phone numbers.

You need to Create an On Load CS and use GlideAjax to check the Phone number, if single phone show only string field and populate it via object returned by Ajax, if it is multiple phone numbers hide the String field and show Dropdown field populating multiple numbers.

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

ersureshbe
Giga Sage
Giga Sage

Hi, I believe you can use g_form.getReference() function and achieve this requirement. Refer below link to understand the usage and how to apply in the code.

https://servicenowguru.com/scripting/client-scripts-scripting/gform-getreference-callback/

 

Regards,
Suresh.