cancel
Showing results for 
Search instead for 
Did you mean: 

SP for Batch Making

former_member252592
Participant
0 Kudos

Hi experts i Created the following SP

--/*Block Batch Making when Batch Attribute 1 is Null*/

IF @transaction_type IN ('U') AND @Object_type = '10000044'

BEGIN

IF EXISTS (SELECT T0.AbsEntry FROM OBTN T0

WHERE T0.MnfSerial is null

and T0.AbsEntry = @list_of_cols_val_tab_del)

BEGIN

SELECT @Error = 525, @error_message = 'Select Job No in Batch Attribute 1'

END

END

my goal is to block batch making when use did not select any value in Batch Attribute 1 field but this SP is not working

Can any one guide me what am i missing here?

Regards

Jamil Siddiqui

Accepted Solutions (1)

Accepted Solutions (1)

agustin_marcoscividanes
Active Contributor
0 Kudos

Hi

this SP only runs when you open the batch master data form, but it does not run when you select batch in a document and select the batch for saving the data.

You have two options:

- create an alarm to show all batch with this field is null and update.

- create an addon when you select the batches in a document (marketing or production) checks that field has value.

Kind regards

Agustín Marcos Cividanes

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try below SP

IF @transaction_type in ('A','U') AND (@OBJECT_TYPE='10000044')

BEGIN

If exists (SELECT t0.AbsEntry  FROM OBTN T0 WHERE (T0.MnfSerial = '' or T0.MnfSerial is null)  AND

t0.AbsEntry = @list_of_cols_val_tab_del)

Begin

SET @error = 1

SET @error_message = 'Check Attribute'

End

End

Thanks,

Harshal

former_member252592
Participant
0 Kudos

Thanx for your reply Harshal Makwana its working now but it works on when i try to add the receipt from production doc not at time of when i create batch and update it. it batch making window

Thanx & Regards

Jamil

Former Member
0 Kudos

Hi,

Can you share your screen from where you update the batch. Is it Batch Details ?

Thanks,

Harshal

former_member252592
Participant
0 Kudos

this is the screen

Former Member
0 Kudos

I think this screen comes when you add receipt from production and not for update batches I guess.

Thanks,

Harshal