Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Is there any way to set a field that a Set Field[ ] or Insert Calculated Result [ ] script step can use for the specified field?

I built a calendar file today. I want to be able to create about 111 scripts to Copy, Copy/Paste, and Set Field. Copy is too easy. Copy/Paste is easy enough, but I have to go in and respecify the Paste field and Go To Layout steps of the script when I import them into another file. Similar changes are necessay for the Set Field based scripts.

I want to create a global field on a developer layout to set the field for my Set Field and Paste steps similar to how I would use GetField( ) set up a quassi-dymanic lookup field.

In my PO database, I want the scripts to set a Date_Order field or a Date_ETA field, in a Project database, I want the scripts to set a Date_ContractComplete field, and in a personal Contact database I want them to set a Date_Birth field.

Any thoughts on how to use a g_SetField glabal to be picked up in a script to prevent changing 37 scripts to set one field in a file?

Or better yet not have to import the script into the current file using only one script with three variables to set the different fields?

Thanks

Posted

That was a hot topic among the community about programatically being able to specify which table occurrence and field you would like to set. Unfortunately this is not possible in v5 v6 or v7.

Posted

You might also be able to use the Set Field [ , calc] trick, where you use Go to Next Field and Set Field, without specifying a field, so that it operates on the currently selected one. You would put all the necessary fields on one layout and loop through them using Go to Next Field, setting them, and exiting the loop once a particular field or number of fields was reached.

Posted

Thanks -Queue-,

I was thinking of a layout with only two fields, a constant field and the field I wanted to set; but, I was to embarrassed to mention it. It is not very dynamic if a layout change is required.

I used this...


If ["PatternCount( FieldNames( Status( CurrentFileName) , Status( CurrentLayoutName) ) , gInsertField )"]

[color:"white"]__[/color]Loop

[color:"white"]____[/color]Go to Next Field

[color:"white"]____[/color]Exit Loop If ["Status( CurrentFieldName ) = gInsertField "]

[color:"white"]__[/color]End Loop

[color:"white"]__[/color]Paste [select]

Else

[color:"white"]__[/color]Show Message ["The destination field is not available on this layout."]

End If

Exit Record/Request

It also works with Set Field [], but this application calls for Paste [].

Thanks

Posted

You shouldn't be embarrassed at all. That's a very decent workaround, especially if InsertField is a global into which you are setting the name of the field to find. It's very dynamic. Since the field has to be on the current layout anyway, the only advantage in using Set Field over Paste or an Insert function is that it may be faster.

This topic is 7341 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.