Derived fields

I've got a requirement to put company executive's PA information onto their record. The way I intend to do this is to have an advanced search select field on the person, that points to the person entity within the same company record. Simple and I've done that. What I would like to do is have a couple of readonly fieldsdisplayed next to this one that shows the PA phone number and PA Email address as if they were standard fields.

Now, I know I can add derived/calculated fields into a SQL view and I can create the translations for a fake column name, but what I don't want to do is copy the phone and email to the other record as that duplicates data and will require tablescripts to ensure that they are kept in sync. So, derived fields seemed to be the way to go. The trouble is that the view(s) I need to edit to display these on the PersonBoxLong screen are the vPerson and/or vPersonPE, which are both core views so not editable. Now, on my dev server, I thought I would modify the view to make it editable and I added the derived fields. No errors anywhere but when I edit the PersonBoxLong, even after an iisreset or metadata refresh, the derived fields don't appear in the list of available fields.

I did a SQL trace on how this screen populates its fields list in case it used another view, but it seems to just do a select top 1 * from person instead of querying a view to get a field list.

I've read this article numerous times over the years: https://community.sagecrm.com/partner_community/b/hints_tips_and_tricks/archive/2008/08/05/custom-edits-and-derived-fields-created-in-views.aspx

I will use the dummy field technique, but if I do, the email field won't be a clickable link. I'll need to create a new email field and make it readonly and use a createscript to populate it on screen load.

Unless anyone has any other ideas?

Thanks.

  • 0

    I resolved this in the end. I created the PA, PA Email, and PA Phone fields. They were SSA, email, and phone types respectively. The phone and email fields were set to read only in the field security.

    I then created 2 createscripts to pull the data through into the captions of the phone and email fields, and thne a custom content script that used the client side API and some jquery to put the data back into the right places. As the email address needed to be a clickable link, I had to push the email address text into the field and the inbuilt function to make the email a clickable link automatically turned it into an email link.

    Putting derived fields in, can be quite easy unless you need to mess around with core views.

    This means that when I choose a PA on the person record, on save, the other two fields display the data from that other person record. The only issue here is that if you were reporting on these fields, the only one that really contained data would be the advanced search select, but in those situations, I would create a new report view and add the data in via derived fields.