cancel
Showing results for 
Search instead for 
Did you mean: 

How to display particular customer with particular item code

Former Member
0 Kudos

Hi Experts,

   One scenario, For particular customer they need particular item should be listed in the sales order.

So what i did it i have created user defined field in the item master table (OITM).In that field i gave customer code .

In sales order form, i added a FMS in the item code field.

FMS: SELECT T0.itemcode from oitm T0 where t0.u_custname = $[ordr.cardcode]

If i gave that particular customer code, it displays item code. But also add other item code and if i press tab button . It displays all item code.

It should not display any other item code and also restrict to non item codes.

Kindly give some guidance to me.

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

FMS query will not control other item selection in sales order. You have to use transaction notification if selected item is different from OITM UDF.

Thanks

Former Member
0 Kudos

Thanks Sir,

Can you able to tell the code which is used for transaction notification. To avoid other itemcodes.

kothandaraman_nagarajan
Active Contributor
0 Kudos

Try this SP.

IF (@object_type='17' and ( @transaction_type='A' OR @transaction_type='U'))

Begin

if exists

(SELECT T0.docentry, t1.itemcode FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] WHERE T2.[U_custname]  =  T0.[CardCode] and  T0.[Docentry] =@list_of_cols_val_tab_del )

begin

set @error='1001'

SET @error_message='Invalid item no '

end

End

Thanks

Former Member
0 Kudos

Hi,

try this:

FMS: SELECT T0.itemcode from oitm T0 where t0.u_custname = $[ordr.cardcode] and T0.ItemCode = $[rdr1.itemcode]

Why you're not using SubCatNum-Table ?

Former Member
0 Kudos

Thanks