> For the complete documentation index, see [llms.txt](https://inscada.gitbook.io/ins/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inscada.gitbook.io/ins/master/programing/apis/ins.confirm.md).

# Confirmation Functions

Onay fonksiyonları,  inSCADA platformunda script/expression ile kullanıcılardan onay alınması için kullanılır.

## Getting Approval From Users

#### ins.confirm(String type,String title, String message, Object object)

Kullanıcılardan yapılacak işlemler hakkında onay, olan olaylar için bilgi alınmasını sağlar. Örneğin bir sistemin duruşu hakkında kullanıcıdan neden durduğu konusunda bilgi mesajı girmesini sağlayabilirsiniz. Bu sayede sistemin duruş sebeplerine ilişkin raporları inSCADA 'dan alabilirsiniz.

inSCADA onay veya bilgi alma ile ilgili 8 farklı yöntem sunar. Bu yöntemleri Type parametresi ile belirlersiniz. Bunlar ;

* combo-text-yes
* combo-text-yesno
* combo-yes
* combo-yesno
* text-yes
* text-yesno
* yes
* yesno

ins.confirm metodundaki diğer parametreler ise ;

* Title : Açılacak diyalog penceresinin başlığını tanımlar.
* Message : Açılacak diyalog penceresinin mesajını tanımlar.
* Object : Dialog penceresini şekillendiren, yes ve no butonlarına basıldığında çalıştırılacak metotların tanımlandığı bir objedir.

Şimdi bu parametrelere göre onay veya bilgi alma dialog penceremizin nasıl şekillendiğini inceleyelim.

```javascript
var obj = {};
            obj.options = [
                "HV Circuit Breaker Opened at Transformer Center",
                "HV Circuit Breaker Opened at Unit Cubicle",
                "HV Circuit Breaker Opened at Grid Cubicle",
                "Water Sold Out",
                "Operator Fail",
                "Mekanik Fail",
                "RTU/PLC Fail",
                "SCADA Fail"];
            obj.onScript =  function(a){
                ins.notify("info", "Reason for Stopping", a.comboValue+"-"+a.textValue);
                ins.writeLog("info", "Unit 01","Reason for Stopping", a.comboValue+"-"+a.textValue);
            };
            obj.offScript = function(a){
                ins.notify("info","Canceled","No any message"}; 
            };
    
        ins.confirm("combo-text-yes", "PLEASE ANSWER..", "WYH DID THE UNIT STOP?", obj);
```

Yukarıdaki kodu incelediğinizde obj isimimle nesne ile dialog penceremizi şekillendiren parametrelerin tanımlandığını görebilirsiniz.&#x20;

* Object.options : Combobox'da görülecek seçenekler listesini oluşturur.
* Object.onScript : Yes butonuna basıldığında çalıştırılacak script'i tanımlar.
* Object.offScript : No butonuna basıldığında çalıştırılacak script'i tanımlar.

ins.confirm API'sinin çağrıldığı satırda da Type, Title, Message ve object parametreleri API'ye gönderilerek çalıştırılır.

![Resim 1 : combo-text-yes](/files/-Lkf92mhspMttrMH6cUd)

![Resim 2 : combo-text-yesno](/files/-Lkf9CAwYy0YTLEKrpx8)

![Resim 3 : combo-yes](/files/-Lkf9LGm1Y4PRHFdukiq)

![Resim 4 : combo-yesno](/files/-Lkf9RiCReOBEYMEwIdd)

![Resim 5 : text-yes](/files/-Lkf9Z6I052PelcztrbV)

![Resim 6 : yesno](/files/-Lkf9eRo2TZos9jHVD8S)

![Resim 7 : yes](/files/-Lkf9lI-jVSXa4zR4f1p)

![Resim 8 : yesno](/files/-Lkf9pyR6I01nE4j7ZEc)


---

# 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:

```
GET https://inscada.gitbook.io/ins/master/programing/apis/ins.confirm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
