Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8635

Re: How to prevent editing or update in UDT(Object Type - Document (Row Wise)) once it the 'Status' is Closed

$
0
0

Hi rajan

 

i had tried with the same...but not able to block

still it is allowing edit and update

 

i had created a store procedure in the below given way, and as successfully saved.

 

in this table i need to block Line wise.. and my table object type is Document.. in document there is no 'Code' only Doc Entry is avaliable

so i had changed Code to doc entry,

 

if possible could u have a TV session

 

 

 

********************************************************************************************************************

USE [SSC_Test_Demo]

GO

/****** Object:  StoredProcedure [dbo].[Test]    Script Date: 10/20/2014 13:09:43 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

 

 

ALTER PROCEDURE [dbo].[Test]

 

@object_type as nvarchar(100),

@status as nvarchar (100),

@list_of_cols_val_tab_del as int,

@error as int,

@error_message as nvarchar (100)

 

 

  AS

  begin

IF (@object_type = 'Lev_App') and (@status IN ('C'))

    BEGIN

 

(SELECT T0.DocEntry FROM [dbo].[@Le_App]  T0

 

where T0.DocEntry = @list_of_cols_val_tab_del  AND T0.Status= 'C')

 

       SET @error = '001'

       SET @error_message = 'Cannot Update or Edit As Status is Closed'

    End

    end


Viewing all articles
Browse latest Browse all 8635

Trending Articles