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

Duplicate Records according to calculation


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

Recommended Posts

Posted

Hello,

I'm in need of a little help again.

Given fields:

max # of Pieces per bundle

# of total pieces

Calculated fields:

# of bundles needed

# of peices in last bundle (always less or equal to than max # of pieces per bundle)

These two given value fields are unique according to each record. Once I have the calculated fields, is it possible then, to generate (in a related database perhaps?) one tag per bundle, such that if the # of bundles needed is 4, 4 tags will be generated, and if either of the two given fields are changed, such that the number of bundles needed changes, have the other related database update the number of tray tags which are generated. So, if the number changes to 5 needed bundles, then the other one will generate one more tag? The tags will all be the uniform test expect for the last one, which instead of listing the maximum number of peices as the number it contains, it will list the pieces left over that ended in the last "catch all" bundle.

Any ideas would help, if you have questions about what I'm trying to say, please let me know. It is a little unclear, so if I can help you understand it, let me know.

Posted

I dont have a lot of practical experience with v7 right now, here is how I would do it currently:

To create a specific number of new records in the related table:

Create 2 Global Fields in your source Table:

gCreateTotal

gCreateCounter

-- Create any other Global fields in the destionation table that will hold the necessary relational key info, and another other information that you will need to pass on to the newly created records.

Make sure a relationship exists between the source and destination tables.

In the source table run a script that does the following:

Set Field [gCreateCounter , 1 ]

Set Field [gCreateTotal , # of Bundles to be created ]

Loop

Set Field [Destination::gSerialID , SerialID] -- this is the key that allows your records to relate

--Insert any additional Set Field steps to send needed info to the destination table

Perform Script [ DestinationTable:: Create New Record ]

Exit LoopIf [ gCreateCounter = gCreateTotal ]

Set Field [ gCreateCounter , (gCreateCounter + 1) ]

End Loop

In the destination table create a script "Create New Record"

New Record/Request

Set Field [serialID , gSerialID]

--Insert any additional Set Field steps to set the needed info for the newly created record

Now for it to know how many exist in the destionation table, create a calculation field in the destination table:

cRecordCtr = 1

In the source table create a calculation field:

cDestCountSum = sum(Destination::cRecordCtr)

This will provide you with a total for the related tag records in the destination table. You can then use this to determine if there is a difference between the # needed and the number that exists.

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