Jump to content

Coping in an empty field...


soriano
 Share

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

Recommended Posts

Hi, again:

In my DB a user needs to copy information to a portal without having see the portal, it is possible to do this with a Script...

He needs to copy of three fields towards the portal which contains six fields, the first three fields used, by which I need that he copies in the field 4, 5 and 6..

It is important that they are copied in the empty fields, for example, in my portal(See above) I have 2 records of which 1 do not have descripcion in fields 4, 5 and 6 he begins for the record 2 field 4...

PORTAL

FIELD1 FIELD2 FIELD3 FIELD4 FIELD5 FIELD6

VALID VALID VALID VALID VALID VALID

VALID VALID VALID EMPTY EMPTY EMPTY

I hope you can understand my message, please forgive my English, I am in wait of your commentaries.

Best regards

Link to comment
Share on other sites

If there is only one unique related record this is easy, just use the Set Field command in your script to set the fields in the related record.

Set Field [::”Relationship::Field4”, “Field in this file”]

Set Field [::”Relationship::Field5”, “Field in this file”]

Set Field [::”Relationship::Field6”, “Field in this file”]

If you only want to enter data if the field is empty, you will need to add an “If” step:

If [“IsEmpty(Relationship::Field4)”]

Set Field [::”Relationship::Field4”, “Field in this file”]

End If

And do this for each field.

When you enter the set field command in a script and click on “Field” to tell it which field, there is a drop down menu at the top of the popup, you can select the relationship here.

Hope this helps,

Rigsby

Link to comment
Share on other sites

thanks for your answer...

the script works but just work with the first empty filed in the first row, if I create many records in my portal this script doesn't work with the next portal rows, what do you thing it's happening ?

I need that this is applied in every field of the empty portal due to the fact that he is a user who can not see the portal just need copy the informatio trough the script.

Thanks again for your help.... This is the best forum about File Maker

Thanks (GRACIAS)

Jorgito

Link to comment
Share on other sites

In your original question: I'm not sure what you mean by portal fields. Do you mean the portal rows, or fields in each related record.

A portal lists related records in the form of a table. The "order" of the rows (related records) is determined by the sort order that is associated with the protal's relationship. So part of the challenge when dealing with portals is determining exactly which related record is the "first".

I think this could be done with a script: on the master record with the portal, use the "Go to related record [show]" step to perform a "find" in the related database and isolate the records. Then perform a script in the related database that sorts the records (so the order is the same as the portal) then performs whatever field magic is neccesary. Call a script in the master file to return to the original databaase and layout.

The trick here is 1) sorting the related records; and 2) having scripts in both databases, each to perform their own part of the process.

Link to comment
Share on other sites

This topic is 7347 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
 Share

×
×
  • Create New...

Important Information

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