I have a custom button that opens a new Contact record using window.open. My objective is to copy the First Name and Last Name fields into the new record with the button.
I am going to need to do this for multiple records so I cannot simply just use "main.aspx?etc=2&extraqs=firstname%3DMike&pagetype=entityrecord" because Mike will not always be the First Name.
Does anyone know how to pass custom variables into the query string so that this function can be reusable?
I have tried doing the following but it does not work:
function HelloWorld()
{
var f_Name = Xrm.Page.getAttribute("firstname").getValue();
window.open("....main.aspx?etc=2&extraqs=firstname=f_Name&pagetype=entityrecord");
}
Does anyone know how to do this?