on 2024 Jun 27 7:48 AM
Hi Experts,
Im about to block Sales Order thru SP Notification, I Create a simple code to check if the customer has Open Invoices in the AR Module and if it does, it will block the sales order for that particular order unless the AR Document of the previous transaction is closed here is my code.
IF(@object_type = '17') and (@transaction_type in ('A', 'U'))
BEGIN
IF Exists (SELECT T0.CardCode FROM OINV T0
WHERE T0.DocEntry = @List_of_cols_val_tab_del AND T0.[DocStatus] = 'O' AND T0.CANCELED='N' )
BEGIN
SET @error = 1001
SET @error_message = 'You have Pending AR invoice Open, Please Settle Customer Account. Thank you!'
End
End
Apparently the code block Sales Order for all Customers even they dont have AR Invoice Open Documents.
what you think is the problem? anyone can help me?
Hi,
try this
IF(@object_type = '17') and (@transaction_type in ('A', 'U'))
BEGIN
IF Exists (SELECT T0.CardCode FROM ORDR T0 JOIN OINV T1 ON T0.CardCode=T1.CardCode
WHERE T0.DocEntry = _of_cols_val_tab_del AND T1.[DocStatus] = 'O' AND T1.CANCELED='N' )
BEGIN
SET = 1001
SET _message = 'You have Pending AR invoice Open, Please Settle Customer Account. Thank you!'
End
End
Hope this helps,
SonTran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Somehow my above store missed "@list". Please correct it and try again:
WHERE T0.DocEntry = @List_of_cols_val_tab_del AND T1.[DocStatus] = 'O' AND T1.CANCELED='N'
User | Count |
---|---|
91 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.