Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Angelo 95 posts 197 karma points
    Aug 20, 2018 @ 16:18
    Angelo
    0

    Get Min and Max value of a numeric Document/Member type property programaticaly

    anyone knows ? :(

    thank you

    Angelo

  • Søren Gregersen 355 posts 1468 karma points MVP 2x c-trib
    Aug 20, 2018 @ 21:42
    Søren Gregersen
    0

    Hi,

    Could you elaborate a bit on your question?

    Say you have all the values, you can use linq to ger the min / max value. If you have a lot of documents, I would do two searches (examine) and sort on the value asceding and descending respectfully, and take value from the first result.

    HTH, Søren

  • Angelo 95 posts 197 karma points
    Aug 20, 2018 @ 22:15
    Angelo
    0

    hello Soren thank you for your answer :)

    so i want to get the value of this prop programaticaly

    something like

    GetSomeDataTypeInADocumentype(someIdOfDatatype).Minimum

    GetSomeDataTypeInADocumentype(someIdOfDatatype).StepSize

    GetSomeDataTypeInADocumentype(someIdOfDatatype).Maximum

    Get Min and Max value

    thank you

    Angelo

  • Angelo 95 posts 197 karma points
    Aug 28, 2018 @ 08:06
    Angelo
    0

    solved :)

    for anyone o need this functionality ... (pseudocode)

    var somePropertyOfSomeDocumentType = PropertyType
    

    var dataTypeService = ApplicationContext.Current.Services.DataTypeService; IDataTypeDefinition dataType = dataTypeService.GetDataTypeDefinitionById(somePropertyOfSomeDocumentType.DataTypeDefinitionId); IDictionary

    and you get the max value of that property Type

    thank you

    Angelo

  • Søren Gregersen 355 posts 1468 karma points MVP 2x c-trib
    Aug 28, 2018 @ 10:18
    Søren Gregersen
    0

    Just make sure you don't use this in the frontend - at least not without caching

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies