Copied to clipboard

Flag this post as spam?

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


  • Matt Taylor 859 posts 2052 karma points
    Dec 16, 2011 @ 15:50
    Matt Taylor
    0

    Unable to force the entry of stock

    I'm having trouble figuring out how to force the editor to enter a product's stock value.

    Firstly the no attention is paid to the Mandatory flag when saving the node.

    Secondly the regular expresssion I enter to make sure a numeric value is entered causes a fail "Stock at Product information is not in a correct format" even when entering a valid number.

    The same regular expression works fine if I use it on a textstring datatype.

    I'm guessing this all has something to do with it being a custom datatype?

    The result is that there's no way to advise the editor to enter the stock value if they forget.

    Cheers, Matt

  • Anders Burla Johansen 2560 posts 8256 karma points
    Dec 16, 2011 @ 16:05
    Anders Burla Johansen
    0

    Hi Matt

    Good point - its because its a custom datatype - we will look into if its possible to get the "Mandatory" and "Validation" field values in our custom editor from the umbraco API

    Kind regards
    Anders

  • Rune Grønkjær 1303 posts 2895 karma points
    Dec 22, 2011 @ 17:01
    Rune Grønkjær
    0

    Hi Matt,

    I have found the problem and have change the code and testet it. Just need to create a new package for you. Will do that tomorrow.

    /Rune

  • Matt Taylor 859 posts 2052 karma points
    Dec 22, 2011 @ 17:08
    Matt Taylor
    0

    Ah great, then I'll test the GetStock method at the same time. :-)

  • Rune Grønkjær 1303 posts 2895 karma points
    Dec 23, 2011 @ 08:12
    Rune Grønkjær
    0

    One beta 4 package uploaded. From all of Tea Solutions to all of you.

    Merry Christmas :)

    /Rune

  • Matt Taylor 859 posts 2052 karma points
    Dec 24, 2011 @ 14:17
    Matt Taylor
    0

    Hi Rune,

    I've just tested all three cases.

    1. Mandatory checkbox ticked : This works, the editor is asked to enter a value when the content is saved.
    2. Mandatory checkbox ticked & regular expression added : This works, the editor is asked to enter a valid value when the content is saved.
    3. Regular expression added: This does not work, the editor can save the item when a non-numeric value is entered into the Stock field.

    I have tested point 3 with a textstring field to make sure it's not Umbraco at fault.

    Ironically it is now point 3 that I think will most suit my site because I have many products that don't require stock and some that do. So I don't want to force entry for all products but I do want to make sure it is a number if something is entered.

    Regards,

    Matt

  • Matt Taylor 859 posts 2052 karma points
    Jan 17, 2012 @ 14:54
    Matt Taylor
    0

    Hi Rune,

    It's low priority but have you got this on your radar?

  • 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