- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 04:31 AM
Hello, I created a UI action that create new contact.
I used g modal for pop up and I'm trying to add refence filed but with no luck showing values.
the UI action is in global and I tried also in customer service app.
as you can see that the reference filed is created but with no values.
what the problem could be ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 05:37 AM
@eyal abu hamad Change the name attribute value.
From
name: 'customer account',
to
name: 'account',
Give a try, I think it should work after this.
Thanks,
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 06:38 AM
Hi,
Please check the name you are giving 'customer account' ..
It may be 'customer_account' ..please check once
If type is reference:
then name should be the reference field on the current record being used to search
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 04:40 AM
Hi ,
Use g:ui_reference in your UI page for creating reference field
example:
<g:ui_reference name="account" id="account_id" table="<account table name>" query="active=true" columns="account_id,account_name"/>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 04:42 AM
I'm not using UI page. it is UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 05:10 AM
Hi,
Are you not passing any UI page in GlideModal?
Like below
var gModal = new GlideModal('ui_page_name');
can you share the code you are using in your UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 05:12 AM
function onClick(g_form) {
g_modal.showFields({
title: "New Caller",
fields: [{
type: 'textarea',
name: 'first name',
label: getMessage('first name'),
mandatory: true
}, {
type: 'textarea',
name: 'last name',
label: getMessage('last name'),
mandatory: true
}, {
type: 'choice',
name: 'line of bussiness',
label: getMessage('line of bussiness'),
value: getMessage(' -- Select -- '),
choices: [{
displayValue: 'Retail',
value: 'retail'
},
{
displayValue: 'Unattended',
value: 'unattended'
}
],
mandatory: true
}, {
type: 'reference',
name: 'customer account',
label: getMessage('Account'),
mandatory: false,
reference: 'customer_account',
referringTable: 'sn_customerservice_case',
referringRecordId: g_form.getUniqueValue()
}, {
type: 'textarea',
name: 'email',
label: getMessage('Email'),
mandatory: true
}],
size: 'lg'
}).then(function(fieldValues) {
var ga = new GlideAjax('global.CSManagementUtils');
ga.addParam('sysparm_name', 'createNewContact');
ga.addParam('sysparm_firstName', fieldValues.updatedFields[0].value);
ga.addParam('sysparm_lastName', fieldValues.updatedFields[1].value);
ga.addParam('sysparm_lob', fieldValues.updatedFields[2].value);
ga.addParam('sysparm_account', fieldValues.updatedFields[3].value);
ga.addParam('sysparm_email', fieldValues.updatedFields[4].value);
ga.getXML(updateCampus);
function updateCampus(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer) {
var mandField = g_form.getFieldNames();
var onlyMnad = mandField.filter(filterForMissingMandatoryFields);
for (var i = 0; i < onlyMnad.length; i++) {
g_form.setMandatory(onlyMnad[i], false);
}
g_form.getValue('u_caller',answer);
//g_form.u_caller = answer;
//g_form.save();
}
}
});
}
function filterForMissingMandatoryFields(field) {
//check if field is mandatory
if (g_form.isMandatory(field)) {
//return if there is no value
return !g_form.getValue(field);
}
}
