The CreatorCon Call for Content is officially open! Get started here.

Server side equivilent of g_form

jared_wentzel
Kilo Contributor

A simple business rule I was creating didn't work and I found out the g_form.setValue function I was using is only client side. Is there a server side equivalent? What would I need to do to get this business rule to work?? (See attached)

SN_FCR.JPG

8 REPLIES 8

Check if   'u_fcr' is a boolean field or string field. If sting field then place the value in quotes example: current.u_fcr = "true".


jesusemelendezm
Mega Guru

Can you explain a little bit what you are trying to accomplish? I want to understand why not use client script in this case.


Depending on your requirement you can either use Client script or Business Rule.



If you are using Client Script then you have to use g_form.<field name>



If you ae using Business Rule then you must use current.<field name>. In Business rules g_for,m is not in scope in other words g_form is not available.



Client side 'g_form' is equivalent to server side 'current'.


jared_wentzel
Kilo Contributor

Thanks everyone! Looks like it was two things. I had to change the business rule to run 'before' rather than 'after' insert and I had to change the script to use current.u_fcr = true; rather than g_form.setValue.