CREATE view [dbo].[InvoiceLocks]
(
OrderFid,
LockedByFullName,
CreatedOn,
OrderNo
)
as
select
InvoiceLock.OrderFid,
dbo.FormatFirstNameLastName( Sysuser.FIRSTNAME, Sysuser.LASTNAME ) as LockedByFullName,
InvoiceLock.CreatedOn,
Orders.OrderNo
from InvoiceLock
inner join Sysuser on InvoiceLock.CreatedBySysUserFid = Sysuser.SysUserID
inner join Orders on InvoiceLock.OrderFid = Orders.PriKey
GO
GRANT SELECT ON [dbo].[InvoiceLocks] TO [MssExec]
GRANT INSERT ON [dbo].[InvoiceLocks] TO [MssExec]
GRANT DELETE ON [dbo].[InvoiceLocks] TO [MssExec]
GRANT UPDATE ON [dbo].[InvoiceLocks] TO [MssExec]
GO