> For the complete documentation index, see [llms.txt](https://doc.sysdevmobile.com/mss-extensibility/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.sysdevmobile.com/mss-extensibility/mss-5.0/untitled-1/article/ext_article_validatepriceanddiscounts.md).

# EXT\_Article\_ValidatePriceAndDiscounts

Function to validate if inputted price and discount are valid using MSS rules.

*Input parameters*:

* inDocumentType – Type of the document;
* inCustomerCode – Code of the customer;
* inArticleCode – Code of article;
* inCurrentPrice – Price;
* inCurrentDiscount1 – Discount 1;
* inCurrentDiscount2 – Discount 2;
* inCurrentDiscount3 – Discount 3;
* inCurrentDiscount4 – Discount 4;
* inOriginalPrice – Price;
* inOriginalDiscount1 – Discount 1;
* inOriginalDiscount2 – Discount 2;
* inOriginalDiscount3 – Discount 3;
* inOriginalDiscount4 – Discount 4;
* inLineType – Line type (N – Normal / B – Bonus / O – Offer / D - Returns);

*Output parameters*:

* outResultCode – Return code:

1: OK\
0: Error\
-1 Error in field price\
-2 Error in field discount 1\
-3 Error in field discount 2\
-4 Error in field discount 3\
-5 Error in field discount 4

{% hint style="info" %}
Note: The error message is shown inside the process, the different returns codes serve to, for example, set the focus in the correct field.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.sysdevmobile.com/mss-extensibility/mss-5.0/untitled-1/article/ext_article_validatepriceanddiscounts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
