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.
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
Mandatory checkbox ticked : This works, the editor is asked to enter a value when the content is saved.
Mandatory checkbox ticked & regular expression added : This works, the editor is asked to enter a valid value when the content is saved.
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.
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
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
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
Ah great, then I'll test the GetStock method at the same time. :-)
One beta 4 package uploaded. From all of Tea Solutions to all of you.
Merry Christmas :)
/Rune
Hi Rune,
I've just tested all three cases.
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
Hi Rune,
It's low priority but have you got this on your radar?
is working on a reply...