0

XML Code

<CommandUIHandler Command="Invoke_NewRActionButtonRequest"
                          CommandAction="~appWebUrl/Pages/Default.aspx?{StandardTokens}&amp;SPListItemId={SelectedItemId}&amp;SPListId={SelectedListId}&amp;SPSource={Source}"/>

App.js code:

var sourceUrl = decodeURIComponent(getQueryStringParameter(url, "SPSource"));

I am getting undefined value for (parameter)sourceurl.

Please suggest some solution.

Thanks,

Sachin

0

This issue resolved by using below code :

sourceUrl1 = getQueryStringParameter2("SPSource");

sourceurl2 = decodeURIComponent(sourceUrl1);

also find the function for getQueryStringParameter : where

function getQueryStringParameter2(paramToRetrieve, url) {
    if (url.indexOf("?") > -1) {
        var params = url.split("?")[1].split("&");
        for (var i = 0; i < params.length; i = i + 1) {
            var singleParam = params[i].split("=");
            if (singleParam[0] == paramToRetrieve)
                return singleParam[1];
        }
    }
    else {
        return "";
    }

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.