cancel
Showing results for 
Search instead for 
Did you mean: 

Update query for udf copy udf value from purhase order to purchase request

Former Member
0 Kudos

hi every one,

i accidentally update a udf in purchase request wrongly. and it affect same value in all purchase request document. now i want to update purchase request udf with purchase order. i write the query but have some problem.plz help me

update prq1

set prq1.U_U_S=(select por1.U_U_S

                 from

                 por1 inner join

                 PRQ1 on POR1.BaseLine = prq1.LineNum AND por1.BaseEntry = prq1.DocEntry and por1.Basetype = prq1 .ObjType

                 and por1.ItemCode=PRQ1.ItemCode

                 )

  from PRQ1

View Entire Topic
Former Member
0 Kudos

Hi,

Update is not allowed even for your UDF. Because this is a B1 system table not UDT. Stop this from now on. However, for correcting the mistake, you may revise the select to remove the last condition for itemcode matching. The last line is also wrong. No from for update script.

Always run the select query first to make sure it only return one value which is what you need.

Thanks,

Gordon