connecting a custom table and portal form

gayatri38
Giga Guru

I have created a new custom table - 'u_consultant_tables' with fields as u_name and u_employee_type. Have also created a new form 'Hiring new form' with variables as u_name and u_employee_type and have connected using business rule -

gayatri38_0-1706012394068.png

 

and the code is - 

 

(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('u_consultant_tables');
gr.initialize();
gr.u_name = current.u_name;
gr.u_employee_type = current.u_employee_type;
gr.insert();
})(current, previous);

 

but when the form is submitted  its showing as empty as shown -

 
 

Screenshot (31).png

 

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

Hi @gayatri38 Can you please confirm your BR is working on which table ?

Also to access variable value, you need to use current.variables.<variableName>

 

eg: 

 

(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('u_consultant_tables');
gr.initialize();
gr.u_name = current.variables.u_name;
gr.u_employee_type = current.variables.u_employee_type;
gr.insert();
})(current, previous);

 

I am assuming you are using catalog form not record producer ?

 

Thanks,

Harsh

View solution in original post

1 REPLY 1

Harsh Vardhan
Giga Patron

Hi @gayatri38 Can you please confirm your BR is working on which table ?

Also to access variable value, you need to use current.variables.<variableName>

 

eg: 

 

(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('u_consultant_tables');
gr.initialize();
gr.u_name = current.variables.u_name;
gr.u_employee_type = current.variables.u_employee_type;
gr.insert();
})(current, previous);

 

I am assuming you are using catalog form not record producer ?

 

Thanks,

Harsh