Skip to content

Instantly share code, notes, and snippets.

@4E71
Created April 18, 2012 17:05
Show Gist options
  • Save 4E71/2415069 to your computer and use it in GitHub Desktop.
Save 4E71/2415069 to your computer and use it in GitHub Desktop.
crm: js snippets
// Used to set text field with the value of a Lookup entity.
function Replace()
{
var lookupItem = new Array();
lookupItem = Xrm.Page.getAttribute("schema_field_name").getValue();
if (lookupItem != null)
{
var name = lookupItem[0].name;
}
Xrm.Page.getAttribute("schema_field_name").setValue( name );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment