Hi Joseph
There are (at least) 3 possibilities:
If you only need these values to display in a portal, just type @@ on the
first portal row in layout mode.
If you need the number for other purposes and create all related records via
a portal in the parent file, define a number field in the child file as an
auto-enter calc:
Status(CurrentPortalRow)
In the Parent file, define the relationship based on Parent ID to allow
creation of new related records. Whenever a new record is made through a
portal in the parent file, the portal row number to be auto-entered in the
number field.
If you don't want to allow the creation of related record via the portal,
script the creation of new related record and the calclation of this number.
Parent File
Set Field ["gParent ID", "Parent ID]
Perform Script [Sub-scripts, External: "Child.fp5"]
Exit Record/Request
Child File
New Record/Request
Set Field ["Parent ID", "Parent::gParent ID]
Set Field ["No" "Count(SJ ParentID::ParentID + 1]
(where g designates a global number field, Parent:: designates a reverse
relationship from child to parent based on Parent ID on both sides, and SJ
ParentID:: designates a self join relationship in the child file based on
the Parent ID field on both sides)
Bridget Eley
in article 6b6ea86e.0308111017.7ede0971 (AT) po...OT) google.com, Joseph O'Brien
at obrien1984 (AT) hotmail (DOT) com wrote on 12/8/03 4:17 AM:
Quote:
This is probably an easy one, but I would appreciate it if someone
could save me some time with his or her experience.
I have two related files: Jobs and Proofs. A single Job record may
have multiple Proofs. The first proof for a single Job should always
be "1," the second, "2," etc. What is the cleanest way to get this
done?
If this is not enough information, please let me know.
Thanks,
joseph |