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

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

Recommended Posts

Posted

Hi All,

I have records that each have several files that I am inserting into container fields. I would like to know if there is a way to use one script and have the field being imported to detirmined by a script parameter carrying the field name?

Thanks

Posted (edited)

I think you've stumbled on the fact that you can't use the 'Set Field By Name' script step to enter data into container fields. I'm not sure why this is, since you can use the 'Set Field' step for this purpose. Therefore I think you'll need to do it the old fashioned way...

Have your script import the file into a global container. Then run a loop containing the 'Go to Next Field' and 'Exit Loop If [ Get ( ActiveFieldName ) = Get (ScriptParameter) ]'. Bracket the loop with 'Freeze Window' and 'Refresh Window' so the user doesn't have to watch the cursor jumping through the fields. Then use the 'Set Field' step specifying tempContainer as the calulated result.

Edited by Guest
Posted

Sorry for the confusion comment. I am looking to insert a file or picture into a container field. I currently have a button set up for each field and was about to script each one seperately with goto field and inset file / picture. But then I thought it would be nice to have one script that will insert into any field according to a script parameter. I was also thinking I could specify file or picture by combining field - type in the parameter and parsing it out.

Posted

Well, if it always were a picture, you could do:

If [ Get (ScriptParameter) = 1 ]

Go to Field [ Table::Container 1 ]

Else If [ Get (ScriptParameter) = 2 ]

Go to Field [ Table::Container 2 ]

Else

Go to Field [ Table::Container 3 ]

End If

Insert Picture []

or, if you name the field objects:

Go to Object [ Get (ScriptParameter) ]

Insert Picture []

But I don't see how you're going to make the call between picture and file - will there be a separate button for each?

Posted

Thanks comment. I was able to put it together using the object idea. So here is my solution using a script parameter formated as "Object - Type".

Go to Object [ Object Name: LeftWords ( Get ( ScriptParameter ) ; 1 ) ]

If [ RightWords ( Get ( ScriptParameter ) ; 1 ) = "Picture" ]

Insert Picture [ ]

Else If [ RightWords ( Get ( ScriptParameter ) ; 1 ) = "File" ]

Insert File [ ]

End If

It's working great!

Thanks again

Posted

What leads you to this conclusion.

I tried it.

The 'Set Field' script transfers the contents of a container item from one field to another but the 'Set Field By Name' script does not.

Does it work for you?

Posted

Oh, you're right. Thanks for straightening me out. I was leaving out the quote marks in the target calculation. :

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