What's the best way to auto populate a field dependent on another field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2014 08:41 AM
I'd like to implement something where by if a certain priority is set (e.g. P1) that the 'Major Incident' template is inserted.
So that the description and short description fields are populated with template text.
What's the best way to go about implementing this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 06:28 AM
several points...
first a consideration.. do you want the user able to modify the record AFTER the template is applied and possibly overwrite fields the template set... if so you do NOT wan this done in a BR... if not remember ANY field filled in on the template will over write what the person has entered on save...
to make it not work if the previous priority was blank you can test vs "oldValue" in the first line where you see the function onchange line any field inside the () you can use ... so in an onChange oldValue, newValue, and isLoading are all available to you...
in the template do you set the priority or have a line on the template to set the priority.. that is the only reason it should blank the priority.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 07:01 AM
Thanks Doug. To confirm my requirements...
The intention of this template is that in a Major Incident it applies example text in the short description and description fields so people can then over type with the current information.
I only want this template to apply if the previous priority was 'none'. Therefore ensuring if an incident is escalated from P3 to P2 it doesn't apply the template again (as it would have already been populated).
I need the record to insert the template on changing of the priority field, else it will be missed (e.g. if entered on save).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 07:11 AM
then you are going to have to do this in a client script NOT a BR... br's apply after the record is updated or insert the before selection applies to the order of when the br runs it will NOT affect the form before the customer his save..
i would test for if (oldvalue == ''); to to filter out times when the priority was blank if i recall that should filter those out but test it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 04:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 04:58 AM