last_edited_user populate

1199
4
08-03-2016 10:07 AM
JamesLandwehr
New Contributor III

I would like to populate the last_edited_user field using a variable generated from a third party workflow. Is this possible? It continues to pull the SDE versioned user name and ignore my attempts to do a field update with a variable username collected from an authenticated login.

0 Kudos
4 Replies
JoeBorgione
MVP Esteemed Contributor

I've used this Sql Server trigger on the 'A' table of my centerlines for a number of years:

USE [vecc2012]

GO

/****** Object:  Trigger [vecc].[centerlineseditor]    Script Date: 8/3/2016 11:15:51 AM ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

-- =============================================

-- Author:        <Author,,Name>

-- Create date: <Create Date,,>

-- Description:    <Description,,>

-- =============================================

ALTER TRIGGER [vecc].[centerlineseditor]

   ON [vecc].[a28]

   for INSERT

AS update vecc.a28

--BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    --SET NOCOUNT ON;

    -- Insert statements for trigger here

    Set editor = user

    where objectid in (select objectid from inserted)and user <> 'vecc'   

--end   

It just grabs the user-name to populate the field (unless the user is vecc; that's me);  How does the the third party user name differ from what you are getting?

That should just about do it....
0 Kudos
JamesLandwehr
New Contributor III

Joe, Thanks for your reply. My SDE Version is web_editor (so everybody's edits are shown as web_editor) and my User authenticated logins are email addresses.

0 Kudos
JoeBorgione
MVP Esteemed Contributor

I'm  a little confused (nothing new...):  it's pulling the name of the version and not the name of the user?  Does the third party handle the authentication or the database?

That should just about do it....
0 Kudos
JamesLandwehr
New Contributor III

As it turns out, the data model we're using has a LASTEDITOR field that honors the user authenticated id, so it will do as a workaround. But in answer to your question, the user authentication gives them access to the application which is running on a secured service - an SDE versioned feature service with a single editor. I think SDE is taking over the population of those editor tracking fields, but as I mentioned, I've got a decent workaround for the moment.

0 Kudos