In string field not taking second value, but in log i am getting two times
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2024 09:26 AM
Here in log "Names are "repeating two times, but while adding to the form in the watchlist and description I am getting only one user name, anything wrong in the code let me know
var grm = new GlideRecord('customer_account');
grm.addQuery('name', current.account.name);
grm.query();
gs.log('loop one' + current.account.getDisplayValue());
if (grm.next()) {
var grmh = new GlideRecord('customer_contact');
//var hd = grmh.addQuery('sys_tags.0470568187e58e1075d2a9f40cbb356a','=','0470568187e58e1075d2a9f40cbb356a');
var max = grmh.addQuery('sys_tags.0470568187e58e1075d2a9f40cbb356a', '=', '0470568187e58e1075d2a9f40cbb356a');
max.addCondition('account', '=', current.account);
//grmh.addEncodedQuery('account' + '=' + current.account + '^sys_tags.0470568187e58e1075d2a9f40cbb356a=0470568187e58e1075d2a9f40cbb356a');
grmh.query();
gs.log('loop two' + current.account.name);
// gs.log('Names are one' + grmh.name);
while (grmh.next()) {
gs.log('Names are two' + grmh.name);
current.watch_list = grmh.name;
current.description = grmh.name;
current.update();
}}
Can anyone help me with this how to keep two values to the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 01:36 AM
Hi @Gillerla Rajesh ,
Please pass the current.update(); outside the while loop that must fix the issue.,...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....