Tuesday, 6 January 2009

Set Currency to Pound Sterling

(from here: http://msdn.microsoft.com/en-us/library/cc468412.aspx)

Drop this into the onLoad form event:

var myCurrency = crmForm.all.transactioncurrencyid;

// Do Not overwrite an existing value that may be mapped.
if (myCurrency.DataValue == null)
{
// Create an array to set as the DataValue for the lookup control.
var lookupData = new Array();
// Create an object to add to the array.
var lookupItem= new Object();
// Set the id, typename, and name properties to the object.
lookupItem.id = '{0DC1106C-F686-DD11-A1E3-0019BBD28930}';
lookupItem.typename = 'transactioncurrency';
lookupItem.name = 'Pound Sterling';
// Add the object to the array.
lookupData[0] = lookupItem;
// Set the value of the lookup field to the value of the array.
myCurrency.DataValue = lookupData;
}

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home