cancel
Showing results for 
Search instead for 
Did you mean: 

Stored procedure

Former Member
0 Kudos

Dear expert can any one help me to write the procedure under which we want that once we print the sales order users can not be update or edit the sales order except the Remark(comment) column.

Below store procedure i can do but i want to left remark column .

if @object_type = '17' and @transaction_type = 'U' 

BEGIN

if exists(Select T0.DocNum  from [ORDR] T0

        Where T0.printed='Y'

        AND T0.DocEntry=@list_of_cols_val_tab_del)

begin

    SELECT @error = -5001, @error_message =

'Sales order not updated once print'

end

please help me

thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

I am not sure about your sales process. In general sales order can be edited until its open status. For example, if your customer wants to add one more item, then how user will update?

Thanks

Former Member
0 Kudos

Hello sir,

If order status is open sales users can modify or edit it, but once printed for shipping they can not allow to maintained the order.

below 2 cases some time happen not regularly

-if customer wants to add more items or increase/decrease Quantity  or cancelled line item after once print the order, sales user cancelled the order and create new one sales order for same PO and immediately  inform to Shipping.(also we setup alert while order cancelled by user)

-and some time partial  shipment done and customer wants to changed his PO, it is only rights to maintained the order by superuser

My problem is sales users wants to put remark on remark column(comments field), Is it possible once sales order printed it is not updated except remark ?

Please advise

thanks

frank_wang6
Active Contributor
0 Kudos

if @object_type = '17' and @transaction_type = 'U'

BEGIN

If (SELECT TOP 1 Printed FROM ADOC T0 WHERE T0.DocNum = (SELECT DocNum FROM ORDR WHERE DocEntry = @list_of_cols_val_tab_del) ORDER BY  LogInstanc DESC) = 'Y'

begin

    SELECT @error = -5001, @error_message =

'Sales order not updated once print'

end

Former Member
0 Kudos

Dear Frank

Thanks for the reply

Above procedure all fields(column) in Sales order not updated once printed

but i want users can update only remark (ordr.comments)

Please advise

thanks

Tejas

frank_wang6
Active Contributor
0 Kudos

Well, u get the idea, if u just want to user to change the comment area, you will need to compare each field, it will be a very long comparison. You should figure it out with my above query.

Frank

Former Member
0 Kudos

Ok Frank

I will try for that but if you have any simplest solution,

please let me know

thanks

Tejas