Dynamics CRM Update 1 Series (3): What's in the API-old APIs VS New APIs

Source: Internet
Author: User

Today we look at the changes in the API. In the new system, some frequently used data processing APIs are removed, such as: Setstaterequest, Setbusinessunitrequest, setparentbusinessunitrequest, etc.

Now that we do this type of operation, we don't need to call these APIs separately, we can directly construct the entity object we expect. and push it to the server. The system will install its contents to do the corresponding processing.
As the saying goes, laymen look lively. Insiders look at doorways.

Despite the simple removal of several APIs, the internal architecture of the new system should have undergone massive refactoring.

For our developers. This adjustment is absolutely good news, as we can redesign the system script or the data interface. Greatly reduce the number of interactions with the server, that is, suppose we use this new change to refactor the previous interface program. The performance will be greatly improved.


This article will not discuss all the changes involved in the API, but rather the introduction of several of our daily 80% will use the Api:assignrequest and setstaterequest. The introduction of how they should be used after adjustment, for everyone to play a starting effect.
To take the following code snippet, here we have 2 operations on a customer record: assigning and setting properties. It is also possible to find that all of these operations are implemented at the entity level and do not invoke additional requests.

            //set StateEntity testentity =NULL; Guid userId = Guid.parse ("{7651c7af-8b18-e511-80e0-3863bb2e8c90}"); Guid userId2 = Guid.parse ("{461c2001-c724-4dfe-ba6e-ed2d274784d2}"); Guid Teamid=guid.parse ("{BC2D90A5-F221-E511-80E1-3863BB2E7CD8}"); Guid Parentbuid=guid.parse ("{4FE4929F-F221-E511-80E1-3863BB2E7CD8}"); Guid Buid=guid.parse ("{A4448DF6-F221-E511-80E1-3863BB2E7CD8}"); QueryExpression QUERY4ACC =NewQueryExpression ("Account"); Query4acc.columnset =NewColumnSet (true); Entitycollection accounts = crmsvc_online.retrievemultiple (QUERY4ACC);if(Accounts. Entities.count >0) {testentity = accounts. entities[0]; }//set owner            if(Testentity! =NULL) {testentity["ownerID"] =NewEntityReference ("SystemUser", userId); }//set State            if(Testentity! =NULL) {testentity["Statecode"] =NewOptionsetvalue (1); testentity["StatusCode"] =NewOptionsetvalue (2); } crmsvc_online.update (testentity);

Of course, today the system only reconstructs a few APIs, I believe that with the new, the system will be more convenient development experience for the vast number of developers. The following is an API that already supports entity level invocation. Of course, its API will be discarded: D

    1. Assignrequest–> Entity.owerid
    2. Setstaterequest–>entity.statecode
    3. Setparentsystemuserrequest–>systemuser.parentsystemuserid
    4. Setparentteamrequest–>team.businessunitid
    5. Setparentbusinessunitrequest–>businessunit
    6. Setbusinessequipmentrequest–>equipment.businessunitid
    7. Setbusinesssystemuserrequest–>systemuser.businessunitid

Dynamics CRM Update 1 Series (3): What's in the API-old APIs VS New APIs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.