cancel
Showing results for 
Search instead for 
Did you mean: 

Format of UDF

Former Member
0 Kudos

hello

I have a User Defined Field of 10 characters on the batch details screen.

I want to force the users to do the following when capturing info in the field.

e.g. AAA-123-BC

characters 1-3 must be Alphanumeric

characters 4 - must be a dash

characters 5-7 - must be numeric

characters 8 - must be a dash

characters 9-10  characters must be Alphanumeric

Is there a way to force this on the Stored Procedure or using B1UP?

Thanks in advance

Janice


Accepted Solutions (0)

Answers (2)

Answers (2)

former_member203899
Active Participant
0 Kudos

Hi Janice,

As per your custom requirement, you must create Transaction Notification for this requirement.

Try below Transaction Notification for Goods Receipt PO Screen


IF @object_type='20' AND @transaction_type IN ( 'A','U')

begin

IF EXISTS (SELECT OPDN.DocEntry from OPDN Left Outer Join OIBT on OPDN.DocEntry=OIBT.BaseEntry

WHERE OIBT.BaseType=20 and OIBT.BATCHNUM not LIKE '%%%-%%%-%%' and OPDN.DocEntry = @list_of_cols_val_tab_del )

BEGIN

SET @error = 121

SET @error_message = 'Please Enter Batch Number in Proper Format'

END

END

Former Member
0 Kudos

Hello Nishit/Manish

The client UDF field is as follows :

1-96

A-J

1-3

Sometimes at the end "RW","LB","QC".

e.g.

                        

1 A 12 A 13 A 14 A 15 A 1
92 A 193 A 194 A 195 A 196 A 1
5 J 3 LB5 J 3 RW1 J 3 QC2 J 3 RW

I tried the following in the sbo transaction notification, but it is not working.

IF EXISTS (


SELECT OPDN.DocEntry from OPDN Left Outer Join OIBT on OPDN.DocEntry=OIBT.BaseEntry


WHERE OIBT.BaseType=20 and OPDN.DocEntry = @list_of_cols_val_tab_del


and  ( SUBSTRING(OIBT.U_BinLoc,1,1)  not like '[1-9]'


(SUBSTRING(OIBT.U_BinLoc,1,2)  not between '10' and '96'


SUBSTRING(OIBT.U_BinLoc,1,2)  not like '[A-Z]')


(SUBSTRING(OIBT.U_BinLoc,3,1)  not like '[A-Z]' or SUBSTRING(OIBT.U_BinLoc,3,1) not like '[1-3]')


(SUBSTRING(OIBT.U_BinLoc,4,1)  not like '[A-Z]' or SUBSTRING(OIBT.U_BinLoc,4,1) not like '[1-3]'))





@ERROR = 1, @error_message = @list_of_cols_val_tab_del



Former Member
0 Kudos

Anyone have any feedback on this?


former_member184146
Active Contributor
0 Kudos

Hi

On which document you want this??

--Manish

Former Member
0 Kudos

hi Manish

When adding a GRPO with a batch number - so on the Batch details screen, I have a UDF binloc.

This is the field I want to format.

Janice

former_member184146
Active Contributor
0 Kudos

Hi Janice

Try this

IF @object_type='20' AND @transaction_type IN ( 'A','U')

begin

IF EXISTS (SELECT a.docentry from

OPDN a left join OIBT b on a.DocEntry=b.BaseEntry

WHERE b.BaseType=20 and b.BATCHNUM not LIKE '%%%-%%%-%%' AND  A.DOCENTRY = @list_of_cols_val_tab_del )

BEGIN

SET @error = 121

SET @error_message = 'MK - Enter the Batch Number Based on the formatt - AAA-123-BC'

END

END

--Manish