Skip to main content

Hi, 

I have a Universal gui with a Scheduler. This works ok, shows all rows correctly, based on a view. 
I also created an Instead_of_update trigger that should open a message box. 
The view is filled with a union on three queries; sick leave, holiday leave, and scheduled Activities. 
With 3 prefilters I can toggles these. This works well. 
 

I want this trigger to catch the PK, and update the related tables (not the view). 

 

So, no popup, and when I drag an element I get: 
Request error. The object was not found. You may have insufficient rights or the object no longer exists.
 

in the Dev-tools I get: 
POST https://--------------.com/indicium/iam/42/vw_planner(calculated_start=2022-02-16T00%3A00%3A00.000Z,calculated_end=2022-02-17T01%3A00%3A00.000Z,display_name='holiday')/stage_edit 404

and 
Any thoughts on where to begin to get his debugged? 
If the error is gone, I assume the message will appear - since the _update now isn’t executed. 

thnx! 

Somehow, the selected activity could not be found. I cannot be certain what the cause is, but can you try change the primary key not to include the dates?


I did this, set the PK to the Leave_id and job_id. 
When I now drag, I get a 400 Bad_Request in the gui. 
The dev tools shows: 

 https://----.com/indicium/iam/43/vw_planner(job_id=null,leave_id=6)/stage_edit 400
And a whole bunch of: 



job_id = null, is correct, because I now only show leaves in the scheduler. 

leave_id is also correct, and unique within the table & view. 
Also, I do not get a popup based on my trigger ;
 

declare @leave_id int 
select @leave_id = leave_id from inserted
exec dbo.tsf_send_message '',@leave_id,0


Any other things that might be worth trying?
 


A nullable primary key is not supported - job_id = null should not occur. Can you omit job_id from the primary key without problems?


Yes, think I got it working! 
Now some tweaking and such, creating the view a bit better, but drag/drop and updating of the records does work! 

Thnx!