tips & tricks


Calendario
aprile 2024
lmmgvsd
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Ascentium CrmService - CRM JavaScript SDK

Ascentium CrmService


Ecco una libreria Jscript molto interessante per lavorare via jscript direttamente con i webservices del CRM.

E' un semplice file .js che và importato nella pagina su cui vogliamo utilizzarlo, e che ci dà la possibilità di fare:

 

·         Create

·         Retrieve

·         Update

·         Delete

·         Fetch

·         Associate

·         Disassociate

·         SetState

 

Una delle funzionalità che ho utilizzato è la retrieve con la fetchXml che posso creare comodamente con Stunware Tools:

 

function Fetch()

{

    //create the Ascentium_CrmService object

    var oService = new Ascentium_CrmService(orgName.value, serverUrl.value);// Se lo includo nell'entità non c'è bisogno di passargli niente

 

    //execute a Fetch query

    var sFetchXml = "<fetch mapping='logical'><entity name='account'><attribute name='accountid'/><attribute name='name'/></entity></fetch>";

    var aoFetchResult = oService.Fetch(sFetchXml);//mi ritorna una collection di Business Entity

 

    //iterate through the aoFetchResult collection

    var sResults = "Accounts:\n";

 

    for (var i = 0; i < aoFetchResult.length; i++)

    {

        var beResult = aoFetchResult[i]; //Per ogni Account vado a stampare i due atributi

        sResults += i + ": " + beResult.attributes["accountid"].value + ", " + beResult.attributes["name"].value + "\n"; 

    }

 

    alert(sResults);

}

 

Categoria: CRM 4.0
giovedì, 02 lug 2009 Ore. 12.38
Archivio Posts
Anno 2020

Anno 2018

Anno 2015

Anno 2013

Anno 2011

Anno 2010

Anno 2009

Anno 2008
Statistiche
  • Views Home Page: 13.299
  • Views Posts: 56.001
  • Views Gallerie: 2.837
  • n° Posts: 117
  • n° Commenti: 1
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003