Jump to content

How to fire OnRecordLoad script trigger through a portal?


Rich S

This topic is 3569 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Howdy, howdy...

 

I have a script that changes the color of all the fields' text in a record whenever that record is selected (while in List view); it's set up using the script trigger, OnRecordLoad, in Layout Setup. Works great.

 

However...

 

I want to use it the same script for a child table from a parent on a different layout (and of course, table) with a portal connecting the two. OnRecordLoad won't work in the parent table since it has its own layout and OnRecordLoad only works on that table's/layout's records. So, how do I fire the script so when I select a record in the parent's portal it'll fire the script to highlight a related record's text?

 

TIA for your help!

Link to comment
Share on other sites

Are you really changing the color of the data inside the field?  I would stop doing that:

- it requires a trip to the database engine to update the data, so you'll get into performance issues very quickly if you add users

- since the data itself changes, those changes are visible to ALL users, not just the user that selected the record or the portal row

 

Why not use conditional formatting instead?  Requires no data changes and no scripts.

  • Like 1
Link to comment
Share on other sites

Good question! I would if I could but when in List view, where there are a lot of line-type records, I want the color change to make it easier for the user to see which record s/he's currently focused on. (Because of the author's preference for a particular color scheme I can't tweak the background color for the record.) How would I do that without a script trigger?

 

(BTW, the solution is for client machines and single-user only, so I don't have to worry much about performance.  )

 

ON EDIT:

 

Actually, I'm already using conditional formatting with a formula of $$_ID__WEBSITE = WEBSITE::_kpln__WebsiteID so when the script trigger fires the script that compares the record ID, the text changes to the color spec'd in conditional formatting.

Link to comment
Share on other sites

You are using 13.  So on your custom theme (if you are using an existing theme, just duplicate it and make THAT your current theme throughout) ... you select the body of your layout then, in the States popup, select 'in focus' active and change it to the highlight colour you wish.  Then save that style change to the theme.  Then save that change to your custom theme.

 

If you wish, I can produce a small video but play with it ... it's one of the funnest aspects of 13!  :-)

 

BTW, I must correct ... for the body, you would select 'active' as well.  Fields have 'in focus' but body has 'active'.

Edited by LaRetta
  • Like 1
Link to comment
Share on other sites

PS if you only want that highlight in the body of list view, save the body colour as indicated as new style maybe called Body.List and then save it to your custom theme.

Link to comment
Share on other sites

Interest idea, LaRetta! In fact, I created a custom theme for the solution this belongs to so I can get in there and tweak it. I'll just have to be careful that whichever style I attach to the fields in the portal doesn't affect the ones in the parent. 

 

As an aside, are you still riding a bike? 

Link to comment
Share on other sites

Okay, what I suggested changes the body of list view for the current layout.  To apply same to portal, you would use portal instead.  Select portal then the popup and note that it has two - Portal and Portal Row.  Select portal row and specify 'active' and change your colour there.  And again, if there is some reason you do not want other portals to highlight the same, save it as a new style to your custom theme.  :-)

Link to comment
Share on other sites

This topic is 3569 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.