How Can I Convert Date to String in Request Property

Hello Everyone,

I have a request property, and the request property has 3 parameters. Data type of one of them is date. When I tried to approve this request through Web Portal, I have been getting an error as "String was not recognized as a valid DateTime." How can i convert it from date to string. I tried to write script validation script filed like "Value = ParameterSet("EndDate").toString" but it was not successful. Could you help me for this issue? 

BR,

Volkan Ceylan

Parents Reply Children
  • Hello, I am having a similar issue to this. 

    It is using User Prompt and has Data Type set to Date. 

    The value that appears in the UI is 11/27/2024 using the standard date picker component that the Request Properties displays in the Angular side sheet.

    However after selecting the value, the error appears at the top of the page, An Error occurred while processing your request and the submit button is greyed out in the Sidesheet for the request properties.

    Looking on the ApiServer logs, i can see that the error message that appears is the following:

    An error occurred while processing the request: PUT https:<url of api server>/portal/cartitem/interactive System.Exception: An error occurred while processing the request: PUT<same url as mentioend before> ----> VI.Base.ViException: Conversion on 27/11/2024 12:00:00 AM to Date failed. ----> System.FormatException: String was not recognized as a valid DateTime.

    My version is 9.2.1

    I've also tried to set it to a string value within the Data Dependency Script section of the Date DialogParameter (within Manager) and Valuation Script and then tried to use ParseExact to convert back in to a date value using local culture format and invariant culture however it didn't seem to work. 

    Setting it to a hard coded date value within a string and converting it to a date seems to work within the request properties script however setting it throught the UI within angular is causing an issue. I've been able to replicate this issue in my personal lab envrionment also. 

    Interestingly, to replicate the error, it seems that another parameter is required within the DialogParameterSet that has a DataSource = Table such as Person.UID_Person. Filling out this parameter before and then selecting a date almost always brings the error however without this FK parameter, it seems to not thrown an initial error even up to submitting the request in thie shoping cart.