CartJS created Ritm showing undefined objects in variables

NeoGeo
Tera Contributor

I am trying to create a ritm for each of a particular type of record from a custom table. I am getting the req, ritms, and tasks normally. However, the variables are displayed as '{}'.   Here is a screenshot of the issue:

NeoGeo_0-1755703749757.png

Here is a snip of the code that I am using to create the variables:

        item = ({
            'sysparm_id': 'df9051da879fe21027c6426d0ebb35a8',
            'sysparm_quantity': '1',
            'sparm_requested_for': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
            'variables': {
                'server_name': helperGR.u_name,
                'purpose': helperGR.purpose,
                'app_code': helperGR.u_app_code,
                'application': helperGR.u_application,
                'department': helperGR.u_department,
                'contact': helperGR.u_contact,
                'secondary_contact': helperGR.u_secondary_contact,
                'assignment_group': helperGR.u_assignment_group,
                'vendor': helperGR.u_vendor,
                'notes': helperGR.u_notes
            }
        });
I have placed messages into the loop and the helperGR.u_XXXX values look to be correct. I am sure I am missing something but I am chasing my tail at this point.
 
 
1 ACCEPTED SOLUTION

Chaitanya ILCR
Kilo Patron

Hi @NeoGeo ,

try this

 item = ({
     'sysparm_id': 'df9051da879fe21027c6426d0ebb35a8',
     'sysparm_quantity': 1,
     'sparm_requested_for': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
     'variables': {
         'server_name': helperGR.u_name.toString(),
         'purpose': helperGR.purpose.toString(),
         'app_code': helperGR.u_app_code.toString(),
         'application': helperGR.u_application.toString(),
         'department': helperGR.u_department.toString(),
         'contact': helperGR.u_contact.toString(),
         'secondary_contact': helperGR.u_secondary_contact.toString(),
         'assignment_group': helperGR.u_assignment_group.toString(),
         'vendor': helperGR.u_vendor.toString(),
         'notes': helperGR.u_notes.toString()
     }
 });

 

use toString and try 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

View solution in original post

2 REPLIES 2

Chaitanya ILCR
Kilo Patron

Hi @NeoGeo ,

try this

 item = ({
     'sysparm_id': 'df9051da879fe21027c6426d0ebb35a8',
     'sysparm_quantity': 1,
     'sparm_requested_for': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
     'variables': {
         'server_name': helperGR.u_name.toString(),
         'purpose': helperGR.purpose.toString(),
         'app_code': helperGR.u_app_code.toString(),
         'application': helperGR.u_application.toString(),
         'department': helperGR.u_department.toString(),
         'contact': helperGR.u_contact.toString(),
         'secondary_contact': helperGR.u_secondary_contact.toString(),
         'assignment_group': helperGR.u_assignment_group.toString(),
         'vendor': helperGR.u_vendor.toString(),
         'notes': helperGR.u_notes.toString()
     }
 });

 

use toString and try 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

NeoGeo
Tera Contributor

Chaitanya you are my hero! This 100% solved my issue.  Thanks for your speedy and insightful answer.