Hello,
I've tried months ago prevent users to create incoming payments from Invoice document if the customer code (CardCode) starts with "CL" letters.
First I went to a stored procedure without success as you can see
Then I checked the authorization options where I can restrict Payment Mean options for any user but in my case I need to conditionally restrict the access to Payment Mean (only when customer code starts with "CL").
Thinking in a possible solution I've tried to create an Approval Template based on a query. I want once the payment is created a request for approval is thrown and the payment is created as draft. I don't know how can I achieve that but I have this query:
SELECT DISTINCT 'TRUE' WHERE $[ORCT.CARDCODE] LIKE '%CL%%'
When I create an Invoice document with an invoince payment the Invoice and the payment are created in the DB without request approval.
Is there a better approach to get it?
Thanks for considering my question.