Skip to Content
avatar image
Former Member

Format of UDF

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


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Feb 10, 2015 at 11:21 AM

    Anyone have any feedback on this?


    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Feb 10, 2015 at 01:21 PM

    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
    
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 1 2 A 1 3 A 1 4 A 1 5 A 1 92 A 1 93 A 1 94 A 1 95 A 1 96 A 1 5 J 3 LB 5 J 3 RW 1 J 3 QC 2 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