Hi, this is Paul with AppWorks, and today I’m going to show you a little trick by which you can make a button that you can put on any layout, and you don’t have to specify which layout you’re on, and it’ll still show you data from that particular record. I find this particularly useful if you have a consistent naming pattern with your fields and you’ve got a button and you use it in a lot of places and you just don’t want to have to go through the trouble of saying when you’re on this table, or in that table, use this field or that field. 

So what you would do is you would come in here and make a button, and let’s say, for instance, you wanted to find out when this was created, and you didn’t want to show the field on here for that reason. In this case, you use a single step, and you would say Show Custom Dialog, and in the message, what you would do is you would say “GetField ( FieldName )” and rather than specifying, you’d say Get (LayoutTableName), which would give you in this case person and z_::CreatedTS. So you’re going to get text results from the internal part of this, which is going to say Person::z_Created, and then the get field will use that to give you the actual data. 

So then, now we can see that, and then you want to have this on, say, a different table or a company. Just copy this and paste the same button, and now it’s showing you when this particular one was created. That’ll work for any record for any table, as long as your name is consistent and your creation timestamp field is always named the same thing. So you can use this for an ID field, for a name field, if it’s name is always the same, and it opens up a lot of opportunities in scripting to grab data from a lot of sources without having to go in there and specify the field each time.