Opened 12 years ago
Closed 10 years ago
#974 closed enhancement (fixed)
We need a way to have the system inventory align with accession prefix, number, suffix changes
| Reported by: | Mark J. Millard | Owned by: | Kurt Endress |
|---|---|---|---|
| Priority: | critical | Milestone: | Server Release 2016Oct |
| Component: | Other | Version: | 1.9.2 |
| Severity: | Keywords: | system inventory; trigger | |
| Cc: | kurt.endress@…, marty.reisinger@…, pete.cyr@… | Database Engine: | SQL Server |
| Operating System: | Windows 7 Ultimate 64 bit |
Description
This may be related to ticket #514. We have the scenario where a site adds site accessions to the database and then requests a PI number for these. Usually then the PI id fields are written over the site ID Ames 898888 becomes PI 701566. I think we need a trigger that then changes the system inventory id fields to match the new PI fields. At this time this cannot be done even manually.
I suggest a trigger as some organizations may not want this behavior.
I am putting this into the "Other" component group as I don't know where the final fix will occur. I am putting this in a higher priority enhancement rather than a bug, however some organizations will definitely think this is a bug.
Attachments (1)
Change History (6)
comment:1 by , 10 years ago
| Status: | new → addressed |
|---|
comment:2 by , 10 years ago
| Milestone: | Post 1.0 → Server_2016_Oct |
|---|
comment:3 by , 10 years ago
The trigger trows an error when the accession changed is new and unmodified.
The UPDATE statement conflicted with the FOREIGN KEY constraint "fk_i_modified". The conflict occurred in database "gringlobal", table "dbo.cooperator", column 'cooperator_id'.
The statement has been terminated.
Changed the update SQL and moved to npgsdev for testing:
args.WriteData(@"
UPDATE i SET
i.inventory_number_part1 = a.accession_number_part1,
i.inventory_number_part2 = a.accession_number_part2,
i.inventory_number_part3 = a.accession_number_part3,
i.modified_date = COALESCE(a.modified_date, a.created_date),
i.modified_by = COALESCE(a.modified_by, a.created_by)
FROM inventory i INNER JOIN accession a ON a.accession_id = i.accession_id
WHERE i.accession_id = @accessionid AND i.form_type_code = ''",
new DataParameters("@accessionid", accessionID, DbType.Int32));
by , 10 years ago
comment:5 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | addressed → closed |

Karen modified the system AccessionDataTrigger to update the system inventory. Moved the GrinGlobal.Business.dll to npgsdev for testing.