I have a picklist on a new page. I am running a data map before coming to this page, so when it loads, most fields are already filled in, including the picklist.

When I do getPicklistCode on load of that new page, it is returning empty, knowing that I have a value there. Now if I change the value of the picklist, getPicklistCode will start returning codes..

Also I saw that when the page loads, the attribute 'selected' of the selected option in the picklist is placed before the code in the html tag as shown in the screenshot below.

I tried moving it after the code so that the option would be :

<option value="15890" code="opportunity" selected="selected">Opportunity </option>

and getPicklistCode returns the code after that change !

I am not sure if that makes any sense, but is there an issue with getPicklistCode?

We are still in v 4.0.2.