Skip to Content
avatar image
Former Member

Stored procedure

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Apr 12, 2016 at 07:48 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 12, 2016 at 01:26 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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