Globally shared functons

Posted by Rollbase User on 24-Aug-2010 20:54

If I have a server side function that I use frequently, is there somewhere i can put it to make it globally available? If not, do I put it in a template field for each object? thank you.

All Replies

Posted by Admin on 24-Aug-2010 21:25

I would recommend to place all your common JavaScript functions into Hosted File, than include that file into all pages like this script:


Posted by Admin on 25-Aug-2010 01:10

sorry, I can't see your script...was it an image attachment?

Posted by Admin on 25-Aug-2010 21:41

Sorry Pavel, I must be doing something wrong. I get errors when I do this:

Posted by Admin on 25-Aug-2010 23:46

My example was intended for client-side use. I can try to provide similar functionality on server side as well, but it's not available at a moment.

Posted by Admin on 25-Aug-2010 23:49

that would be great. I have a HEAP of code that i'm duplicating in many formula fields. thanks Pavel.

Posted by Admin on 26-Aug-2010 22:44

You can use Template fields for this, and then just include them as merge fields in your formulas, or wherever you need to insert the JS code.

Posted by Admin on 26-Aug-2010 22:58

Hi Matt, I tried this, but get errors:



ERROR: Error illegal character (line #1) in formula: function utBoxAddress(phoneNumber, type)\n{\n if(phoneNumber.length



My template (functions_for_contac) has just the 2 functions, and i include it on line 1 like this:





Am I doing something wrong?

Posted by Admin on 26-Aug-2010 22:59

Matt, can you submit a support ticket on this with Object name and Formula field name shown above? I want to track it in our system so you get a response and have the info to take a look

Thanks,
Matt

This thread is closed