- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2023 04:05 AM
Hi guys, I have an urgent task to do. I have an item Keep with "type" field with value to point to service_offering, each service_offering has in the endorseable option for different item.
When the user chooses the type (service_offering) I must show the description of the current choice of service_offering under an information box or inside another field (I don't know).
If I try with the catalog script, do I have to make a glide record on service_offering and take the description field? Or is there another simple method to show description on field type?
Thanks in advance !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 05:19 AM
To show the description of the service offer each time the user chooses another, i needed to do a Script Include for retrieve the description with glide record and then an catalog client script with an call back function.
Here the Reference:
Thanks everybody for the support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2023 04:10 AM
Hello @Dario_C
You can use onChange Client Script.
Where on change of field, you can populate the description value.
Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2023 07:15 AM
Hi Dario,
for this you want to use an onChange client script
function onChangeChoiceField() {
var choiceField = g_form.getValue('choice_field'); // Get the value of the choice field
if (choiceField === 'x') {
g_form.setValue('description', 'Description for choice x');
} else if (choiceField === 'y') {
g_form.setValue('description', 'Description for choice y');
} else if (choiceField === 'z') {
g_form.setValue('description', 'Description for choice z');
} else {
g_form.setValue('description', ''); // Set an empty value if none of the specified choices are selected
}
}
Here is just a quick example of an onChnahe client script, if you just want to add an info message you can use
g_form.showFieldMsg('field_1', 'This is a showFieldMsg message', 'info');
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response helped in any way
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 12:25 AM
Hi @DanielCordick ,
Thanks for your answer, this script work also when service_offering is a Lookup Select Box field ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 10:21 AM
yes it should work