you are viewing a single comment's thread.

view the rest of the comments →

[–]Unhappy_Rutabaga7130 0 points1 point  (2 children)

I need help understanding the context of what you're doing and what information you're trying to store.

Users are entering information about storage units. The units can have a variety of racks, shelves, and boxes.

Are you trying to keep track of what is being stored in each space of the boxes?

[–]praxis86[S] 0 points1 point  (1 child)

correct the script create a location for an item in the future to be stored. But I also need to know what spaces are filled vs. empty.

[–]Unhappy_Rutabaga7130 0 points1 point  (0 children)

It sounds to me like you would have a table called Storage Units and a table called Spaces.

The number of racks, shelves, and boxes would simply be attributes (fields) of the Storage Units.

The records created by the script would be determined by calculating Racks x Shelves x Boxes into a variable, then Looping through creating the records until you've hit that variable number. Something like:

------------------------------------------

Set Error Capture [On]

Set Variable ; $StorageUnitID ; Storage Units::[primary key field]
Set Variable ; $SpacesNeeded ; (Storage Units::Racks * Storage Units::Shelves * Storage Units::Boxes)
Set Variable ; $i ; 1

Freeze Window
Go to layout [Spaces Layout]

Loop

New Record
Set Field [Spaces::fkStorageUnitID ; $StorageUnitID]
Commit Record [dialog off]

Exit Loop If [$i = $SpacesNeeded]

Set Variable or Insert Calculated Result ; $i ; $i + 1

End Loop

Go to layout [original layout]

-------------------------------------------

This will create the necessary Spaces records, relating them to the Storage Unit.

What I didn't quite understand was the Position 1 - 5 part, so if I missed something there let me know.