0

In Dynamics CRM 2016, I am able to pass some parameters to the other form using query string but I am unable to check if a particular element is exist in query. I tried using indexOf for check index, includes to varify if element is exist but I cannot made a way through. I would like to hear from experts to get the length or if an element is exist in query string parameter.

function getQueryStringLength()
{
    var param = Xrm.Page.context.getQueryStringParameters();
    var chkElem = param.includes("new_orderid");
    alert(chkElem);
}
AQ Dev
  • 43
  • 3
  • 14
  • Possible duplicate of [How can I get query string values in JavaScript?](http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript) – Zakaria Acharki Jun 28 '16 at 13:56

1 Answers1

1

If indexOf returns -1 if substring is not found. Otherwise it will return array index where substring started. Not sure why you did not succeed.

if(str.indexOf(substr) > -1)
Mantas Čekanauskas
  • 2,218
  • 6
  • 23
  • 43