How to set value in text field using javascript in crm 2011
function setValueOnload()
{
Xrm.Page.data.entity.attributes.get("fax").setValue("FAX12345");
Xrm.Page.data.entity.save();
}
(or)
function setValueOnload()
{
Xrm.Page.getAttribute("fax").setValue("FAX12345");
Xrm.Page.data.entity.save();
}
function setValueOnload()
{
Xrm.Page.data.entity.attributes.get("fax").setValue("FAX12345");
Xrm.Page.data.entity.save();
}
(or)
function setValueOnload()
{
Xrm.Page.getAttribute("fax").setValue("FAX12345");
Xrm.Page.data.entity.save();
}
Please advise on how do I set value in a currency value?
ReplyDeleteHi..
ReplyDeleteCurrency is lookup field.so you can set currency value like this way.
function setCurrency(){
var currencyid = "B52275BE-28F4-E211-9160-984BE1734553";
var currencyName = "US Dollar";
var entityName = "transactioncurrency";
Xrm.Page.getAttribute("transactioncurrencyid").setValue([{ id: currencyid, name: currencyName, entityType: entityName}]);
}
You can call this function in onload event in any entity like contact,account etc.
how can I copy a date field into a text box
ReplyDeleteHello...
ReplyDeleteI have a custom entity where i have a contact lookup field where the user selects a contact. I would like to update a field on that custom form/entity with data from a field from the contact record. Any help would be appreciated!!
Helpful
ReplyDelete