Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: Transaction Notification to prevent changing field in OCRD

$
0
0

Just in case someone else needs to do something like this, I ended up changing my code to this:

 

IF      @object_type = '2' AND @transaction_type IN ('U', 'D')
BEGIN      IF            --You can't change unless blank            ((SELECT AddID FROM ACRD WHERE CardCode=@list_of_cols_val_tab_del AND loginstanc =            (SELECT MAX(ACRD.LogInstanc) FROM ACRD WHERE CardCode=@list_of_cols_val_tab_del)) <>            (SELECT AddID FROM OCRD WHERE CardCode=@list_of_cols_val_tab_del)            AND            (SELECT AddID FROM ACRD WHERE CardCode=@list_of_cols_val_tab_del AND loginstanc =  (SELECT MAX(ACRD.LogInstanc) FROM ACRD WHERE CardCode=@list_of_cols_val_tab_del)) <> '')            OR            --You can't remove            ((SELECT AddID FROM OCRD WHERE CardCode=@list_of_cols_val_tab_del) IS NULL  AND  (SELECT AddID FROM ACRD WHERE CardCode=@list_of_cols_val_tab_del AND loginstanc =  (SELECT MAX(ACRD.LogInstanc) FROM ACRD WHERE CardCode=@list_of_cols_val_tab_del)) <> '')      BEGIN             SET @error =1            SET @error_message = 'You cannot change or delete the BPAY Ref Number. Change it back to ' + (SELECT AddID FROM ACRD WHERE CardCode=@list_of_cols_val_tab_del AND loginstanc =            (SELECT MAX(ACRD.LogInstanc) FROM ACRD WHERE CardCode=@list_of_cols_val_tab_del)) + ' and click update again.'      END
END

Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>