- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 04:51 AM
Hi All,
I have to set by default HTML content in HTML variable.
I have to create a table like below.
this HTMl field is in my Sc_task level.
I have created onload sclient script on sc_task level.
and tried this.
var mySourceCode = " source code pasted here ";
g_form.setValue('backend HTML variable',mySourceCode);
but it is giving error in this line "var mySourceCode = " source code pasted here "; ". It's showing unterminated string constant.
How to fix this scenario?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 10:34 PM
@kumariDiksha Here is the updated script which you should use.
function onLoad() {
//Type appropriate comment here, and begin script below
var mySourceCode = '<p><strong>Fill the details below</strong></p> <table style="border-collapse: collapse; width: 100.957%; height: 153.958px;" border="1"> <tbody> <tr style="height: 46.1875px;"> <td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor/pricing</span></strong></span></td> <td style="width: 8.11567%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Initial Price </span></strong></span></td> <td style="width: 7.19534%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Final Price</span></strong></span></td> <td style="width: 10.2073%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Savings</span></strong></span></td> <td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Lowest Bidder</span></strong></span></td> <td style="width: 17.068%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Recommended bidder</span></strong></span></td> <td style="width: 19.076%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Reason for recommendation</span></strong></span></td> <td style="width: 8.45034%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">SAN Active</span></strong></span></td> <td style="width: 11.1277%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Remarks</span></strong></span></td> </tr> <tr style="height: 15.3958px;"> <td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor 1</span></strong></span></td> <td style="width: 8.11567%; height: 15.3958px;"> </td> <td style="width: 7.19534%; height: 15.3958px;"> </td> <td style="width: 10.2073%; height: 15.3958px;"> </td> <td style="width: 9.37067%; height: 15.3958px;"> </td> <td style="width: 17.068%; height: 15.3958px;"> </td> <td style="width: 19.076%; height: 15.3958px;"> </td> <td style="width: 8.45034%; height: 15.3958px;"> </td> <td style="width: 11.1277%; height: 15.3958px;"> </td> </tr> <tr style="height: 15.3958px;"> <td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 2</span></strong></span></td> <td style="width: 8.11567%; height: 15.3958px;"> </td> <td style="width: 7.19534%; height: 15.3958px;"> </td> <td style="width: 10.2073%; height: 15.3958px;"> </td> <td style="width: 9.37067%; height: 15.3958px;"> </td> <td style="width: 17.068%; height: 15.3958px;"> </td> <td style="width: 19.076%; height: 15.3958px;"> </td> <td style="width: 8.45034%; height: 15.3958px;"> </td> <td style="width: 11.1277%; height: 15.3958px;"> </td> </tr> <tr style="height: 15.3958px;"> <td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 3</span></strong></span></td> <td style="width: 8.11567%; height: 15.3958px;"> </td> <td style="width: 7.19534%; height: 15.3958px;"> </td> <td style="width: 10.2073%; height: 15.3958px;"> </td> <td style="width: 9.37067%; height: 15.3958px;"> </td> <td style="width: 17.068%; height: 15.3958px;"> </td> <td style="width: 19.076%; height: 15.3958px;"> </td> <td style="width: 8.45034%; height: 15.3958px;"> </td> <td style="width: 11.1277%; height: 15.3958px;"> </td> </tr> </tbody> </table>';
g_form.setValue('u_vendor_name',mySourceCode);
}
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 05:05 AM
@kumariDiksha It looks like your HTML source code is not wrapped in quotes correctly and hence the string parsing is throwing the error.
Could you please paste the code here so that I can suggest the changes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 10:23 AM
Hi @Sandeep Rajput,
this is the onload client script that I have written.
function onLoad() {
//Type appropriate comment here, and begin script below
var mySourceCode = '<p><strong>Fill the details below</strong></p>
<table style="border-collapse: collapse; width: 100.957%; height: 153.958px;" border="1">
<tbody>
<tr style="height: 46.1875px;">
<td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor/pricing</span></strong></span></td>
<td style="width: 8.11567%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Initial Price </span></strong></span></td>
<td style="width: 7.19534%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Final Price</span></strong></span></td>
<td style="width: 10.2073%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Savings</span></strong></span></td>
<td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Lowest Bidder</span></strong></span></td>
<td style="width: 17.068%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Recommended bidder</span></strong></span></td>
<td style="width: 19.076%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Reason for recommendation</span></strong></span></td>
<td style="width: 8.45034%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">SAN Active</span></strong></span></td>
<td style="width: 11.1277%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Remarks</span></strong></span></td>
</tr>
<tr style="height: 15.3958px;">
<td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor 1</span></strong></span></td>
<td style="width: 8.11567%; height: 15.3958px;"> </td>
<td style="width: 7.19534%; height: 15.3958px;"> </td>
<td style="width: 10.2073%; height: 15.3958px;"> </td>
<td style="width: 9.37067%; height: 15.3958px;"> </td>
<td style="width: 17.068%; height: 15.3958px;"> </td>
<td style="width: 19.076%; height: 15.3958px;"> </td>
<td style="width: 8.45034%; height: 15.3958px;"> </td>
<td style="width: 11.1277%; height: 15.3958px;"> </td>
</tr>
<tr style="height: 15.3958px;">
<td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 2</span></strong></span></td>
<td style="width: 8.11567%; height: 15.3958px;"> </td>
<td style="width: 7.19534%; height: 15.3958px;"> </td>
<td style="width: 10.2073%; height: 15.3958px;"> </td>
<td style="width: 9.37067%; height: 15.3958px;"> </td>
<td style="width: 17.068%; height: 15.3958px;"> </td>
<td style="width: 19.076%; height: 15.3958px;"> </td>
<td style="width: 8.45034%; height: 15.3958px;"> </td>
<td style="width: 11.1277%; height: 15.3958px;"> </td>
</tr>
<tr style="height: 15.3958px;">
<td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 3</span></strong></span></td>
<td style="width: 8.11567%; height: 15.3958px;"> </td>
<td style="width: 7.19534%; height: 15.3958px;"> </td>
<td style="width: 10.2073%; height: 15.3958px;"> </td>
<td style="width: 9.37067%; height: 15.3958px;"> </td>
<td style="width: 17.068%; height: 15.3958px;"> </td>
<td style="width: 19.076%; height: 15.3958px;"> </td>
<td style="width: 8.45034%; height: 15.3958px;"> </td>
<td style="width: 11.1277%; height: 15.3958px;"> </td>
</tr>
</tbody>
</table>';
g_form.setValue('u_vendor_name',mySourceCode);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 10:34 PM
@kumariDiksha Here is the updated script which you should use.
function onLoad() {
//Type appropriate comment here, and begin script below
var mySourceCode = '<p><strong>Fill the details below</strong></p> <table style="border-collapse: collapse; width: 100.957%; height: 153.958px;" border="1"> <tbody> <tr style="height: 46.1875px;"> <td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor/pricing</span></strong></span></td> <td style="width: 8.11567%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Initial Price </span></strong></span></td> <td style="width: 7.19534%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Final Price</span></strong></span></td> <td style="width: 10.2073%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Savings</span></strong></span></td> <td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Lowest Bidder</span></strong></span></td> <td style="width: 17.068%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Recommended bidder</span></strong></span></td> <td style="width: 19.076%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Reason for recommendation</span></strong></span></td> <td style="width: 8.45034%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">SAN Active</span></strong></span></td> <td style="width: 11.1277%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Remarks</span></strong></span></td> </tr> <tr style="height: 15.3958px;"> <td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor 1</span></strong></span></td> <td style="width: 8.11567%; height: 15.3958px;"> </td> <td style="width: 7.19534%; height: 15.3958px;"> </td> <td style="width: 10.2073%; height: 15.3958px;"> </td> <td style="width: 9.37067%; height: 15.3958px;"> </td> <td style="width: 17.068%; height: 15.3958px;"> </td> <td style="width: 19.076%; height: 15.3958px;"> </td> <td style="width: 8.45034%; height: 15.3958px;"> </td> <td style="width: 11.1277%; height: 15.3958px;"> </td> </tr> <tr style="height: 15.3958px;"> <td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 2</span></strong></span></td> <td style="width: 8.11567%; height: 15.3958px;"> </td> <td style="width: 7.19534%; height: 15.3958px;"> </td> <td style="width: 10.2073%; height: 15.3958px;"> </td> <td style="width: 9.37067%; height: 15.3958px;"> </td> <td style="width: 17.068%; height: 15.3958px;"> </td> <td style="width: 19.076%; height: 15.3958px;"> </td> <td style="width: 8.45034%; height: 15.3958px;"> </td> <td style="width: 11.1277%; height: 15.3958px;"> </td> </tr> <tr style="height: 15.3958px;"> <td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 3</span></strong></span></td> <td style="width: 8.11567%; height: 15.3958px;"> </td> <td style="width: 7.19534%; height: 15.3958px;"> </td> <td style="width: 10.2073%; height: 15.3958px;"> </td> <td style="width: 9.37067%; height: 15.3958px;"> </td> <td style="width: 17.068%; height: 15.3958px;"> </td> <td style="width: 19.076%; height: 15.3958px;"> </td> <td style="width: 8.45034%; height: 15.3958px;"> </td> <td style="width: 11.1277%; height: 15.3958px;"> </td> </tr> </tbody> </table>';
g_form.setValue('u_vendor_name',mySourceCode);
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2024 10:04 AM
Hi Sandeep,
By default it is setting the value but if I update and save the information on the ticket it is not saving the information because of the onload script. Is there any other way to set the information and if anyone update the information it should show updated information?