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

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

Recommended Posts

Posted

I have spent too long on this already but I just can not see the problem. I need your help. I have two databeses one a stock master and one a tags database. I need to create difrferent quantities of tags depending on my stock level and how many items I have in stock.

My tags database has the information

Item reeference

Price (Lookup from stock master)

Qty Information (lookup from stock master which can be changed)

Next qty to print (Qty-1)

Copy Tag? (Y/N) (boolean Calculated on creation yes if Next Qty to print is greater than 0 )

Sart Printing Loop

My problem is I am trying to create a script that will duplicate the label records untill I have the correct number of labels. If I need 10 labels I want the system to duplicate the record untill it has ten records. If I need 6 labels I want it to duplicate untill I have 6 records.

I have been working on a script which is below but while it will work for one item it always stops on the second.

It runs:

Loop

Find items to duplicate

Go to first recrod

Set Copy? to N

Set field Qty to print =Next qty to print

Loop

Duplicate record

Go to last record

If Next qty to print <0

Perform script (This script)

End if

Set Copy? N

Set Qty to Print = Next qty to print

End Loop

End Loop

Posted

Not sure I followed all that, but how about something like this:

Go to Record [First]

Loop

If [ Quantity > 1 ]

SetField [ Quantity, Quantity - 1 ]

Duplicate Record

SetField [ Quantity, 1 ]

End If

Go to Record [Next, Exit if Last]

End Loop

At the end of that loop, each record should have Quantity of 1, assuming you already rid yourself of zeros. If not, just add an Else to the If above:

Else

If [ Quantity < 1 ]

Delete Record

End If

Hope that helps save your sanity! wink.gif

Posted

I have put it to the test. It works after a little adjustment. I added Find records where Qty to print is >1.

I also had to change The last Go to Record line to first and I had tell it to find again.

My only problem now is that the script while it gets everything done comes up with the message can not find records. Is there any way to avoid this?

Posted

I have cracked it, I would not have done it without your help kennedy thanks a million.

I have also gotten over the looping problem by setting in a end loop step. It is strange but my learning curve with this software is not slowing down. I think I am only starting to learn how much I don't know

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