Is it possible to integrate php for a specific form field

Hi i seem to have lost this thread from previously - is it possible to add php code/ javascript to specific form fields or form groups?
thanks in advance,
Chris

sorry to bump but really could do with some help here - i want to type into a field and it reference data from a database that the user has to choose, does anyone know if its possible to add coding possibilities to suite?

Hi eroticspoon,

Are you looking for something similar to a auto populate field ? it can be done will require some coding to allow this. I am not aware of any examples within SuiteCRM which do this currently, so you would need to attach an event handler to the field and use ajax to get the information from PHP.

If the information is in another module using a relate field would do the same job ?

Ian.

Hi Ian, is there any information or documenntation about event handling of fields in suitecrm?

There are a number of ways to do this being upgrade safe.

so attaching js code to a field.

http://sugarcrm-customization-ash.blogspot.co.uk/2013/04/how-to-call-javascript-function-from.html

or the cleanner way is attaching a js file to a edit view.

http://developer.sugarcrm.com/2013/09/06/adding-javascript-files-to-edit-and-detail-views/

which then you can just use jquery to attach a on click or on blur event to the field as you would normally do.

Ian.

thats great thanks Ian, i take it i can also execute php requirements through here too?

I wouldnt recommend doing php in the edit defs as there is a possiblity if something is changed in studio for that layout it will clear the php.

have a look here,

http://archive.h2ik.co/2012/03/sugarcrm-upgrade-safe-way-to-extend-views/

This shows you how to extend the view which allows you to put php in the view. for what you want to do you would want to make a ajax call in the js file which will allow you to do php work and return the data.

Ian.