Skip to main content
Question

Smoke test update primary key

  • April 13, 2026
  • 5 replies
  • 36 views

Forum|alt.badge.img+13

We have a bunch of views which are 1 to 1 to a table because of we need more details in a subject. In the Universal GUI more details to the same table results in a “Bad request”

The smoke test gives an error: Cannot update identity column {coumn name]
This column is read only in the datamodel and is not visible in the subject.

The view is updateable and we have a insert of trigger to handle the update request.
How can we solve this error, or is this a bug.

As far we can see this is not an error.

5 replies

Remco
Moderator
Forum|alt.badge.img+3
  • Moderator
  • April 14, 2026

Hey ​@Edwin Saan

Could you explain what the instead of trigger does?

A update on the view should not cause a identity column error because the update statement is handled by the instead of trigger and only a table can get that error.

Kind regards

Remco


Forum|alt.badge.img+13
  • Author
  • Sidekick
  • April 14, 2026

Remco,

See below the IOT script of the IOT update.

There is nog Primary key in this script because that is pkTblFustRegistration

We update only the fields which are enabled in the UI.

 

UPDATE tblFustRegistration
SET

fkRelation = i.fkRelation
,RegistrationDate = i.RegistrationDate
,fkFust = i.fkfust
,Quantity = i.quantity
,fkDirection = i.fkdirection
,InvoiceMatched = 0
,Remarks = i.remarks
,fkStockDepot = 1
,UseManualUnitPrice = 0

FROM tblFustRegistration f
JOIN inserted as i ON i.pkfustregistration = f.pkfustregistration

============================================
In the script of the smoke test it is trying to update all the fields of the view including the PK.
And also all the fields which are read only in the UI.

 

-- Update: vw_tblFustRegistration
begin tran
update top (1) "vw_tblFustRegistration"
set "AutoEntry" = "AutoEntry"
   ,"fkCompany" = "fkCompany"
   ,"fkDirection" = "fkDirection"
   ,"fkFust" = "fkFust"
   ,"fkFustRegistrationType" = "fkFustRegistrationType"
   ,"fkPODelivery" = "fkPODelivery"
   ,"fkPurchaseOrder" = "fkPurchaseOrder"
   ,"fkRelation" = "fkRelation"
   ,"fkSalesOrder" = "fkSalesOrder"
   ,"fkSODelivery" = "fkSODelivery"
   ,"fkStockDepot" = "fkStockDepot"
   ,"insert_date_time" = "insert_date_time"
   ,"insert_user" = "insert_user"
   ,"InvoiceMatched" = "InvoiceMatched"
   ,"InvoiceNr" = "InvoiceNr"
   ,"ManualUnitPrice" = "ManualUnitPrice"
   ,"pkFustRegistration" = "pkFustRegistration"
   ,"Quantity" = "Quantity"
   ,"RegistrationDate" = "RegistrationDate"
   ,"Remarks" = "Remarks"
   ,"Status" = "Status"
   ,"UnitPrice" = "UnitPrice"
   ,"update_date_time" = "update_date_time"
   ,"update_user" = "update_user"
   ,"UseManualUnitPrice" = "UseManualUnitPrice"
where 0=1
rollback tran


Remco
Moderator
Forum|alt.badge.img+3
  • Moderator
  • April 15, 2026

Hi ​@Edwin Saan 

The only think of why this could go wrong is that the instead of trigger was not on the database. Could you verify that the trigger exists?

Just to be sure could you also execute the generated update statement from the smoketest without the identity column with it directly on the database to see if there is no error than.


@Edwin Saan Could it be that the column in the view is not marked as INDENTITY, but only as PRIMARY KEY?

I think it does not consider that setting when you copy a column from the table to your view when you set them up in de Data model.


Forum|alt.badge.img+13
  • Author
  • Sidekick
  • April 16, 2026

Thanks for your replies. The IOT trigger was not on the database like Remco said. 

It was a bit strange situation, with an insert IOT but not an update IOT trigger.

 

Isue solved. Tanks again.