Jump to content

Relationships


pradeep

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

Recommended Posts

This must be simple to do but I just can't figure it out.I have 2 realted files related by Id.Its one to many realtionship.A has got one product code and B has got many products with that product code.I want to set a field from the last product of B into a field in Product A.How do I do this.

Thank You

Link to comment
Share on other sites

I'd probably do this with a script. Pass the contents of the field in the last record of file B using a global field in file A. How to access a global field in file A from file B?

Create a field in both file A and File B:

Constant (calculation, number, indexed) = 1

Create a field in file A:

gTemp (global, text or number)

Create a relationship in file B:

ConstRel with Contant (file B) <--> Constant (file A)

Then create a script in A:

Allow User Abort (off)

Set Error Capture (on)

Perform Script (external, file B, "Get Field Script")

Set Field(YourField, gTemp)

Create a script in B called "Get Field Script":

Allow User Abort (off)

Set Error Capture (on)

Show All Records

Go to Record/Request/Page (last)

Set Field (ConstRel::gTemp, YourFieldInB)

-bd

Link to comment
Share on other sites

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