Solved

Removing PM SA from Removed Item

  • 24 March 2023
  • 3 replies
  • 35 views

Userlevel 6
Badge +11

We have some instances where an installed item is removed before the PM SA is removed from the item. When I try to deactivate the SA, I this message:

I am not allowed to alter the data in item_inst.pm_sa_person_id, as there are constraints on this field.

The UPDATE statement conflicted with the FOREIGN KEY constraint "fk_item_inst_person_3". The conflict occurred in database "WLN_15", table "dbo.person", column 'person_id'.

Is there an easy way around this?

icon

Best answer by Phil Seifert 24 March 2023, 15:15

View original

3 replies

Userlevel 7
Badge +21

Hi Bjørn,

If I understand you correctly, the item is in Deactivated status which means it is still owned by the company it was last installed.  It is not possible to remove the SA from the item as you cannot edit the item at this point.

Only thing I can think of is to activate the item again and it will then be an installed item once more and then from there, you can remove the SA on the item in the service info page.  Once the SA is removed, then you need to uninstall/remove the item again from the site with a service order normally.

Another possibility, though I don’t really advise it, is to disable the foreign key constraint via SQL for just the item_inst table, update the column and then reactivate the foreign key constraint.  Reason is this potentially can lead to data corruption as it would be removed for ALL installed items. I am only saying this in case you came up with this possible method elsewhere.

 

Userlevel 6
Badge +11

Thank you - I found out that somebody had actually Shipped this out instead of retiring it

Userlevel 7
Badge +21

Hi Bjørn,

Not that it will help in your particular case, there was improved functionality in 15.4 SU4 recently released:

 

 

However, you still probably have the item_person_xref table to deal with which is where the application is indicating the agent is assigned besides the pm_sa_person_id and of course if that agent’s activity is not fulfilled or cancelled, it still would not work.

 

Reply