首页 > 代码库 > MSCRM2011用JS获取实体ObjectTypeCode

MSCRM2011用JS获取实体ObjectTypeCode

function getObjectTypeCodeByName(entityName){    try    {        var lookupService = new RemoteCommand("LookupService", "RetrieveTypeCode");        lookupService.SetParameter("entityName", entityName);        var result = lookupService.Execute();        if (result.Success && typeof result.ReturnValue =http://www.mamicode.com/="number")        {            return result.ReturnValue;        }        else        {            return null;        }    }    catch (e)    {        alert("Error while getting ETC by Name." + e.description);    }}

 

MSCRM2011用JS获取实体ObjectTypeCode