Forum Discussion

Maddy's avatar
Maddy
Ideator I
7 years ago

How to set default value to list onformpopulate

Hi,

I've list field on some of the document classifications which is mandatory field, I have to set default value, it is getting set on that field but while saving the document, getting error "Please provide value for mandatory property".

Below is code I written on "onformpopulate" event:

var documentItem = document.thisItem;

var type = documentItem.getProperty("classification");

if(type === "ABC" || type === "PQR")
{
     document.getElementById("MainDataForm").sh_number.value = "100";
}

How to handle this?

Regards,

Maddy.

2 Replies

  • Hi Maddy,

    I think what you are looking for is

    window.handleItemChange(propertyName, propertyValue);

    Try using that instead of using the document.getElementyById....

    Hope this helps,

    C