Customize editview for a new case

Hi all,

I’m trying to customize Cases->editview form in Suitecrm Version 7.8.11.

The scenario is that a new case requires the identifier of a customer asset (eg. ,a piece of machinery). I’ve created a custom field for the asset identifier and it is displayed as a dropdown on the Edit form. Now I need to be able to grab the ‘Account ID’ associated with the Account Name text field and feed it to a JQuery function to dynamically load the Asset dropdown through a web services call to another application’s API.

Loading the asset dropdown via web service works if the Case is being created from the Accounts->Case sub-panel where account_id is passed in the $POST/$GET arrays.

I’ve tried to detect various events (change, click, focusin) on the account_name selector to get the value of hidden field ‘account_id’ without complete success. The selected account’s identifier isn’t always detectable. I’m not sure how/when the search and popup logic that populates the ‘account_name’ text field changes the value of the hidden account_id field.

I’m open to any suggestions even if it doesn’t involve the use of JQuery.

Any ideas will be appreciated.

Sorry, I don’t really know the full answer to what you’re asking, but I would say you could start by exploring the server-side possibilities, in PHP using Beans, instead of this client-side javascript approach.

Have a look at the Developer Guide for SuiteCRM.

Thanks for your response and the link to the Developer guide pgr.

I was able to accomplish 90% of what I set out to do using the client-side javascript. The breakthrough came when I realized that;

It was impossible to detect a change to account_name (visible) and account_id (hidden) input elements
once the user selects an account or dismisses the popup windows, focus is always returned to the button that invokes the popup window

I wrote a bit of code to handle the ‘focus’ event of that button. It grabs the account_id for the selected account and retrieves the customer assets via web service to load a dropdown. with key->value pairs.

Thanks again.