The CreatorCon Call for Content is officially open! Get started here.

How to get the view name of the form by using script

mdsannavulla
Kilo Guru

Hi All,

For change table we are having two different views.So I want to get the view name by using script.

32 REPLIES 32

Anurag Tripathi
Mega Patron
Mega Patron

Hi MD,



on a client script just do this



var x = window.location;   //this will give you the whole url , now you can read the parameters


-Anurag

I want to add query by using Business rule for two different views.See my code which I pasted above


Please paste the value you are getting in current.getEncodedQuery()






-Anurag

ORDERBYDESCnumber


Run this



if (current.getEncodedQuery().indexOf('sys_id')== -1)


  {


gs.addInfoMessage("1");


    if (current.getEncodedQuery().indexOf('sys_id=') != 0)


  {gs.addInfoMessage("2");


  if(view.startsWith("default"))


      {gs.addInfoMessage("3");


  current.addQuery("u_change_type", "Infrastructure");


  }


  else if(view.startsWith("itcc"))


      {gs.addInfoMessage("4");


      current.addQuery("u_change_type", "itcc");


  }



  }


}



and tell me what all messages did you get.


-Anurag