Forum Discussion

Shubham_Pakle's avatar
Shubham_Pakle
Ideator I
2 years ago
Solved

Getting name property mismatch error while changing data type - Text to Date

The Property has data type Text and we are trying to set to Date on that time we are getting : -

does not match the required 'name' property pattern: ^[a-zA-Z](\w*| +\w+)*$]]

Request: <Item type="ItemType" id="5738793931D64D938F02558135C20FE8" action="add" doGetItem="0"><Relationships><Item type="Property" id="41C87DE9CAC2484DBE736F80016D1C87" action="add"><data_type>date</data_type><pattern>short_date_time</pattern></Item></Relationships></Item>
     

Response: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault xmlns:af="http://www.aras.com/InnovatorFault"><faultcode>SOAP-ENV:Server.PatternMismatchException</faultcode><faultstring><![CDATA[The specified value () does not match the required 'name' property pattern: ^[a-zA-Z](\w*| +\w+)*$]]></faultstring><detail><af:legacy_detail><![CDATA[The specified value () does not match the required 'name' property pattern: ^[a-zA-Z](\w*| +\w+)*$]]></af:legacy_detail><af:exception message="The specified value () does not match the required 'name' property pattern: ^[a-zA-Z](\w*| +\w+)*$" type="Aras.Server.Core.PatternMismatchException" /><af:item type="ItemType"><af:property name="name" value="" /></af:item></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
       
  • Hello Shubham_Pakle ,

    As per your aml I have understood like you are trying to add the Item type with 1 property. 

    But while adding item type name is mandatory and you will get same error, so while creating it you need to add mandatory properties in AML. After adding mandatory properties I hope your issue will resolve.

    Regards,

    Suhas

2 Replies

  • Hello Shubham_Pakle ,

    As per your aml I have understood like you are trying to add the Item type with 1 property. 

    But while adding item type name is mandatory and you will get same error, so while creating it you need to add mandatory properties in AML. After adding mandatory properties I hope your issue will resolve.

    Regards,

    Suhas

  • Former Member's avatar
    Former Member

    To target the "Classification" field of the "Document" item type in the search grid view, you need to modify the search filters and ensure that the field is prefilled and uneditable.

    Steps to Achieve This:

    1. Get the Current User Identity: Since you already have the code for this, store the user identity in a variable.
    2. Modify the Search Filter: Check if the current user belongs to the restricted group and then enforce the "Classification" field value.
    3. Prefill and Lock the Field: Ensure that "Classification" is prefilled with "General" and prevent users from changing it. 

    If you are working with JavaScript in a web-based application (e.g., using jQuery or custom UI script), you can use the following approach:

    document.addEventListener("DOMContentLoaded", function () {
    // Assume getCurrentUser() is a function that retrieves the user's identity
    let userIdentity = getCurrentUser();

    // Target the search grid and locate the "Classification" field
    let classificationField = document.querySelector("#searchGrid input[name='Classification']");

    if (classificationField) {
    // Set default value
    classificationField.value = "General";

    // Make it read-only
    classificationField.setAttribute("readonly", true);
    }
    });