Skip to Content

Bloqueio Campos no cadastro de PN

Amigos,

Alguém pode sugerir uma solução para bloqueio de determinados campos no cadastro de PN?

Abraços.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2013 at 02:24 AM

    Ola Wagner,

    Tenho alguns bloqueios na procedure [SBO_SP_TransactionNotification], conforme exemplo abaixo:

    /*--------------------------------------------------------------------------------------------------*/

    /* CADASTRO DE PARCEIROS DE NEGÓCIO */ /*--------------------------------------------------------------------------------------------------*/

    IF((@object_type = '2') AND (@transaction_type = 'A' OR @transaction_type = 'U'))

    BEGIN

    /**** NOME DO PN ************************************************************************************/

    IF (SELECT CardName FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) IS NULL

    BEGIN

    SET @error = 1;

    SET @error_message = 'SAP - Cabeçalho: Preencher o campo NOME.'

    END

    /**** NOME FANTASIA (NOME ESTRANGEIRO)***************************************************************/

    IF((SELECT CardFName FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) IS NULL

    AND(SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 2;

    SET @error_message = 'SAP - Cabeçalho: Preencher o campo NOME FANTASIA.'

    END

    /**** GRUPO DO PN ***********************************************************************************/

    IF((SELECT GroupCode FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 100

    OR(SELECT GroupCode FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 101)

    BEGIN

    SET @error = 3;

    SET @error_message = 'SAP - Cabeçalho: Selecionar uma opção no campo GRUPO, exceto "* Selecionar Grupo".'

    END

    /**** Endereço DE COBRANÇA (Cliente) ****************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 0

    AND

    (SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 25;

    SET @error_message = 'SAP - Endereços: Preencher ao menos um campo de Endereço DE COBRANÇA.'

    END

    /**** TIPO DE LOGRADOURO (Endereço Cobrança Cliente) ************************************************/

    IF ((SELECT Count(Address) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del ) >

    (SELECT Count(AddrType) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 26;

    SET @error_message = 'SAP - Endereços: Preencher o campo TIPO DE LOGRADOURO.'

    END

    /**** RUA/CAIXA POSTAL (Endereço Cliente) ***********************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT count(Street) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del ))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 27;

    SET @error_message = 'SAP - Endereços: Preencher o campo RUA/CAIXA POSTAL.'

    END

    /**** RUA Nº(Endereço Cliente) **********************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(StreetNo) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 28;

    SET @error_message = 'SAP - Endereços: Preencher o campo RUA Nº.'

    END

    /**** CEP (Endereço Cliente) ************************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(ZipCode) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR'

    BEGIN

    SET @error = 29;

    SET @error_message = 'SAP - Endereços: Preencher o campo CEP.'

    END

    /**** CEP (Endereço Cobrança) **********************************************************************/

    IF (SELECT TOP 1 LEN(RTRIM(LTRIM(ZipCode))) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') <> 8

    BEGIN

    SET @error = 01;

    SET @error_message = 'SAP - Endereços: Preencher o campo CEP com o tamanho de 8.'

    END

    /**** CEP (Endereço Entrega) ***********************************************************************/

    IF (SELECT TOP 1 LEN(RTRIM(LTRIM(ZipCode))) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'S') <> 8

    BEGIN

    SET @error = 01;

    SET @error_message = 'SAP - Endereços: Preencher o campo CEP com o tamanho de 8.'

    END

    /**** QTDE(Endereço Entrega) ***********************************************************************/

    IF (SELECT COUNT(0) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') > 1

    BEGIN

    SET @error = 01;

    SET @error_message = 'SAP - Endereços: É permitido adicionar apenas um endereço de Cobrança.'

    END

    /**** QTDE(Endereço Entrega) ***********************************************************************/

    IF (SELECT COUNT(0) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'S') > 1

    BEGIN

    SET @error = 01;

    SET @error_message = 'SAP - Endereços: É permitido adicionar apenas um endereço de Entrega.'

    END

    /**** BAIRRO (Endereço Cliente) *********************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(Block) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 30;

    SET @error_message = 'SAP - Endereços: Preencher o campo BAIRRO.'

    END

    /**** CIDADE (Endereço Cliente) *********************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(City) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND City <> ''))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 32;

    SET @error_message = 'SAP - Endereços: Preencher o campo CIDADE.'

    END

    /**** ESTADO (Endereço Cliente) *********************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(State) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND State <> ''))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 31

    SET @error_message = 'SAP - Endereços: Preencher o campo ESTADO.'

    END

    /**** MUNICÍPIO (Endereço Cobrança Cliente)**********************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(County) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND County <> ''))

    AND((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C'

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR')

    BEGIN

    SET @error = 33;

    SET @error_message = 'SAP - Endereços: Preencher o campo MUNICIPIO.'

    END

    /**** PAÍS (Endereço Cobrança Cliente)***************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(Country) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 34;

    SET @error_message = 'SAP - Endereços: Preencher o campo PAÍS.'

    END

    /**** DESTINATÁRIO (Cliente)*************************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'S') = 0

    AND

    (SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 35;

    SET @error_message = 'SAP - Endereços: Preencher ao menos um campo de DESTINATÁRIO.'

    END

    /**** PAGAR A (FORNECEDOR)***************************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 0

    AND

    (SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 36;

    SET @error_message = 'SAP - Endereços: Preencher ao menos um campo PAGAR A.'

    END

    /**** TIPO DE LOGRADOURO (Endereço Fornecedor)*******************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del ) >

    (SELECT Count(AddrType) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 37;

    SET @error_message = 'SAP - Endereços: Preencher o campo TIPO DE LOGRADOURO.'

    END

    /**** RUA/CAIXA POSTAL (Endereço Fornecedor)*********************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT count(Street) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del ))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 38;

    SET @error_message = 'SAP - Endereços: Preencher o campo RUA/CAIXA POSTAL.'

    END

    /**** RUA Nº(Endereço Fornecedor)********************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(StreetNo) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 39;

    SET @error_message = 'SAP - Endereços: Preencher o campo RUA Nº.'

    END

    /**** CEP(Endereço Fornecedor)***********************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(ZipCode) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR'

    BEGIN

    SET @error = 40;

    SET @error_message = 'SAP - Endereços: Preencher o campo CEP.'

    END

    /**** BAIRRO (Endereço Fornecedor)*******************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(Block) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 41;

    SET @error_message = 'SAP - Endereços: Preencher o campo BAIRRO.'

    END

    /**** CIDADE (Endereço Fornecedor)*******************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(City) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND City <> ''))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 43;

    SET @error_message = 'SAP - Endereços: Preencher o campo CIDADE.'

    END

    /**** ESTADO (Endereço Fornecedor)*******************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(State) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND State <> ''))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 42;

    SET @error_message = 'SAP - Endereços: Preencher o campo ESTADO.'

    END

    /**** MUNICÍPIO (Endereço Fornecedor)*****************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(County) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND County <> ''))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR'

    BEGIN

    SET @error = 44;

    SET @error_message = 'SAP - Endereços: Preencher o campo MUNICÍPIO.'

    END

    /**** PAÍS (Endereço Fornecedor)***********************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del) >

    (SELECT Count(Country) FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del))

    AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 45;

    SET @error_message = 'SAP - Endereços: Preencher o campo PAÍS.'

    END

    /**** DESTINATÁRIO (FORNECEDOR) ***********************************************************************/

    IF ((SELECT Count(Address) FROM crd1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'S') = 0

    AND

    (SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 46;

    SET @error_message = 'SAP - Endereços: Preencher ao menos um campo de DESTINATÁRIO.'

    END

    /**** PAGAMENTO ÚNICO (Cliente) ***********************************************************************/

    IF ((SELECT SinglePaym FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'N'

    AND

    (SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 51;

    SET @error_message = 'SAP - Execução do pagamento: Selecionar o campo PAGAMENTO ÚNICO.'

    END

    /**** FORMA DE PAGTO (Cliente) ***********************************************************************/

    IF ((SELECT Count(LineNum) FROM CRD2 WHERE CardCode = @list_of_cols_val_tab_del) = 0)

    AND

    -- (SELECT Count(PayMethCod) FROM OPYM WHERE Type = 'O')) AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'C')

    BEGIN

    SET @error = 52;

    SET @error_message = 'SAP - Execução do pagamento: Selecionar uma opção no campo FORMA DE PAGTO.'

    END

    /**** PAGAMENTO ÚNICO (Fornecedor) ********************************************************************/

    IF ((SELECT SinglePaym FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'N'

    AND

    (SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 53;

    SET @error_message = 'SAP - Execução do pagamento: Selecionar o campo PAGAMENTO ÚNICO.'

    END

    /**** FORMA DE PAGTO (Fornecedor) *********************************************************************/

    IF ((SELECT Count(LineNum) FROM CRD2 WHERE CardCode = @list_of_cols_val_tab_del) = 0)

    AND

    -- (SELECT Count(PayMethCod) FROM OPYM WHERE Type = 'O')) AND

    ((SELECT CardType FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) = 'S')

    BEGIN

    SET @error = 54;

    SET @error_message = 'SAP - Execução do pagamento: Selecionar uma opção no campo FORMA DE PAGTO.'

    END

    --/**** CNPJ - COBRANÇA (Cliente) ***********************************************************************/

    IF((((SELECT T1.TaxId0 FROM OCRD T0 INNER JOIN CRD7 T1 ON T0.CardCode = T1.CardCode WHERE T1.[AddrType] = 'S' AND T1.[Address] = '' AND T0.CardCode = @list_of_cols_val_tab_del) IS NULL OR

    (SELECT T1.TaxId0 FROM OCRD T0 INNER JOIN CRD7 T1 ON T0.CardCode = T1.CardCode WHERE T1.[AddrType] = 'S' AND T1.[Address] = '' AND T0.CardCode = @list_of_cols_val_tab_del) = '') AND

    (SELECT T0.CardType FROM OCRD T0 WHERE T0.CardCode = @list_of_cols_val_tab_del) = 'C')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR')

    AND((((SELECT T1.TaxId4 FROM OCRD T0 INNER JOIN CRD7 T1 ON T0.CardCode = T1.CardCode WHERE T1.[AddrType] = 'S' AND T1.[Address] = '' AND T0.CardCode = @list_of_cols_val_tab_del) IS NULL OR

    (SELECT T1.TaxId4 FROM OCRD T0 INNER JOIN CRD7 T1 ON T0.CardCode = T1.CardCode WHERE T1.[AddrType] = 'S' AND T1.[Address] = '' AND T0.CardCode = @list_of_cols_val_tab_del) = '') AND

    (SELECT T0.CardType FROM OCRD T0 WHERE T0.CardCode = @list_of_cols_val_tab_del) = 'C')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR')

    BEGIN

    SET @error = 59;

    SET @error_message = 'SAP - Contabilidade->Imposto: Preencher o CNPJ/CPF para END. de Cobrança.'

    END

    /**** CNPJ - DESTINATÁRIO (Cliente) *******************************************************************/

    IF((((SELECT COUNT(*) FROM CRD7 T1 WHERE T1.CardCode = @list_of_cols_val_tab_del AND T1.[AddrType] = 'S' AND T1.Address <> '') <>

    (SELECT COUNT(*) FROM CRD7 T1 WHERE T1.CardCode = @list_of_cols_val_tab_del AND T1.[AddrType] = 'S' AND T1.Address <> '' AND (T1.TaxId0 is Not NULL AND T1.TaxId0 <> ''))) AND

    (SELECT T0.CardType FROM OCRD T0 WHERE T0.CardCode = @list_of_cols_val_tab_del) = 'C')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR')

    AND((((SELECT COUNT(*) FROM CRD7 T1 WHERE T1.CardCode = @list_of_cols_val_tab_del AND T1.[AddrType] = 'S' AND T1.Address <> '') <>

    (SELECT COUNT(*) FROM CRD7 T1 WHERE T1.CardCode = @list_of_cols_val_tab_del AND T1.[AddrType] = 'S' AND T1.Address <> '' AND (T1.TaxId4 is Not NULL AND T1.TaxId4 <> ''))) AND

    (SELECT T0.CardType FROM OCRD T0 WHERE T0.CardCode = @list_of_cols_val_tab_del) = 'C')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR')

    BEGIN

    SET @error = 60;

    SET @error_message = 'SAP - Endereço Destinatário: Preencher o CNPJ/CPF do(s) Enderenço(s).'

    END

    /**** CNPJ - COBRANÇA (Fornecedor) ********************************************************************/

    IF(((SELECT T1.TaxId0 FROM OCRD T0 INNER JOIN CRD7 T1 ON T0.CardCode = T1.CardCode WHERE T1.[AddrType] = 'S' AND T1.[Address] = '' AND T0.CardCode = @list_of_cols_val_tab_del) IS NULL OR

    (SELECT T1.TaxId0 FROM OCRD T0 INNER JOIN CRD7 T1 ON T0.CardCode = T1.CardCode WHERE T1.[AddrType] = 'S' AND T1.[Address] = '' AND T0.CardCode = @list_of_cols_val_tab_del) = '') AND

    (SELECT T0.CardType FROM OCRD T0 WHERE T0.CardCode = @list_of_cols_val_tab_del) = 'S')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR'

    AND((((SELECT T1.TaxId4 FROM OCRD T0 INNER JOIN CRD7 T1 ON T0.CardCode = T1.CardCode WHERE T1.[AddrType] = 'S' AND T1.[Address] = '' AND T0.CardCode = @list_of_cols_val_tab_del) IS NULL OR

    (SELECT T1.TaxId4 FROM OCRD T0 INNER JOIN CRD7 T1 ON T0.CardCode = T1.CardCode WHERE T1.[AddrType] = 'S' AND T1.[Address] = '' AND T0.CardCode = @list_of_cols_val_tab_del) = '') AND

    (SELECT T0.CardType FROM OCRD T0 WHERE T0.CardCode = @list_of_cols_val_tab_del) = 'S')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR')

    BEGIN

    SET @error = 63;

    SET @error_message = 'SAP - Contabilidade->Imposto: Preencher o CNPJ/CPF para Endereço PAGAR A.'

    END

    /**** CNPJ - DESTINATÁRIO (Fornecedor) ***************************************************************/

    IF(((SELECT COUNT(*) FROM CRD7 T1 WHERE T1.CardCode = @list_of_cols_val_tab_del AND T1.[AddrType] = 'S' AND T1.Address <> '') <>

    (SELECT COUNT(*) FROM CRD7 T1 WHERE T1.CardCode = @list_of_cols_val_tab_del AND T1.[AddrType] = 'S' AND T1.Address <> '' AND (T1.TaxId0 is Not NULL AND T1.TaxId0 <> ''))) AND

    (SELECT T0.CardType FROM OCRD T0 WHERE T0.CardCode = @list_of_cols_val_tab_del) = 'S')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR'

    AND(((SELECT COUNT(*) FROM CRD7 T1 WHERE T1.CardCode = @list_of_cols_val_tab_del AND T1.[AddrType] = 'S' AND T1.Address <> '') <>

    (SELECT COUNT(*) FROM CRD7 T1 WHERE T1.CardCode = @list_of_cols_val_tab_del AND T1.[AddrType] = 'S' AND T1.Address <> '' AND (T1.TaxId4 is Not NULL AND T1.TaxId4 <> ''))) AND

    (SELECT T0.CardType FROM OCRD T0 WHERE T0.CardCode = @list_of_cols_val_tab_del) = 'S')

    AND (SELECT TOP 1 CRD1.Country FROM CRD1 WHERE CardCode = @list_of_cols_val_tab_del AND AdresType = 'B') = 'BR'

    BEGIN

    SET @error = 64;

    SET @error_message = 'SAP - Endereço Destinatário: Preencher o CNPJ/CPF do(s) Enderenço(s).'

    END

    /**** Obrigatóriedade Insc. Estadual ******************************************************************/

    IF ((SELECT ISNULL(TaxId1,'') FROM CRD7 WHERE CardCode = @list_of_cols_val_tab_del AND Addrtype='S' AND Address='')) = ''

    BEGIN

    SET @error = 65;

    SET @error_message = 'SAP - Contabilidade->Imposto: Preencher Insc. Esdatual'

    END

    /**** CONSISTE ENDEREÇO DE COBRANÇA ********************************************************************/

    DECLARE @TpLog VARCHAR(MAX)

    DECLARE @Rua VARCHAR(MAX)

    DECLARE @Complemento VARCHAR(MAX)

    DECLARE @EndCompleto VARCHAR(MAX)

    SELECT TOP 1 @TpLog = CRD1.AddrType

    , @Rua = CRD1.Street

    , @Complemento = CRD1.Building

    FROM CRD1

    WHERE CRD1.CardCode = @list_of_cols_val_tab_del AND CRD1.AdresType = 'B'

    SET @TpLog = RTRIM(LTRIM(@TpLog))

    SET @Rua = RTRIM(LTRIM(@Rua))

    SET @Complemento = RTRIM(LTRIM(@Complemento))

    SET @EndCompleto = (@TpLog + ' ' + @Rua + ' ' + @Complemento)

    END

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2014 at 04:24 PM

    Bloquear mesmo o campo, eu consigo apenas utilizando o Addon B1UP,

    com ele dá para deixar o campo inativo.

    Fora isso, o único jeito de bloquear os campos são as Transaction Notifications,

    assim como o Jean Pierre mostrou. O único problema é que, estas procedures,

    causam alguns problemas na hora de realizar importações via DTW e na hora

    de atualizar a base. Então, sempre desabilite-as ao realizar esses procedimentos.

    Att.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.