$(document).ready(function () {
var url = window.location.href;
var id = getParameterByName("id", url);
var name = $("#msnfp_name").val();
localStorage.setItem("id", id);
localStorage.setItem("name", name);
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
});
following Code you need to add on main form where your sub grid is located this code
will set your records guide and name on local storage
then go to your insert form and use following code
$(document).ready(function () {
var id = localStorage.getItem("id");
var name = localStorage.getItem("name");
$("#msnfp_workitemid_name").attr("value", name);
$("#msnfp_workitemid").attr("value", id);
$("#msnfp_workitemid_entityname").attr("value", "msnfp_workitem");
$("#msnfp_workitemid").attr("aria-invalid", "false");
});
Comments
Post a Comment