on 10-12-2014 4:27 PM
Hola Buen Día
mi consulta es la siguiente quisiera saber si a un campo de usuario que he creado puedo hacer que sea obligatorio y como puedo hacerlo, he intentado por transaction notification pero no me funciona quizas este haciendo algo mal, gracias de ante mano por su ayuda....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if @object_type='191' and (@transaction_type='A' or @trasaction_type='U')
begin
declare @control nvarchar(1)
set @control=(select '1' from oscl t0 where t0.callid=@list_of_cols_val_tab_del and isnull(u_dr_inicio,'')='')
if @control='1'
begin
set @error='1'
set @error_message='Introduccion fecha inicio'
end
end
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hay otras alternativas, Alexander, como desarrollar algo con SDK o con un add-on (p. ej. Boyum). Pero si ya tienes algo de código de Transaction Notification, lo ideal sería que lo publicaras y describieras las reglas sobre las que debe aplicar la obligatoriedad del campo y así podríamos ver como ayudarte...
Saludos,
JC.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Juan Carlos
agrege un campo(U_DR_INICIO) en la tabla oscl de llamada de servicio, pero me sale error
IF @object_type = '191' and (@transaction_type = 'A')
Begin
Set @Numero= (select [U_DR_INICIO] from OSCL R1 where R1.DocNum = @list_of_cols_val_tab_del)
IF LEN(ISNULL(@Numero,''))= 0
begin
set @error=1
set @error_message = 'Ingresar dia'
end
me sale este error de ese query...
IF @object_type = '191' and @transaction_type = 'A'
Begin
If isnull(select [U__DR_INICIO] from OSCL T0 where T0.CallID = @list_of_cols_val_tab_del)
Begin
Set @error = 1
Set @error_message = 'Ingresar día'
End
end
Msg 156, Level 15, State 1, Procedure SBO_SP_TransactionNotification, Line 409
Incorrect syntax near the keyword 'select'.
Msg 102, Level 15, State 1, Procedure SBO_SP_TransactionNotification, Line 409
Incorrect syntax near ')'.
Una disculpa, inténtalo así:
IF @object_type = '191' and @transaction_type = 'A'
Begin
If exists(select [U__DR_INICIO] from OSCL T0
where T0.CallID = @list_of_cols_val_tab_del and isnull(T0.U _ DR_INICIO, '@') <> '@')
Begin
Set @error = 1
Set @error_message = 'Ingresar día'
End
end
Me había faltado un texto al final del WHERE.
Si tu campo es tipo fecha, cambia el '@' por '19500101' en las 2 @ al final del renglon del WHERE o algún texto tipo fecha muy antiguo.
Saludos ,
JC.
User | Count |
---|---|
91 | |
11 | |
10 | |
6 | |
5 | |
5 | |
5 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.