Trust ID PBCEX logo 300x102

Confusion - triggers on multiple cards

5 years 6 months ago
Mark Phelan
Expert Boarder
Expert Boarder
Posts: 95
More
Topic Author
Confusion - triggers on multiple cards #5206
I have two card layouts - one for staff, and one for students. Both layouts use completely separate tables which are populated from a central system.

Each table contains a column "readyToPrint" which is set to 1, which is the condition for the trigger.
After printing, readyToPrint is set to 0.

However, the triggers on the two cards seem to interfere with each other and the software attempts to select "staff data" for the student card as seen in the DataExchange log:
-- LST Staff:
SELECT [staffID]
FROM [staffCardDetails]
WHERE [readyToPrint] = 1

-- LST Student:
SELECT [staffID]
FROM [staffCardDetails]
WHERE [readyToPrint] = 1

Adding to the confusion, once it prints a card for one user (eg a member of staff) it tries to then find that user in the other table:
-- LST Student:
SELECT * 
FROM [studentCardDetails]
WHERE [studentNumber] = @PARAMETER0
@PARAMETER0 = S7383

-- An error occurred in DefinitionExchange:
Key value [S7383] is not found.

Am I using triggers incorrectly, or is there some mix-up between the two datasets which is causing these issues?

Thanks,
Mark
5 years 6 months ago
Rutger Koperdraad
Platinum Boarder
Platinum Boarder
Posts: 1566
More
Confusion - triggers on multiple cards #5207
Hi Mark,

It looks like you defined a storage item on the staffCardDetails table for the LST Student card and that that is generating the confusion, so please check your storage-item definitions in the database setup.

Also, keep in mind that the triggers do not use any of the filters you have defined (if any). So you might need to add additional filter conditions to the trigger condition if you want to apply a filter to the cards that are selected for printing.

regards,
Rutger.

Rutger Koperdraad
Senior Software Engineer

"A reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. All progress, therefore, depends on the unreasonable man." (Bernard Shaw)
5 years 6 months ago
Mark Phelan
Expert Boarder
Expert Boarder
Posts: 95
More
Topic Author
Confusion - triggers on multiple cards #5208
It needed a fresh pair of eyes, but you were right - the storage item for the student card was set to update the staff table.

It's been a long project...!

Thanks for the prompt reply, have a great Christmas.
5 years 6 months ago
Rutger Koperdraad
Platinum Boarder
Platinum Boarder
Posts: 1566
More
Confusion - triggers on multiple cards #5209
No problem. Have a nice Christmas too. We all need a break...

regards,
Rutger.

Rutger Koperdraad
Senior Software Engineer

"A reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. All progress, therefore, depends on the unreasonable man." (Bernard Shaw)
×

Notice

The forum is in read only mode.