This project has moved and is read-only. For the latest updates, please go here.

SPComplexToSimpleDropdown() function not executed when element is already a Select field

Nov 20, 2011 at 7:50 PM

Hi All...

Unclear if this is by design or an issue... I just attempted to use SPComplexToSimpleDropdown() where I defined a callback (completefunc option), but that function was never called.  The field that was going to be converted was already a SELECT field in this case (had not reached the 20+ items).  

According to the documentation, the utility exists if the field is already a select, but shouldn't the completefunc (if defined) also be called at that time?

In my usage, I want to insure that my next step is only executed after the element is assured to be a select field.. does anyone know if this utility is "synchronous"?  If so, then I can just place my "next step" after the call to SPComplexToSimpleDropdown() and case solved.

Paul T.



Nov 20, 2011 at 7:55 PM
I don't have the code in front of me, but I believe that I simply exit the function if there's nothing to do. You could check the code to be sure.

Nov 20, 2011 at 8:03 PM

Thanks Marc for the quick Reply...

I just remembered have the un-minified version... I checked and you are correct... if it so type=C, then you do an exit...

On my second question: I looked around in this utility and does not seem to make any calls that would cause it to be an Async method... (I questioned this because anytime I see the completefunc option it normally leads me to believe something can be done in Async mode and thus the function defined is assured to be executed after its "all done") thus... placing the "next action" after the call to SPComplexToSimpleDropdown() should be safe (and if it is all true, it would be the same as defining it inside a function given to competefunc...

Thanks again for your help.

Paul T.

Dec 30, 2011 at 3:44 PM


Sorry I never answered this one. completefunc is always executed after everything else. For the core Web Services calls, it's after we've got the returned XML. For the value added functions, it's as close to the last thing that the function done as is practical. Keep in mind that you call most of the functions only once and they bind to various events. The completefunc is called on that initial setup, but not after.


Dec 30, 2011 at 4:48 PM

Thanks Marc...

May 29, 2013 at 10:02 PM

I came across this discussion while researching my issue, which was the same as the OP. However, the documentation on the page for SPComplexToSimpleDropdown states: "If specified, the completefunc will be called each time there is a change to columnName. " which for me means that it will be called anytime the user changes the selection. Am I missing something?