2 of 2 people found this helpful
Let's say your field is named "category." Make a script something like:
If[ category = "DB" ]
go to layout[ stickers ]
Else If[ category = "DRIB" ]
go to layout[ stickers ]
go to layout[ labels ]
Now you'll need to trigger that script when navigating to a record, and I would imagine when you select a category as well.
In layout mode, right-click the category field, select Set Script Triggers; select On Object Modify; and choose the script and say OK.
Now go to the Layout menu, choose Layout Setup, click the Script Triggers tab; select OnRecordLoad and choose the script and say OK.
This only works one record at a time. If you're printing a mixed group of records, then you may need a solution that's based on hiding objects on a single layout rather than switching layouts.
thanks for your help.
will the [ category = "DB" ] work when there are other characters within the same field. eg. DB142 or something like that
we will generally be printing a mixed set of records so do you have any ideas how to create a solution that's based on hiding objects?
do you just mean have a shape that covers the whole record and is set to cover if field contains those values?
Have a look at the Text functions. For example you might use: Left( category; 2 ) = "DB"
But without knowing all the details, I can't say whether that will be sufficient.
Your original post mentioned different sticker shapes. I'm familiar with sheets of labels that come in different dimensions. But I'm not sure what we're talking about when you want to mix different shapes on the same layout. Maybe you could describe what you're doing with a little more detail.
yes it is sort of like sheets of labels but all the products are in the same table and the products with DB and DRIB at the start of the product code need to have a different shaped label. this may not be possible but I was hoping there would be some solution
So the label sheets are not pre-cut? Are we talking rectangular shapes or what?
no we print on to a4 sheets and then cut them out. the shapes are rectangular yes.
Won't it be a pain to cut them if they're all different sizes? Are both the horizontal and vertical dimensions different?
How many at a time do you print? Maybe you just need a simple script that does a Find for "DB" and "DRIB" and prints those, then find the others and goes to the other layout and prints.
that does sound like a suitable option and I will just have a small print labels button to trigger the script.
how would I format the script? like in what order should everything be?
I would suggest you create a script, and create a comment in the script for each process you'll need. E.g.:
1. Find the DB/DRIBs
2. Go to layout x
Then go back and flesh it out with actual script steps. It's easier than you think. Give it a try and come back if you get stuck.
I got stuck when it came to doing the find - I got the same process as you but when it performed the find it didn't work and the printer started going hard out until I deleted the job!!!
Items__1::CodeID is the field that it needs to search in and the first search needs to be for records that either have DB or records that have DRIB in them. the second search is the opposite.
can you tell me how to write the find for that please.
The go to layout and print I was obviously able to do no worries - and I will just hide the print dialog and go show all records in between the two finds
While it's possible to do a Find by specifying the find requests within a single Perform Find script step, I prefer to use separate steps to explicitly build the Find. This makes it easier to maintain and troubleshoot later. So:
Enter Find mode
Set Field[ Items__1::CodeID; "DB" ]
Set Field[ Items__1::CodeID; "DRIB" ]
Be sure that you don't specify the find requests within the Enter Find or Perform Find steps.
After you print the found records, you can simply do:
Show Omitted Only
... assuming there are no other criteria. I.e., we're working with all the records in the table, not just some for a particular client or something.
If you want to up your Find game, have a look here:
thanks so much!! works like a charm!!
how can I reference different scripts from a custom dialog? I want to be able to reference one script if the user wants to print all records and reference another script if the user wants to print only the current record