rafs ome Posted December 2, 2003 Posted December 2, 2003 This really bugs me rotten and any help with earn +karma in enlightening me to what is endless suffering in trying to insert data into fields with scripts when in FIND MODE. I haven't worked out why but sometimes the 'set field' just wont work. So I end up using 'insert calculated result' or even copying the data (pre find mode)changing to a 'paste layout' I have in my database mid script just so I can get the data 'pasted' into a field. Why rhyme or reason is there to the 'set field' script in find mode. (salvation guaranteed or your money back ;-)
Fenton Posted December 2, 2003 Posted December 2, 2003 I'm going to assume that you're not talking about getting errors when you use Set Field to put things like ">" in a date field; that's a different problem. In Find mode there are only two kinds of data, the Find criteria that you put in the fields, and values in global fields (which are not tied to any particular record, so are available in Find mode). The data in the records is not available; otherwise you'd be changing it not finding it. Relationships which depend on record data are not available either.* If you want to use data in a Find, you can put it into a global (of the same type) before entering Find mode, then set the regular field to the global. You only need to use Insert Calculated Result with calculations (duh), especially with Date type fields. I wouldn't use Paste unless absolutely necessary, and can't think of a case where it would be. *Relationships which have a global field on the left side and another file on the right side will still work in Find mode. You can use this to "filter" a value list; you can even reset a global in Find mode, with a script, to one of the Find criteria, thus changing the filter; it has to be scripted, 'cause you can't type into the global. This is similar to the reason you can't type into a global in a Header in List view.
Vaughan Posted December 2, 2003 Posted December 2, 2003 One of the tricks with Insert calculated Result (and Paste for that matter) is that the field *must* be on the current layout when the script step is performed, otherwise it won't work. One of the advantages of Set Field is that it's layout-independent, but Set Field only works if the data being set exactly matches the data type of the field. That's why "<" don't work in Set Field steps in date fields.
rafs ome Posted December 2, 2003 Author Posted December 2, 2003 great! - use a global as a temporary holding field, rather than lots of cutting and pasting - thanks+ I think also I sometimes forgot to un-click 'resore find requests' therefore messing with the find. With the set field date limitation when using '>' I assume the best option is to use 'Insert calculated result' here. i.e. ">"&DateToText (globaldate) I'm a bit lost with the using globals as value filters in find mode -I'll cross that bridge when I need too. Thanks for the help -your places are assured in cyber-heaven (don't you love communities that rank social status on what an individual brings to it rather that what they can take away (purchase) - hurrah
Fenton Posted December 2, 2003 Posted December 2, 2003 Yeah, using global fields to filter value lists in Find mode is a bit esoteric. I've only used it once. Generally people don't need filtered value lists so much in Find mode, 'cause they already know what they want to find. But if there are a lot of odd things to find (in this case sizes of tombstones in different types and colors :-) then it's helpful. I was just surprised that it could even be done, so I thought I'd pass it along to other developers. You're right about the Insert Calculated Result [Date field,">" & DateToText (globaldate)] In fact, you don't need any more help :-/
Oldfogey Posted December 3, 2003 Posted December 3, 2003 Fenton, Could you elaborate on your filtered value lists, please? Ta.
Recommended Posts
This topic is 7665 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 accountSign in
Already have an account? Sign in here.
Sign In Now