Dot Walking multiple levels using getReference.

HrishabhKumar
Kilo Sage

Can we dot walk more that 1 level using getReference in Client Script.

In my case I'm not able to do that, it is returning "undefined".

 

g_form.getReference('caller_id').manager.email
g_form.getReference('caller_id').department.name
 
Question:
1) Can we dot walk more that 1 level in getReference?
2) If yes, then how so? because in my case I'm getting undefined.
2 ACCEPTED SOLUTIONS

Allen Andreas
Administrator
Administrator

Hi @HrishabhKumar 

You are unable to dot-walk further than just the field on the table you getting the reference from.

Any further dot-walking would instead need to be done through GlideAjax and then passed back to the client.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

HrishabhKumar
Kilo Sage

Hi all,

After doing some research I have concluded the following.

1) We can only dot walk single level using getReference function.

2) If we need to dot walk up to multiple level then we should use GlideAjax or g_scratchpad.

View solution in original post

10 REPLIES 10

Hi,

Let me know if I can help answer any question you may have?

I did provide the answer here last week and I believe it's been answered a couple of times in other posts, but if you still have any questions about getReference() or any other client-side to server-side scripting, let me know.

Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!