Hi,
Portal and ArcGIS Online should be on the same release build. It is very confusing to keep up to date with what AGOL can do and what Portal can't do. Sometimes, we develop apps for ArcGIS Online and then we have to change to Portal due to AGOL limitations and then we realize that the REST API is a bit different namely in terms of functionality. Then we have to fix the code to make it compatible with Portal.
Cheers,
Jose Sousa