{"id":8009,"date":"2023-08-30T11:04:45","date_gmt":"2023-08-30T10:04:45","guid":{"rendered":"https:\/\/help.cirrus-shield.com\/?post_type=docs&#038;p=8009"},"modified":"2023-10-30T13:24:33","modified_gmt":"2023-10-30T12:24:33","slug":"sirene","status":"publish","type":"docs","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/admin-guide\/plugins\/sirene\/","title":{"rendered":"Sirene"},"content":{"rendered":"\n<p class=\"has-luminous-vivid-amber-color has-text-color has-medium-font-size wp-block-paragraph\"><strong>Introduction<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide aims to walk you through the process of effectively integrate Sirene with Cirrus Shield.<\/p>\n\n\n\n<p class=\"has-luminous-vivid-amber-color has-text-color has-medium-font-size wp-block-paragraph\"><strong>Prerequisistes<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before you can start using the service, you will need to do the following steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>In Sirene<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Create a Sirene Account<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a Sirene account by signing in to insee.fr website, here is the link: <a href=\"https:\/\/api.insee.fr\/catalogue\/site\/themes\/wso2\/subthemes\/insee\/pages\/item-info.jag?name=Sirene&amp;version=V3&amp;provider=insee\">https:\/\/api.insee.fr\/catalogue\/site\/themes\/wso2\/subthemes\/insee\/pages\/item-info.jag?name=Sirene&amp;version=V3&amp;provider=insee<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Retrieve Application Credentials (Consumer Key &amp; Consumer Secret):<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After creating your account, proceed to the &#8220;My Applications&#8221; section. Click on &#8220;Add Application&#8221; to create a new application.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"530\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-35.png\" alt=\"\" class=\"wp-image-7963\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-35.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-35-300x175.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-35-768x447.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"550\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-36.png\" alt=\"\" class=\"wp-image-7965\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-36.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-36-300x181.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-36-768x464.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once the application is created, navigate to its name, and access the &#8220;Production Keys&#8221; tab. Here, you can obtain the Consumer Key &amp; Consumer Secret<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"550\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-37.png\" alt=\"\" class=\"wp-image-7967\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-37.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-37-300x181.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-37-768x464.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"840\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-38.png\" alt=\"\" class=\"wp-image-7969\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-38.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-38-300x277.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-38-768x709.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>In Cirrus Shield<\/em><\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><strong>Install the Sirene Plugin:<\/strong> <\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Go to &#8220;Configuration&#8221; in Cirrus Shield, then select &#8220;Extensions.&#8221; Install the Sirene plugin to enable the integration.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"439\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-39.png\" alt=\"\" class=\"wp-image-7971\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-39.png 542w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-39-300x243.png 300w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"643\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-40.png\" alt=\"\" class=\"wp-image-7973\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-40.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-40-300x212.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-40-768x543.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"662\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-41.png\" alt=\"\" class=\"wp-image-7975\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-41.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-41-300x218.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-41-768x559.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li><strong>Creation of \u201cAccount\u201d object:<\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">To use the Sirene Plugin effectively, ensure that the &#8220;Account&#8221; object is created with specific fields and field types. The essential fields for Sirene integration are &#8220;CodeAPE&#8221; and &#8220;SIRET.&#8221; Refer to the images provided below for guidance.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"463\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-42.png\" alt=\"\" class=\"wp-image-7977\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-42.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-42-300x153.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-42-768x391.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"319\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-43.png\" alt=\"\" class=\"wp-image-7979\" style=\"width:840px;height:294px\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-43.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-43-300x105.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-43-768x269.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To be able to create an object you must go to Configuration -&gt; Objects and click on the button to create an object<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"891\" height=\"341\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-44.png\" alt=\"\" class=\"wp-image-7981\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-44.png 891w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-44-300x115.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-44-768x294.png 768w\" sizes=\"(max-width: 891px) 100vw, 891px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"256\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-45.png\" alt=\"\" class=\"wp-image-7983\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-45.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-45-300x84.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-45-768x216.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After creating the object, go to \u201cChamps personnalis\u00e9s\u201d and create a new field, based on the fields that are shown in the image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"492\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-46.png\" alt=\"\" class=\"wp-image-7985\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-46.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-46-300x162.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-46-768x415.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>N.B. : Make sure to create the fields with the same name and same type of the images regarding the \u201cAccount\u201d object<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"664\" height=\"689\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-47.png\" alt=\"\" class=\"wp-image-7987\" style=\"width:840px;height:689px\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-47.png 664w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-47-289x300.png 289w\" sizes=\"(max-width: 664px) 100vw, 664px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"291\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-48.png\" alt=\"\" class=\"wp-image-7989\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-48.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-48-300x96.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-48-768x246.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It should be the same done for the rest of the fields based on their name and field types.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. JavaScript Button :<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a button for the object that you will be using with Sirene. To be able to create a JavaScript button, you must go to Configuration -> Object -> Details -> Bouton Personnalis\u00e9s.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Custom Buttons<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"375\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-49.png\" alt=\"\" class=\"wp-image-7991\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-49.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-49-300x124.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-49-768x316.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"516\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-50.png\" alt=\"\" class=\"wp-image-7993\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-50.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-50-300x170.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-50-768x435.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ensuite, vous cr\u00e9ez un bouton avec les informations suivantes :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"953\" height=\"179\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-51.png\" alt=\"\" class=\"wp-image-7995\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-51.png 953w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-51-300x56.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-51-768x144.png 768w\" sizes=\"(max-width: 953px) 100vw, 953px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"473\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-52.png\" alt=\"\" class=\"wp-image-7997\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-52.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-52-300x156.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-52-768x399.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Here is the code that you will be using for the button:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.11.1\/jquery.min.js\"&gt;&lt;\/script&gt;\n&lt;style&gt;\n    #myModalList {\n        max-height: 700px;\n        overflow-y: auto;\n    }\n\n    .modal {\n        display: none;\n        padding-top: 40px;\n        width: 100%;\n        height: 100%;\n        overflow: auto;\n        background-color: rgb(0, 0, 0);\n        background-color: rgba(0, 0, 0, 0.4);\n    }\n    .modal-content {\n        background-color: #fefefe;\n        margin: auto;\n        padding: 20px;\n        border: 1px solid #888;\n        width: 80%;\n    }\n    .close {\n        float: right;\n        font-size: 28px;\n        font-weight: bold;\n    }\n    #MySelectBtn {\n        float: right;\n    }\n    .close:hover,\n    .close:focus {\n        color: #000;\n        text-decoration: none;\n        cursor: pointer;\n    }\n    .modalTable {\n    font-family: arial, sans-serif;\n    border-collapse: collapse;\n    width: 100%;\n    }\n    .modalElem {\n    border: 1px solid #dddddd;\n    text-align: left;\n    padding: 8px;\n    }\n    .modalRow:nth-child(even) {\n    background-color: #dddddd;\n    }\n    .modalElem label {\n    display: inline;\n    }\n    #MySelectBtn,\n    .MyCancel {\n        margin-top: 10px;\n        padding: 5px 10px;\n    }\n    #myModalListInfo {\n        margin-bottom: 10px;\n        padding: 5px;\n    }\n&lt;\/style&gt;\n\n&lt;div id=\"myModal\" class=\"modal\"&gt;\n    &lt;div class=\"modal-content\"&gt;\n        &lt;span class=\"close\"&gt;&amp;times;&lt;\/span&gt;\n        &lt;div id=\"myModalList\" class=\"table-responsive\"&gt;&lt;\/div&gt;\n    &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;script&gt;\n\nfunction GetCompanyInfo() {\n\n    var orgid = GetOrganizationInfo().Id;\n    var myRecordId = GetRecordGUID();\n    var recordData = GetDataByID(myRecordId, \"Account\", \"Name, Company_Number\");\n    console.log(\"record data\");\n    console.log(recordData);\n    if (recordData.Company_Number == null || recordData.Company_Number == \"null\") {\n        var modal = document.getElementById(\"myModal\");\n        var modalList = document.getElementById(\"myModalList\");\n        console.log(\"modal list value\")\n        console.log(modalList)\n        var span = document.getElementsByClassName(\"close\")&#91;0];\n\n        span.onclick = function () {\n            modal.style.display = \"none\";\n            modalList.innerHTML = \"\";\n        }\n\n        var companies;\n        $.ajax({\n            type: \"GET\",\n            async: false,\n            url: `https:\/\/sirene.cirrus-shield.net\/Sirene?name=${recordData.Name}&amp;orgid=${orgid}`,\n            success: function (Data) {\n                if (Data != undefined) {\n                    companies = Data;\n                    console.log(\"companies \");\n                    console.log(companies);\n                    var table = \"&lt;table class='modalTable table table-hover'&gt;\"\n                    var hd = `&lt;thead&gt;\n                        &lt;tr class='modalRow'&gt;\n                            &lt;th class='modalElem'&gt;&lt;\/th&gt;\n                            &lt;th class='modalElem'&gt;SIRET&lt;\/th&gt;\n                            &lt;th class='modalElem'&gt;Nom&lt;\/th&gt;\n                            &lt;th class='modalElem'&gt;ADRESSE&lt;\/th&gt;\n                        &lt;\/tr&gt;\n                    &lt;\/thead&gt;`;\n                    table += hd\n                    companies.forEach(company =&gt; {\n                        console.log(\"address etablissement\")\n                        console.log(company.adresseEtablissement);\n                        var row = `&lt;tr id=${company.siret} class='modalRow'&gt;\n                            &lt;td class='modalElem'&gt;&lt;input type=\"radio\" id=${company.siret} name=\"company\" value=${company.siret}&gt;&lt;\/td&gt;\n                            &lt;td class='modalElem'&gt;${company.siret}&lt;\/td&gt;\n                            &lt;td class='modalElem'&gt;${company.uniteLegale.denominationUniteLegale}&lt;\/td&gt;\n                            &lt;td class='modalElem'&gt;\n                                &lt;label for=${company.siret} id='myLabel'&gt;\n                                    ${company.adresseEtablissement.numeroVoieEtablissement ?? \"\"} ${company.adresseEtablissement.typeVoieEtablissement ?? \"\"} ${company.adresseEtablissement.libelleVoieEtablissement ?? \"\"}, ${company.adresseEtablissement.codePostalEtablissement ?? \"\"} ${company.adresseEtablissement.libelleCommuneEtablissement ?? \"\"}\n                                &lt;\/label&gt;\n                            &lt;\/td&gt;\n                        &lt;\/tr&gt;`\n                        table += row;\n\n                    });\n                    table += \"&lt;\/table&gt;\"\n\n                    console.log(\"created table here\")\n                    var selectBtn = \"&lt;input type='button' value='Select' id='MySelectBtn'\/&gt;\";\n                    var cancelBtn = \"&lt;input type='button' value='Cancel' class='MyCancel'\/&gt;\";\n\n                    console.log(\"adding the showing first n results\")\n                    modalList.innerHTML += `&lt;div id=\"myModalListInfo\"&gt;Showing first &lt;strong&gt;${Object.keys(companies).length &lt; 100 ? Object.keys(companies).length : 100}&lt;\/strong&gt; results&lt;\/div&gt;`\n\n                    console.log(\"adding the table\")\n                    modalList.innerHTML += table;\n                    \/\/ console.log(\"adding the select button\")\n                    \/\/ modalList.innerHTML += selectBtn;\n                    \/\/ console.log(\"adding the cancel button\")\n                    \/\/ modalList.innerHTML += cancelBtn;\n                    modalList.insertAdjacentHTML('afterend', selectBtn);\n                    modalList.insertAdjacentHTML('afterend', cancelBtn);\n                    modal.style.display = \"block\";\n\n                    console.log(\"getting the MySelectBtn tag\")\n                    var selBtn = document.getElementById(\"MySelectBtn\");\n                    console.log(selBtn);\n\n                    console.log(\"setting the onclick for MySelectBtn\")\n                    selBtn.onclick = function () {\n                        getSelected(myRecordId, recordData.Name, orgid)\n                    };\n\n                    console.log(\"getting MyCancel tag\");\n                    var delBtn = document.getElementsByClassName(\"MyCancel\")&#91;0];\n\n                    console.log(\"setting the onclick for MyCancel\")\n                    delBtn.onclick = function () {\n                        modal.style.display = \"none\";\n                        modalList.innerHTML = \"\";\n                    }\n                }\n                else {\n                    console.log(\"no companies\")\n                    companies = null;\n                }\n            },\n            error: function (XMLHttpRequest) {\n                alert(XMLHttpRequest.responseText);\n            }\n        });\n        $('.modalTable tbody tr').click(function (event) {\n            if (event.target.type !== 'radio') {\n                $(':radio', this).trigger('click');\n            }\n        });\n    }\n    else {\n        addCompanyInfo(recordData.Company_Number, myRecordId, recordData.Name, orgid);\n    }\n}\n\nfunction getSelected(myRecordId, name, orgid) {\n    var mySiret = document.querySelector(\"input&#91;name=company]:checked\").value;\n    console.log(\"Name of selected record: \" + name);\n    console.log(\"Siret of selected record: \" + mySiret);\n    addCompanyInfo(mySiret, myRecordId, name, orgid);\n\n}\n\nfunction addCompanyInfo(siret, myRecordId, name, orgid) {\n    var companyInfo;\n    $.ajax({\n        type: \"GET\",\n        async: false,\n        url: `https:\/\/sirene.cirrus-shield.net\/Sirene\/${siret}?orgid=${orgid}`,\n        success: function (Data) {\n            if (Data != undefined) {\n                companyInfo = Data;\n                console.log(companyInfo);\n            }\n            else {\n                companyInfo = null;\n            }\n        },\n        error: function (XMLHttpRequest) {\n            alert(XMLHttpRequest.responseText);\n            \/\/var response = JSON.parse(XMLHttpRequest.responseText);\n            \/\/console.log(response);\n            \/\/if (response.status == 404) {\n            \/\/    alert(\"No company found with this siret: \" + siret + \".\")\n            \/\/}\n            \/\/else {\n            \/\/    alert(response.title);\n            \/\/}\n        }\n    });\n    if (companyInfo != null) {\n        name = name.toUpperCase() == companyInfo.uniteLegale.denominationUniteLegale ? name : companyInfo.uniteLegale.denominationUniteLegale;\n\n        var docAcc = document.implementation.createDocument(\"\", \"\", null);\n        var xmlAccData = docAcc.createElement(\"Data\");\n        var xmlAcc = docAcc.createElement(\"Account\");\n        var element;\n\n    \n        element = docAcc.createElement(\"Id\");\n        element.textContent = myRecordId;\n        xmlAcc.appendChild(element);\n\n        element = docAcc.createElement(\"Name\");\n        element.textContent = name;\n        xmlAcc.appendChild(element);\n\n        \/\/element = docAcc.createElement(\"Company_Creation_Date\");\n        \/\/element.textContent = companyInfo.uniteLegale.dateCreationUniteLegale;\n        \/\/xmlAcc.appendChild(element);\n\n        element = docAcc.createElement(\"Nom_du_dirigeant\");\n        element.textContent = companyInfo.uniteLegale.nomUniteLegale ?? \"\";\n        xmlAcc.appendChild(element);\n\n        element = docAcc.createElement(\"Prenom_du_dirigeant\");\n        element.textContent = companyInfo.uniteLegale.prenom1UniteLegale ?? \"\";\n        xmlAcc.appendChild(element);\n\n        element = docAcc.createElement(\"Code_NAF\");\n        element.textContent = companyInfo.uniteLegale.activitePrincipaleUniteLegale ?? \"\";\n        xmlAcc.appendChild(element);\n\n        element = docAcc.createElement(\"Effectifs\");\n        element.textContent = companyInfo.uniteLegale.trancheEffectifsUniteLegale;\n        xmlAcc.appendChild(element);\n\n        element = docAcc.createElement(\"Company_Number\");\n        element.textContent = siret;\n        xmlAcc.appendChild(element);\n\n        element = docAcc.createElement(\"Billing_Street\");\n        element.textContent = `${companyInfo.adresseEtablissement.numeroVoieEtablissement ?? \"\"} ${companyInfo.adresseEtablissement.typeVoieEtablissement ?? \"\"} ${companyInfo.adresseEtablissement.libelleVoieEtablissement ?? \"\"}`;\n        xmlAcc.appendChild(element);\n\n        console.log(companyInfo.adresseEtablissement.libelleCommuneEtablissement);\n        element = docAcc.createElement(\"Billing_City\");\n        element.textContent = companyInfo.adresseEtablissement.libelleCommuneEtablissement ?? \"\";\n        xmlAcc.appendChild(element);\n\n        element = docAcc.createElement(\"Billing_Country\");\n        element.textContent = \"France\";\n        xmlAcc.appendChild(element);\n\n        element = docAcc.createElement(\"Billing_ZIP\");\n        element.textContent = companyInfo.adresseEtablissement.codePostalEtablissement ?? \"\";\n        xmlAcc.appendChild(element);\n\n        xmlAccData.appendChild(xmlAcc);\n        docAcc.appendChild(xmlAccData);\n\n\n        try {\n            \/\/ Update account\n            console.log(\"###   UPDATING ACCOUNT  ###\\n\" + (new XMLSerializer()).serializeToString(docAcc));\n            var ObjResAcc = UpdateRecord(\"Account\", \"Id\", docAcc, false)\n            if (!ObjResAcc.msgSuccess) {\n                alert(ObjResAcc.msgInfo);\n                return;\n            }\n            console.log(\"###   UPDATING ACCOUNT SERVER RESPONSE   ###\\n\" + ObjResAcc.msgInfo);\n            location = location;\n        } catch (ex) {\n            var errorMsg = \"An error happened while updating the account.\\n \" + ex.message;\n            alert(errorMsg);\n            return;\n        }\n    }\n}\n&lt;\/script&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><br>Make sure to change the visibility of the button based on the users that will be using it, you can do this by going to the object where you created the button -> button details -> Profils<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"158\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-53.png\" alt=\"\" class=\"wp-image-7999\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-53.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-53-300x52.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-53-768x133.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"321\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-54.png\" alt=\"\" class=\"wp-image-8001\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-54.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-54-300x106.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-54-768x271.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"263\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-55.png\" alt=\"\" class=\"wp-image-8003\" style=\"width:840px;height:243px\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-55.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-55-300x87.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-55-768x222.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And finally, you will be able to see the button in the details page of the record of the specific chosen object<\/p>\n\n\n\n<p class=\"has-luminous-vivid-amber-color has-text-color has-medium-font-size wp-block-paragraph\"><strong>Configuration<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To configure the plugin that you installed, you\u2019ll have to go to the details of the Sirene installed plugin.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"397\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-56.png\" alt=\"\" class=\"wp-image-8005\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-56.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-56-300x131.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-56-768x335.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You will be navigated to the configuration page, start by adding your cirrus-shield credentials (Username &amp; Password), your Sirene credentials (Access Token), you can also click on the check box if you want to get info about new companies in France daily, and the CodeAPE of your choice, you can input one or more based on your preferences, and then click on create, your configuration will be saved to Cirrus-Shield.<\/p>\n","protected":false},"author":12,"featured_media":0,"parent":1363,"menu_order":6,"comment_status":"open","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_is_vendor_doc":"0","footnotes":""},"doc_tag":[],"class_list":["post-8009","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/8009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/comments?post=8009"}],"version-history":[{"count":3,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/8009\/revisions"}],"predecessor-version":[{"id":8594,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/8009\/revisions\/8594"}],"up":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/1363"}],"next":[{"title":"Docusign","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/admin-guide\/plugins\/docusign\/","href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/8505"}],"prev":[{"title":"Mailchimp","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/admin-guide\/plugins\/mailchimp\/","href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/7936"}],"wp:attachment":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/media?parent=8009"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/doc_tag?post=8009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}