Extending PowerApps and the Common Data Service for Apps with custom controls and server side
![Extending PowerApps and the Common Data Service for Apps with custom controls and server side Extending PowerApps and the Common Data Service for Apps with custom controls and server side](/pic/extending_powerapps_and_the_common_data_service_for_apps_with_custom_controls_and_server_side/MUJPcUxoREF0a0k_.jpeg)
It's, awesome whoa, hello. So. Hello. Guys my, name is Matt Barber I'm a principal architect, on the, what. Is the business applications, the consumer, applications, platform, team, the xrm, framework, the, c.d.s. Platform, the, power apps thing, that. You guys have been hearing about all week I am one of three architects, who work on that team my, responsibilities. On the team primarily deal with the developer experiences, the infrastructure experiences, stuff you see and interact. With my. Peers tend to work on the infrastructure so if it doesn't perform well it's their problem. It. Is kind of how things are evolving but that's okay. So. Thanks for coming to my session, it. Is the. End of built. And I. Imagine, that most of you have been sitting in sessions that have been bombarded with PowerPoint, for the most part, show. Of hands PowerPoint to death and so I have 12 slides that's it and that. Includes the slide, you're looking at the, heading the tail and the QA slide so there's really only five or six slides of content we're going to be spending a whole lot of time in the product in visual studio in. Postmen. And a bunch of other things so if you're afraid of that. There's. The door if, you're not afraid of it awesome. Well, okay crank, through this so. By. Show of hands who here is coming from the CRM world. Okay. All. Right who's coming from the, non CRM, world so not business applications, but, non serum, a couple. Of folks okay. What. I'm gonna try to do with this presentation, and this this walkthrough is present, to you, the. Non. CRM. Centric. Way. Of looking at this I, will, be in the client but. Briefly. Everything. I'm going to really drive through is focused. Around API, and extensibility, and the, use of this outside. Of the, traditional business application, space okay. Now. With, that said who by show of hands is confused, about this thing called power ups, what is it what's it do, okay. Couple of folks raised a hand so as, we've. Been doing a couple of times I'm gonna go back through and recap it from. The overall platform architecture I'm, gonna touch on it and we'll work through that okay, so first and foremost what. We're going to cover as I said is is really just kind of an overview of the overall components, we're, gonna talk a bit about how, it fits together and that's something that we. Use the term power apps as a very, overloaded. Term as of, now as. Of. Four. Weeks ago we're. Using it as a very, overloaded. Term power. Apps traditionally. Meant that drag, and drop designed, service projects Ciena that that evolution, does that make sense it, doesn't mean that anymore it's. Part of it that doesn't mean just that, I. Want. To touch on all the tools and capabilities you. Have what. Is actually, what this thing actually gives you what does it bring to you what can you do with it and. Realistically. Start, working, through some, use case examples, of. Doing. Something semi, real with the application, and work through now I'm going to caution you guys straight away and I'll caution you again. When. I actually step into the app and start working, with api's I'm working with live data from the world, so. It's, not pre-filtered, it's not pre-cleaned, so you might see something that could be offensive it's not my fault I try to avoid it but, I'm working with real api's. Okay. Because. I find that it works much better when I can show you operational. Working code that you can go home or go to go to your hotel tonight if your resident. Actually play with it and then, catch us and. Talk to us so let's first talk about the business application platform. So, the business application platform. Is now organized. Into. Two main. Functional, areas the, power apps area. Power-ups, platform, power, platform.
There's Four or five different names for it and the. Power. Bi, space. Now what do these actually mean, at the end of the day when, we think about what power apps and power bi, work. Down to they, work down to two halves of the problem, that we have in most applications. Most business applications, areas first. Off the concept, of having a. Transactional. Data store the. Ability to interact, in a relational, sense with. Data and. Have. Business process, or flow or workflow, or logic apps or some sort of code. Execution. Process occurring, and, then the other side of the house which is all about analytics, what happened why did it happen what's, the trending analysis. Where. Is this going to go these. Are more. Competitive, concepts. Than you might imagine if you if you optimize, them by show of hands who works in like a fortune 5,000, plus Enterprise who's. Got like lots of data okay. So, if, you try to optimize your infrastructure, for transactional. Power apps your. Analytics. Side suffers, if. You try to optimize for analytics, and you're, dealing with aggregation. Your. Transactional. Capabilities suffer. You, end up writing just tons and tons of code of trying to figure out how to mess this together building. Cubes in your production system your performance, problems all sorts of crazy, how, do I know that because we tried it. The. Dynamic, CRM product, tried, to do that we, put reporting, in we, started adding cubes, we started adding all sorts of creative stuff behind the scenes and it. Got, performance. Wise I got a little clunky. We, still do that but not so much anymore we've started relying on power bi to do a lot of that but from a platform point, of view from a business applications. Platform point of view we, are separating, those concerns, okay. Now. That, doesn't mean that they're totally isolated, you'll. Notice that on either side we have the term common, data service either for analytics. Or, for. Applications. The. Common data service, is the runtime. Engine of that infrastructure, each. Side now. They talk together, through. The concept, of a common, data model and. Connectors. A. Common. Data model defines, the, common objects, that, you're going to interact with now let me pause, there the common data model slash objects, from, the the, legacy. Power apps world encompassed. A group of. 150. To 200 entities ish okay, most. Of them were drawn either from the CRM side of the house of the ERP side of the house and blended together. The. Common, data service. And the common data model as shipped, at this very moment has. Realistically. Ten. Operational. Entities, account. Contact, so we've. Retracted. Back to the core because we were seeing people build, apps that didn't necessarily have, anything to do with the. Objects we were providing, now at the same time we want to be able to provide those, components, we want to be able to provide a sales, application, infrastructure. If you, want to use it we want to be able to provide a, service. Management, or an order processing, infrastructure, if you want to manage it so we've taken the common data model and now compartmentalized. It, there is the core platform that it ships with with a very restricted, set of entities and then, the ability to extend, and augment and add PACs, on top, of it okay. Data. Connectors, are how we're integrating, these services, together things. That are described, in the common data model are. Integrated. For you or will be integrated. For you right now so, much but, it's coming as we're. Putting this together, all. Of this of course is built, out. Serving. As the underpinnings, for Dynamics, 365, several. Different office products are now starting to rely on us you've, seen the demos of SharePoint who's, been through a SharePoint demo where they click they go create a form button and it popped open what they call the power app, okay. Who's. Been into the power. Apps demos, where they've gone off and built something that's sitting on top of CRM data there's been a couple of those ok, you've, seen connector, demos where. You have connectors, integrating, that data interactive, AK. And forth connectors. Are part of the. Data, connection infrastructure. They're relied upon by the integration. Services, they're relied upon by the surfaces. The, UI surfaces. They're. Relied upon by other elements, of our platform, the. Canvas, app concept which used, to be known when people would say power apps what. We now call that as a canvas app. That's the mental thing what is it it is a pixel-perfect, you, build it it's a WYSIWYG development, it doesn't refactor, it doesn't reform you, want that pixel to be in the upper left-hand corner in purple it's going to be in the upper left-hand, corner and purple forever. Okay. It, is an app authoring. Environment. That. Environment, canvas, app specifically, is being added, to many different Microsoft. Properties, to, serve as a means to do form, form, design and form development, again, under, the covers of course it's connecting to his data sources through the connector, architecture.
So. All of those connectors, and whatnot that we've talked about it natively, can. Connect to the c.d.s infrastructure. Which. Brings through the whole API infrastructure, that we're about to talk about. Now. When. We further think about how this is put together this. Sits on top of our Azure infrastructure, it. Didn't use two parts, of it did parts of it didn't it. Now, sits entirely, on our Azure infrastructure, so again by show of hands for folks that are in CRM who is on CRM. Online or, Dynamics. 365, online for customer engagement, field service project service, marketing. Sales. By. Show of hands, okay. You. Know big big name so our marketing team loves big names. If. You are using our version 9 version. Of the product you are on this infrastructure. We. Have put you on that infrastructure, and we've. Done it in a transparent fashion. How, did we do it it's, built, on this, infrastructure, is built on the same underpinnings. Of the, dynamics business with. The addition, of the power apps business the, connectors. Flow. And. Many. Other our Azure artifacts, that are now part of the, business applications, team why. Did we bring them together that way because, we've had these assets, being independently. Developed for a number of years and are. Now decided, we've now kind of gotten together and said this is our business applications, platform we can bring. This all together make, it simple to build. To integrate with and develop upon ok, now. That, decision, was. Executed. In November. Of last year, in. January. We, opened, the private preview of the, accommodative, service for apps, by. Excuse. Me late January by. March. We, were, opening, it up for general consumption and it's GA now you have it now okay. We're very very rapidly, bringing, this together but, we're, doing it in a. Weekly. Weekly. Release cadence, so, when, you go home and play with it tonight, it's. Not all one big unit just yet it's not all one unified, experience yet it will get there and it. Will get there relatively, quickly okay. So. Let's. Move on from, a vision point of view whenever. You do something like this you have to start thinking about what, it is you're trying to solve what's the problem, you're trying to solve and realistically. The problem we're trying to solve here is to provide the application. Platform. For. Customers. Who are novices. All the. Way through your enterprise dev with your enterprise requirements, your high security, requirements, your, complex, governed, processes. Okay and we're, trying to do that while leveraging, the assets and capabilities of the Azure platform, as. Part of this without. Having. To throw it in your face. Okay. And that's kind of one of the key points that we're trying to do here we're, not saying you've got to go buy an Azure subscription you've, got a bite by Part A Part B Part C Part D integrate. Them together figure, out how to deploy them all as one and package. To deploy that we're trying to bring that together into one experience, you're building a business application, it happens, to use functions. It happens, to use logic apps it, happens, to use flow and we. Deploy, it as a unit okay. You manage, it as a unit, that's. The direction that this platform is going now, one, of the slides that we. Use relatively. Quickly as talking about the various, components. Of the way we deal with applications. So the concept, of a packaged, application, dynamics. 365. Customer, engagement, for sales is a, packaged, application. Talent. Onboarding, is an application, project. Services is an. Application, who. Here has used either project, service or field service, anyone. Okay, so what is project service fields their project service is a project management application, really to target it to the service industry if you think about that field. Service, is the, your, cable company, they. Need to do a service order dispatch send a tech out they have scheduling, they have requirements, neither. Of those applications, actually has components that are shipped on our server, they're. Entirely, delivered. As, application. Packages, that are deployed on demand, on to. The server infrastructure, okay. That is the way it is right now today you guys can do that too for. Your customers, and your applications, to that level of complexity, where. You're operating, a SAS business, on top of our platform okay. So. Let's. Move in to actually talk about the guts of this thing now. When. We talk about what, you have access to you can distill, all of this away down. Into this concept, when. You're talking about CDs and CDs specifically. Here. CD. S exposes. A Web API, the. Web API is the gateway to everything, else by show of hands who saw Ryan Ryan's, presentation, this morning the. Overview a bunch of you excellent, Ryan's, team is primarily, responsible for, everything that's in the purple there in the middle, okay.
It's, A lot of work it's. Kind of crazy as far as the the feature, set and capabilities, that, go into that but at, the end of the day the entire system. Boils, down to an architecture, that looks like this what. We provide is, a Web API that. Allows you to implement, code, run in a serverless fashion. Within. The, concept, of a transaction, or outside, of a transaction it allows you to model, your own API and, execute. That in a transaction or outside of a transaction this, is exposed, to, all. Of our design services, today. We have four. Design. Surfaces, we have canvas, apps which. You've seen a lot of we. Have model, apps which, those of you from the xrm world think of. We have unified, service desk, we. Have mole, okay. And you. Can invent your own if you'd, like because we make that API fully. Available and publicly, documented it has been that way for quite a while, but. We use, our own API to. Run our own infrastructure, the. Design surfaces, the development, surfaces, are all run through this API infrastructure, which means you have the ability to access and, create. What we call plugins, others. Call functions. Right. In the execution, pipeline for any given object you're, not restricted, to the concept of the thing called an accounts or the thing called a contact, if you want to invent your own object, your own storage object you can do that if, you want to invent your own standalone, storage object you can do that we. Manage the data as here you. Don't know how we do it we manage the data tier but we provide you backup. We provide you restore we've relied you restore points, we, provide. You the ability to move. Data move, between tenets our services. Tenant based which. Means that your tenant, has, an instance, of this. But. It can also have many, instances of this classified. At different different, tiers so, the concept of a sandbox, a production, instance a trial, set of trial instances, there, will be other instance, types in the near future that support, they have different behavior, patterns, within. The environment. In. The case of Microsoft, we use this extensively, we have over 700, instances. In our tenant now. Why do we have different instances, because we have, isolation. Between. Businesses, we have isolation. Between divisions, and groups that are managed not, only just, by, URI. Or application, but also physical, isolation, which. Then we allow for shared services to interact between them this, allows you to provide to your customer, or your. Own development area the, ability, to provide, the necessary level, of security and control as required. By your business, we're. Globally available and we also exist in several different restricted. Environments, US government environment Germany, a few other places again. The. Route capabilities. Around, this feature set are more, targeted at that upper end that enterprise governance. Concept. Whereas. The novice. Part, of the facilities, are more geared, towards the concept we'd had something like this called a default. Instance, or an available, instance that's available to all office customers so. When, you go through and customize a SharePoint, page, let's say you have a SharePoint, you. You don't know anything about power apps at all there's a button at the top of the screen that says customize. You. Click the customize link in the background, what's happening, is we, are creating an instance, and environment, for you, stamping. Out one of these and we're putting in the. Hosting, component for canvas which means this is immediately available to you take advantage of so let's start talking about what we can do with that so. This. Is where we start shifting over into more. And more demos, I am. Happy, to take QA through a lot of this but I'm going to kind. Of crank through some of this if, you can't see it there in the back shout out and I'll zoom in to show you specific, areas so. We're going to touch on a couple of different things entities, business rules metadata API and, the Web API so.
Let's. Step into that. All. Right. And. We're. Gonna have duplicates. All. Right really. Go away. All right so. The. First thing we're going to deal with is we're. Going to talk about is the. Met the entity, constructs. So. What I'm looking at here actually. We'll start with creating an environment so. What I'm looking at here is the admin, power apps comm, site. These are several, of the instances, that I have available in, my, world in. This. Case I have. A tenant. That has, both dynamics, 365. Various. Applications, and course. EDS, instances, as well as. Downlevel, versions, of the, platform so, I have a two eight. One eight, o and so, on and so forth the, older, versions don't show we, only start reporting a reflecting, for, version nine going forward so if you have a version nine. Dynamics. CRM instance, you, go to admin, power ops comm you can do that now and you will, see your, instances, reflect through here. This. Experience, is one, of the admin experiences, we actually have three, right now we. Are moving to one and we. Will move to one over, time if, you're interested in seeing what that one looks like the URL URL, is, admin. Admin. Dot dynamics, comm and that. Is the place to start and that, will build out over. Time we're not singing it to the Prazeres right now because all you can do right now is open a service request and. Jump into the. Dynamics, admin Center but, soon, soon. So. In this case I have an instance that I've created and I can see the environment type who created it I can manage security, I can jump into the dynamics administration, center I can move in and manage security, for that instance should I choose to do so if, I wanted to create a new instance I can. Come over here to environment, I can, call this one food test and. I'm. Gonna use a trial I'm gonna create that environment well don't have capacity. For that but let's create a production one so. I'm going to create an environment and at.
This Point I've created the container, so I have the ability at this very moment to host the dynamics, excuse, me to host canvas, apps flows can. Ders gateways, all of that fun stuff I'm a now create the database now. Creating, the database is the thing that actually stamps, c.d.s into your instance so. If I go down here to currency I'm going to choose. That. I'm gonna choose English, I'm, gonna create my database I click. The button and, it. Will begin the process of creating, the. Instance in the background now I created. It through this vehicle, through admin dot power apps comm which means I got the base CD, s deployment, I just have the few entities that I was talking about okay now, if. I were to. Step. Into. Let's. Just go into this, one real quick oh not. This one let's, go into this one real quick just so I don't have to type the link in and click. The go to the dynamics admin Center I, will. See. Food. Test being, provisioned. So. Your, instances, customers, who create instances, in your tenants, will see them appear here, okay. So your Dynamics, admin is going to see this we've. Added some nice filtering, features that allow you to cut, and slice down this a little bit so you don't have to see them all but. They will see them appear, now. The other way I can create an instance is. Through. PowerShell. So. In this case hoop by show of hands is familiar with the admin API. Administration. API so we have an administration, API. For. Those of you that didn't. Raise your hands the administration, API is the API, way that you do the tasks that I just did through, the UI so, let's, say that you're trying to do a build process and, as part of your build process you need to go create an instance stand. The instance up deploy, your code to it run your test battery throw, your instance away, okay. Pretty, practical sequence. Events so, what, we do is, we. Have created a. I've. Got a little PowerShell script here that kind of runs, through, some of these but. In this case I'm going to start with the service version here, run. That piece of code and that's. Going to go out and it's going to connect into our administer, in this case I'm logged into North America and my tenant, and I can see that my tenant has three versions of the product avail now, of course 9o is the. Only one that's actually applicable, to. C.d.s so we're going to focus in on that. Now. I have a command, here. Where. I'm going to tell it to go create a new instance in. This case I'm telling it to create a new instance as as. Base, language English, with. A domain, native of build test that's the admin user on setting it up with I'm choosing. The nine-oh service, version and I'm, creating, it as a sandbox, with, you with, the US dollar as its primary instance, now you notice I use the command validate, only, validate. Only allows me to run a test to determine whether or not I'm going to be successful, when I create this instance so.
Now I'm gonna go execute, that. Running. That same command this time without the validate, only causes. The system to create the instance now, if, there. Is a template, available, for the end some placeholder available, for the instance it should turn around relatively. Quickly give it 15, seconds 20 seconds it should come back with an instance created, one. Will wait through that process while that's going on this. Method is the way in which if you're building a, script. Or you're building a deployment script, or you're building any sort of Cir, ALM aspects, this. Is how you manage your instances, you've now spun up an instance in this case it's finished the instance is available, and ready to use and, in. Fact, if I come back over to my. Environment. Here. And. It hasn't refreshed yet but if i refresh it by hand I should actually see, build. Tests show. Up right inside that environment, okay, so, that's created. Build test inside the environment, it's, ready and it's, ready to be used okay. I can, choose to delete it at this point run my test battery and get rid of it okay. Cycle, in cycle out, very very quickly now. I'm. Going to shift gears and come over to the web power, apps calm experience, the. Web power, apps calm experience, is our, authoring. And development, environment. Those. Of you from the crm world know the solution explorer you know the form. Editor, you, know that we haven't touched those things since 2011, for the most part okay. That, is all changing, all. Of that is now coalescing. Being redesigned, and rebuilt in. Light, of a lot of what was done from a pioneering, point of view in the power app space into. This, experience, which. Is the web power, apps not calm portal or the maker portal, is the other way this is referred to now within. The maker portal, there are two modes there's a canvas, mode and a model, mode I am, in I'm in model, mode right now quick. Way to know if you're in canvas mode if you. Go into canvas mode panels. Are all dark in model. Mode they're all light. Okay. Nice. Visual, cue so you know which piece you're working with now. In. This, case in. My. Environment. Which, is CVG, 12 is, the environment I'm going to work with I have a set of entities that I'm gonna, work with now I've already created a couple of entities in here I'm just going to narrow it down to custom in this. Case a, thing, called outfit, and member I'll explain what they are here, in a, couple of minutes but, in this scenario.
What. We're going to do is we're gonna create a new entity. Now. Before I create, the new entity I'm. Going to come over to postman. I'm. Going, to, get. My. Instance. Connection, and. I. Am going to ask the system for metadata. On. A particular. Object so. In this case that be outfit, and. Through. The Web API I have. Retrieved, all the metadata for this particular entity so. In this case this is returning the entity definition. That. Is that allows the system to reflect that now this is used in. This. UI. Whenever. I actually when I went in here and actually did this. What. I'm actually seeing, is the output from the query that I just ran, okay. So you're, building an azure application, you're on a web app you're building out your web application, you need to stamp out an entity you need to build the entity on the fly all of, that is available to do through. The API, okay. And in, this case I'm gonna now create a new entity just to give you a kind of a, a construct. Of how this happens and a lot of technology, stacks when you create a new object you have to go recompile, the server you, have to recompile, a bunch of other things to get it to work. So in this case I'm going to create something called. Foo, test. That. B food test we're gonna click Next, I'm. Gonna create a new, field. Food. Test one I'm. Gonna make this text. Done. That's we're gonna create another new field we're gonna call this food test -. Nope. Not foot food test, -. And. We're gonna create this as a, whole, number now we're gonna done those two but, I'm going to save the entity now. One of the optimizations. Those of you that are are. Been. With us for CRM one. Of the optimizations, we've done here as you can see is we now allow you to queue up all your changes to an entity and click Save. Much. Faster the entities been created, the objects built out if, I now go and look.
At Food tests and click the advanced button which is going to take me to the old, solution, Explorer experience, and I, go look at food tests here food. Testing Z exists, just like it did in the CRM world with all of its features and options so. You want to make this word. Mail merge enabled, all of those features still exist they're not exposed to the new portal yet but. It's also gone and built out all the forms that it needs it's built out all the views that it needs to serve the main application. All the, fields, it needs are bill town security, is built out security. Ackles. Have been created, all of that has been done for you in that save operation, so, whether or not you choose to use it through the UI or not is not material, it's, all there now for you to take advantage of from. A from a security management point of view now. Coming back over, to my, postman, collection, if I come here and I go to this. Test. I smelled, that correctly send. System. Is gonna go quite ask that question and now I have live, metadata, for. The object that I just created, no recompile, no republish, no. Setup the, entity is there, everything. Is there and ready for you to use okay. So, you're. Going to think about this from the point of view of the, traditional. Website development you need to go get MongoDB, you got to go get my, sequel you got to go get doc, DB you've got to define your schema you got to establish your schema you've got to run your build scripts there. This. Is there for you you, have a Web API available. To you immediately applying security, r8 we even have auditing by the way auditing, activity logging access, logging read auditing all, of that is now available just, because you created the entity under, this infrastructure. And. It's there and ready for you to use okay. So. We've created an entity and we've created it within our infrastructure. Now. Next, thing we want to deal with is a business rule now. One of the things that we give you the ability to do within, our world is, manipulate. Business, rules what. Is a business, rule business. Rules take various, forms and, in, our world and let me move, this to custom and. They. Can be manifested. A couple, of different ways so. If I drill into in this case the outfit view. Business. Rules can exist, as an artifact, of the. Entity. They can also be part of an overarching, business, process, so, who here is attended a session owned by floo. Everybody's. Seen flow right. Slowest. Part is actually owns the business rules system, going for it as well. As the overarching, concept, you'll see some of those constructs, appear so, in this case what I'm going to do is I'm going to go into this and. I'm, going to create a new business rule now, it's a day we, haven't built a totally. New designer for the business rule system so you're showing you're seeing the one from the old xrm, system but. In this case what. I want to do in my condition, is. I want to create a condition, do. You. That's. Going to let me Hello properties, there you go so. In this case I want, to say that if the. Outfit. Tag, has. Data. Contains. Data. Okay. So, if it contains, data I. Want. To set a field value and. In. This case I want to set the primary, name, value. Okay, oh yeah. And I need to change choose the value. That's. Fine we'll just leave it blank okay, so. What, I've created a business rule to do this I can validate it I can change my scope to be entity all forms, information. Business. Rules can be applied to, functionally. Two tiers of our system either, at the entity layer or. They. Can be applied at the. UI. Layer and the, UI layer only, okay. What does that mean it means that if I apply it at the entity layer, it's available to the guests ek if I were to call now create, entity, that, be outfit, pass in the outfit tag this, business rule will fire.
Okay. If. I. Scoped, it to a form, all forms. Or the information form then, this business rule would only fire if somebody were to using using, one of the UI's of. The. C.d.s platform okay. So you have that control to. Make those decisions back and forth between them, so. I'm gonna skip. This here, and close, that out that's. A business rule done. That. We've. Talked a little bit about the metadata API in the fact that I've shown you the, metadata API a couple of times the, metadata API that, we have allows, you to query for not only entity, definition, but it also allows you to ask for message, definition. So. All entities. Automatically. Get your primary, crud, create. Update delete operations. Many. Additionally. Get the, concept, of associate. Disassociate. What. Does that mean it means create, a reference or referral to they. Get additional, messages. Put in on top of them you can create your own messages, that. Affect them and the. Metadata API can be used to interrogate, the, infrastructure, at runtime and result. That data back to you so let's say you create a custom message, to, go create something, in the infrastructure, that can be understood. And referred to inside. This experience so. Let's. Take a look at what that look, like. Make. Sure I'm touching, on all the right points there just a moment. There. We go. Actually. Let's let's hold that because I actually want to I'm, gonna get on a tangent if I go into that and I'm gonna save that for the next section now. Within. The metadata, API as, you can see from the URI up here we're dealing with an instance root in this case I'm addressing a particular instance, API, and data and then the version of that instance, this. Is our. Web API this, is the primary API, that we advocate for external. Applications. Integrating, with our system ok, the, API is versioned, 9.0. Is the shipping version it follows. The release platform, version we. Change the API based. On version numbers, so. We support, backward, compatibility, if you were to address the 8 X, 8.1. 8.2, 8.8. I. You. Will get a reduced, message, set, compliant. With that if we changed, how we result, that would change based on the version so, again we're providing standard. Versioning, constructs, here this, is a very list I mean you see this in Azure you see this everywhere this is the standard versioning construct, for and how to integrate with our system, through. Our Web API we can do lots, of interesting stuff we can query various. Entities various, types, I can, I can read data I can write data I can do all sorts of things through. The web API we. Support get post, patch, elite, all, through. The web API we also support, batch operations, through our web api so. Again, from, a development, point of view you can build your own site that, talks directly down to remai p.i that. Interacts, with it so. Let's build, on a little bit whenever. We're working with the web api or. Working. With the. Business. Role system, we. Invariably, trigger, what, we refer to as our plugin system. The. Plugin system is the ability for you to write code. In. A server list fashion you don't have to stand a server up you don't have to deal with it very much like a function, you don't stand any of that up now is it functions, right, now no it's, our it's a legacy infrastructure, in the future yes, but. Would we expose, the functions aspect, to you, maybe. Some element of it but. We're not going to look at you and say go stand up an as your website here's. The whole stack, of functions as you need to build and then, plug it in we're, going to provide you the ability for you to register the, component, that you need through the system and then run it for, you as part, of the operation, okay we, are not going to preclude, you from doing, that though if you. Really want to go build all that stuff out for whatever reason, you, can do that what, are the reasons the, reasons typically. Deal with performance and runs you. Have limits that we place on the system as far as how how much how, big how long so. On and so forth okay and we're doing that from a democratization, of resources, construct, if you need to do something specialized. That's high intensity, takes a long time lots, of CPU, you. Probably want to run that on your own system or you're gonna get throttled it'll.
Be Slower on, us okay. But we're not gonna prevent, you from doing that now, our plug-in pipeline, has a series, of events this. Is how our extensibility, system, fundamentally, works, we, have both our OData, or web api and our. Soap api that feed, through what we refer to as an api service. Interesting. Little tidbit, our. Service. Our API our soap API and, our Web API and our. OData. Two api all, talk. To the same api interface layer, under. The covers everything is an interface that we call I or grimaced. Okay. Why, do we do it this way it allows us to support, new, technologies, and new standards without. Fundamentally. Having to recoat, our infrastructure, to. Support it and allows us to nominal, eyes this. And support. Upgrade, so. As it stands today a customer who can upgrade. Successfully. Upgrade from our 2011, product. 2011. To. Our 2018, product, to our night out product, they can go straight through for an upgrade and it will work. Assuming. They stayed within the supported, boundaries, of our API, okay. Yeah. Yeah yeah nod, your head yeah yeah who does that in the, case of this sis, though we prevents you from going off the rails in the. Case of our clients, yes you can go off the rails because, we support JavaScript, in our clients. But. Plugins, straight. Through it's going to work on the other end okay, now. How, does our plugins work those, marks, that are in blue are the places that you the developer, can hook your logic into so. A pre validation, handler you can affect that a pre, operation, handler you're in the transaction, now you. Can affect that which means if you ring up from the pre operation, Handler and go make a bunch of other changes, in. The pipeline and fault. You. Could roll the whole thing back okay. You have the same capability, in the post operation, handler you've done your primary, commit your in the transaction. You're going to go do other work. Decide. That there's a problem you roll the whole thing back okay. And then, we have the what we refer to as the async, handlers, async. Handlers, are situations. Where we execute. Your code at some, point after the. Post operation, okay. Notice. I use the term some, point after which. Means your, code runs or your operation, runs you get put in the queue and then, the queue is picked picks you up okay. On the next processing, cycle if you get into high load scenarios, this, is where you see things slowed down a bit now. On the other hand the, async operation, lets you do these things passively. In the background, everything. Above. The. Async handlers, is actually, done in the, UI flow, in the API flow, so. If you've built a front-end website you've written a plug-in on the pre operation, handler your, code is going to run as part of the update, which. Means if you've got a user sitting at the other end of that page there. Waiting. Okay. Very very important you understand, that that is a performance, penalty you need to think about that code from an optimization, point of view same. With anything post, operation, honestly, the way that that I tend to guide partners.
And ISVs is that if there isn't a good reason to put it in the pre-operational post operation, or Valladares put it in an async job okay. Yet. Get. It out of the pipe there's a lot of good reason to put it there. And it's primarily validation. If. You're. Doing validation. Then, that's a great place to be again. Sometimes you got to do validation post operation, and fault it based on the triggering. Downstream, now plugins, trigger plugins. What. Does it mean let's, say you come through you do your pre operation, you do your database operation, the database operation, doesn't update and, in your post operation, you call another entity, that has a plug-in, this. Whole process, starts again, for. That entity in context. And so, on and so forth down through your execution, chain okay. Inside. Your plugin you know what, level you're at how deep in the execution, pipe you are we. Make that available to you we, actually do have thresholds, if, you hit the, bottom of the pipe in our world which is I believe five five. Levels deep is. It seven. Now yeah that's. Been a dial a couple of times so you, hit you hit the end of the pipe we abort the transaction we, immediately throw the ax port and, you roll back up and the. Reason we do that is we think you've gone run away okay. We think you've written a loop. Okay. So, let's actually dig into that and play with that, so. Let's go build some. And. This. Duplicate. There, we go. All. Right so. Let's go build, some plugins so. The, example, I was starting to give you was. The concept of a. Custom. Operation, a custom message and it being able to be called through. The API okay. So, let's start with that so in this scenario what. I'm going to do is I'm going to build a. Plugin. That. Is. The backing, for, a. That. Is the backing for a, custom. SDK, message, that I'm going to create. Okay. Now, in this case I'm using a tool to do this you can do this there's several different tools on the market we have one. We. Have a pretty, rich partner ecosystem around, this this space, so. In this case what I'm going to do is I'm going to create what's called an action, an. Action. Is a custom API command, now, I have, got my little message set up here so I want to. Make. Sure that, I'm calling, it correctly, there. We go build my build. My SDK, is the message I decided to use. Alright. So. When. You create a custom action you can address it against an entity remember, I said you can create your, own custom. Objects, your. Own custom, commands, on the top of any if I scroll, down here I'll find food tests in that list but in this case I'm creating, an unbound. SDK. Message what, does that mean, it means that I'm creating an sdk message, that, isn't connected, to any particular, entity. Okay. There's. No particular entity, that it's directly, tied to so. What, am I gonna do I, can. See that I have my build SDK message here I'm gonna. Jump back over to this experience and. I'm. Gonna refresh this UI, and. Underneath. My process. Area I, have. My build SDK, and. I'm gonna create some parameters, now why isn't that in the dev experience, it's, a great question it'll.
Get There it's a little clunky the. Way it works right now so web, UI. For the win so. In this case I'm going to create a property, called actually. I'm just going to create, an output out, o one, okay. And it's, going to output a text. In. This case a text, and it's for the output, I'm, going to add that, okay. So, I've now defined, an output parameter for, my custom SDK message. That's. All I've done. Save. And close that I'm. Going to activate that message. It. Doesn't do anything just yet okay. So, if I were to now call. This. Here, click. Send it's, gonna say it's not found let, me. Refresh. My up sorry didn't publish it need to publish it real quick. There. We go, let. Me publish that message. And. Once. It's published. When, it gets there. Hey. Refresh, my instance. Token. Build. My SDK, is what I called it. Build. My SDK. And. It, should access it and, come back with it doesn't do anything and, should just come back empty oh yeah. Then. I configure it as an inbound parameter I thought I pushed the opt-out hold on just a second do you activate it I. Like. That. Thinks. That there's an inbound parameter, on my message yes there's actually validation, there and. I. Did, set, that as an output parameter so, why is it complaining. Well. Either way we'll, do this for now activate, that, yep. Click that. All. Right so it's reactivated, I'm gonna come back over to this experience. I'm. Then going to right. Click on this and. I'm. Gonna create a plugin, for, my operation, so. When. I create a plugin for my operation, what it does is it it essentially, gives me the ability to hook custom. Code right. Into that particular operation. So in this case I'm going to wire this up on the post operation, aspect, of it I'm going to register a new step and that's. Going to go create a class, for me, to. Work with there, we go or. I can start coding up my. Plugin, so. In this case I, can. Start coding right into my execution, context, and give. Me the ability to write code in response, to, my plugin so if I go in here and go local context dot I. Have, access to the organization, service I have access to the execution, context, if I look at the execution context. I can have input parameters, how do I put input. Parameters, on that message they're going to appear here, okay. Which allows me now to pick the input parameters, off do, processing, and then I can put the output on. The. Output, parameters, which. Are going to appear. Did. You to do. Output. Parameters, appear. There. Okay. And. Again it's a collection so, you can add in the objects that you want that can include a whole object, you can pass back an entity with. Data in it and then, process and execute, that code again, that, then can be addressed in your custom API in the, case of our certification by show of hands who knows what app sources. Okay. Our certification. System for app source is built, on this infrastructure, and our. Certification. System and our provisioning, infrastructure, talked to this system through this method, we. Actually didn't, build any super secret sauce to. Make that work, we're. Using standard. S2s authentication for, to communicate, and interact with and I need to call that out we actually fully support service, server identity. And authentication as well, as certificate based authentication. As, well as, application. Key based, authentication for, service to service accounts, so. Again, you're building a portal an app whatever you, can communicate directly to us okay. Starting to run short on time so I'm gonna speed, things up here a little bit, okay. Now. One. Of the things I wanted to highlight as I, went through this this operation, with you guys, was. Building. Out more. Complex, or interesting, business applications.
That. Work within this environment so what I've done I've set, some of this up ahead of time because. I never have enough time to actually do this in like a 75 minute session from scratch but, I built this actually, this morning. Sitting. In Brian's. Session is where I built most of this, so. What. I have done here is I've, created a, thing, called a, new. Instance it's a c.d.s instance, only it. Has got two. Entities in it outfit, and member the, scenario, that I have here is I am a gamer I. Love. Games one of the games I play excessively. Is a game called planetside. Which. Is global. Global. Conflict, three. Factions fighting it out you. Have, you have faction excuse me you have outfits. Guilds. Okay. For those of you from the fantasy world and guilds. Have membership, members. Have ranks, members, have levels, the, faction. Our outfits, have factions, a bunch of other things so, as a g-wiz. Why not I, plugged. In CTS, into, their API and, I. Plug that in to demonstrate. How to communicate. Between. C.d.s, and an external API and very. Much like some of the demos that you guys have seen where we've put as many Microsoft services into something as we can to. Get something done I took that approach. But. I I grind. My teeth when I see those demos so I only did two things okay. I used. Logic, I use three I'll use three logic, apps service bus functions. CTS, itself so of course CTS is the focus okay. Now, I'm gonna go, through and show you this from the point of view of the application point, of view but, I'm not going to demonstrate this, through the app I'm actually gonna do it through the API as far as invoking and getting it do things so. What, I did is I went through and I created, a thing called outfit and member and then, I created an application. There. Is a relationship, between outfit, and member. Here. If I click on a relationship called outfit, Association. So, it allows me to relate a outfit. To its membership okay. I built, a UI around, that so if I come under apps and I. Look at my outfit, apps and I choose to edit that I go, into the UI editor for model applications, I can actually do this as a canvas app - I just, chose to do it this way because, it accesses, some of the really interesting editors. And. Here. I created. A sitemap with just the pieces on it I created. A form for, my outfit so if I click on information that, brings me into my UI design, surface again. Not, really important, but we do have a design surface that, allows you to model out a UI. Here's. My outfit tag my primary name my faction URI all of that's there and in. My membership. My. Membership forms even simpler it has the name the battle rank. Certificate, the, class. Name and. Then some hidden data the, census URI and some imagery data okay. One. Of the things that we had on the title was custom controls. It's. Interesting, enough. To see a number but. A graphical. Representation that numbers a lot more interesting, so, in this particular game there's a level cap as with many games so I know what that level cap is and I, was able to use a control. Here. On battle rank. Where. I can, now manifest. In this case the radial knob control, the, minimum the maximum the. Rank and then. The value, in now, in this case this control was built we ship this control it's. Something available but. It uses our control, framework for our you is now, something important to understand, our control framework works for our UIs okay. It doesn't work for asp.net. It. Only works for our model applications, today and then the future will work both for, model and canvas, apps in, the future it manifests, on our mobile clients and a couple of other places from.
A Capabilities. And feature set point of view you can think of it like a SaaS, km asex. Control in SharePoint you're building a web control you. Can think of it like that except. It uses a set of standard, interfaces and standard, events to, interact and work in and out of this space, why. Because. We want to maintain, upgradability. We. Want you to be able to build a control drop a control into a form use, it inside your application and, still, let us patch, the infrastructure. So. It is a contracts, based interface, as we move forward that's something that in, our UX, and. Look at you guys you, gotta live with it because. We support upgradability, it's more important to the customers in our and our understanding to be able to move smoothly from version one to version two to version 3 to version 4 and not. Have to have the, developer, the ISV the partner come in and reach resell. The same solution, and the, upgrade every time makes, sense so. You'll see that philosophy, in our experience, in this case i'm used to thing called a radial knob control. Now. I've. Also created a view. And in. This case my view has primary. Name and alpha tag modified. On some. Faction, URI data and there's also some imagery into it it's a drag-and-drop experience. If I want to put something else on to it I could, say let's add member. Count. Okay. And as, you can see it's also got data in it it. Reads data live it takes the snapshot, of the top row or the top couple of rows and actually renders them into the UI so you can see how that data is gonna look as you're. Building out your UI. Okay. So, I'm going to go ahead and save that and save, and close that and. Actually. Go back and do it because I forgot to publish it, that's. Fine save and close will. Come here and will issue the public command from there okay. So. The. Next thing we need to do is we need to wire this up, with. With. An upstream application, that's going to actually do the data retrieval in the, case of the data retrieval what I chose to do and I. Could have used a I, could have used if I couldn't, in this case couldn't have used a flow because we don't support service bus interface through flow yet I. Could, have used create record to do it but, in this case I chose to use a service bus interface, why. Because, service bus is a loosely coupled infrastructure, I can, throw something under the bus if one end of the system is down or the other that's fine it'll, get picked up it's, guaranteed delivery in that regard so, in this case I choose to chose to create a service bus my, service bus has two queues. In. This. Case one of my queues. Is. An. Older, demo that I have and I have a new queue called, PS. Build example, queue now. In my, queue. If. I drill into it of course I have created an access policy, for my queue because. Nobody ever uses the, give. God writes to the queue and gives, it as a connection string to anybody right nobody. Ever does that you'll, always create an access policy, that limits access to only the things you need so. In this case I have a connection string that I've created and. What. I want to do is. Anytime, I create, a new. Outfit. Record I want. To send that outfit record to this queue and. I'm. Gonna have something on the other end of this queue pick it up okay. So first task I need to go create a queue, I need to go create, something. That sends it to this queue so, I have a tool called the plugin registration, tool. The. Plugin registration, tool is a legacy. CRM. Component, that. Allows us to manipulate and, register. Service. Related components, within our system we, have the ability to deal with web hooks service. Endpoints, which include, both queues relays, event, hubs and. A couple of other things in that capability. So. In this case I'm going to create a new service endpoint I'm going to take the connection string that I just picked up paste. That in click Next and I'm. Gonna leave it going as binary I actually have the ability to change it to JSON or an, example if I choose to do so JSON. Or XML if, I choose to do so in this case I'm going to leave it as binary because the object, on the receiving end expects, binary. It. Picked, up all the pieces of data that I need I'm gonna click Save so. I've now registered, the service endpoint in the system now, I'm. Gonna. Tell it. That. I only care. About. Create. Of. Outfit. Now. Notice that it's pre-populated. All my Matt bees Matt bees is the publisher, that I'm working under so, I've created things I have a message it. Auto populated, the messages I started typing see. Again. We're using the, metadata. API to. Talk to the system to pre populate, these fields they're not coded in every. Entity object can have its own sets. Of features so in this case it's. Operation. I'm gonna set it as post operation, asynchronous. Because I don't want to be in the execution. Pipeline I'm gonna register that step and I've now created something.
That When I submit. A, request. To, the, when. I create a new record, in the outfit table it's, going to ship it off to the service bus endpoint that I've identified here. And that's. Live and ready to go right now now. I've, built, a logic, app on the, other end, that. Is catching that. Okay. Now, what this logic app is doing is, it caches the request and then. It starts, authoring, a URI. Takes. Advantage of some of the new features to initialize. Some variables and, it. Parses, that URI the, response, from that you are which is a JSON object into. A membership, list from. The membership list it, then works through the outlet picks, up a bunch of data about the outfit then. Iterates, through its membership and starts. Up dating back data back into the infrastructure, okay. On the, fly. So. Let's actually see it work. So. We're going to come back over here we're, going to go into our app we're going to invoke our app because. We can just refresh the app view and see the changes in the app so. I add one there already. Now. I'm gonna come over here and I'm gonna go here and I'm gonna create an outfit and I'm going to use ooo. And. Send. That. Now. In this case I just issued a post request. To. Create, a new record in this case, I'm calling. Matt B I'm using, a matte B outfits I'm using post post, as create and I'm. Passing in the one thing that I need, okay. That. Starts. The whole thing in motion I can actually turn right back around and retrieve that so, in this case I'm just going to send get, outfits and I. Can see here. That. Let's. See there. Is the outfit, that I just entered the. Primary name is still null it hasn't been picked up yet. Refresh, it again let's just grab this ID so we can look at this ID directly. That's. That, ID right there. Copy. That, and we're gonna do this. Okay. It's, popped it again so, as you can see here I'm now pulling data back on that particular ID, directly. I'm not having to go search around or run around to get. I'm. Not having to come on work with me or anyone. Postman, does this there. We go and. Run. That again, and. It, should have picked that data up by now so let's go back over and look at the application. Refresh. The view there, it is in the view hasn't. Picked it up yet did I deactivate, that workflow, do. To do to do over. Here. It's. Running right now it, just picked it up. So. Let's go back here real quick do a refresh here, there. It is recursions. Been picked up let's come back over here run that we. Can see there's our data right there it's been picked up membership. Counts been picked up loaded, in it's all real, time running in the UI if, I come back over here and then drill into this I, should. Actually start seeing data show up here. Okay. Again, live data sorry, if anybody gets offended this is literally. I'm streaming this off a game server okay. So, it's. Loading up that data right now and it's doing it asynchronously. So if I come back over here now and I, do. Let's. See let's. Delete that and do, it again. So. I'm gonna delete it which is a cascading, delete I, configured. The relationship. To be a cascading, delete I didn't have to go write the sub delete code. Okay. So. I'm gonna I'll prove it to you I'm. Gonna click in here I'm gonna, delete this I. Come. Over here this is the members no members. Cascading. Delete I configured. That I did, not coat that. Okay. I and, if anybody's, interested I'll show you right where that's configured. So. Once, again I'm gonna rerun that test. We're. Gonna go create that outfit again there we go, same. Request again this time actually let's do this. Let's. Create a. Different. One and. In. This. Case let's change. To. Add a preferred, return, representation. Header because. Right now it wasn't giving me anything back I'd have to require you for the data that it created right.
Let's. Not do that so we're gonna create another one in this. Case by adding the header for return representation. I get, the record back so, just what it created it hands it back to me you can see the time took 92 milliseconds, to create a record, okay. Very, very very, very fast in this, regard now. Both. Of these are being processed so, in, this case I have to get rid of this because of course the idea is now different. And. Let's. Take a look so it's already populated, recursion, back in and. It. Has. Not got no it got the second one already - okay. So. That's, all there if I come back over here and refresh this view I can. See that data is being populated into, the system, okay. I can, do this in code too so in this case I've been doing it through postmen now, I'm gonna come over here and actually do this, using. A program. So. In this case what I'm going to do is I. Have a program that's going to connect to that I'm going to pull the service client off I'm, gonna ask it, for. I'm doing, a web request I'm asking, over the web api for, the outfit so I'm pulling the first one off and asking for the outfit name I'm gonna put that in a UI then I'm going to create the murk outfit. Okay. So. I'm gonna do that I'm gonna run this is an f5 the CRM service client by the way is something that's part of our SDK we make that fully available to anybody who wants it I'm. Just going to ahead you yes the, UI you're seeing right now is actually a separate component, it's called the logging control it's something that we use for sam'l based applications. You. Guys are welcome to it again it's in our API but. You don't need it to actually do this so we're going to step over that so, we've made that web request. Walk. Through this. Got. Our outfit name right there recursion, hit, f5 or f10, step, over that that's gonna pop a UI up yep. And now. We're gonna go do a create. Boom. Okay. So, if I come back over to my UI again, go back to my outfits. I've. Created it now okay. Our API, is actually tremendously. Faster, than our client, UI's okay. Why. Because, we're not having a load and render the client you like, the. Client UI it has on its own also a programmability, interface, which is not available in, the web api okay and those are but that API is entirely, concerned with the UI in the case of the UCI interface, which I'm showing you here it is a typescript.
Related. System, so, in this case I'm gonna go and look at this. We're. Gonna jump, into, this. And. Here. We have our custom controls showing us how far along we are to. Getting. To the end of the road from. A in, this case battle rank point of view okay. So. What I'm showing you here is the ability to integrate. Within in this case a third-party service, to. Integrate to experience, that now what. Does that actually look like, if. I. Actually. Pull. This out this, is the actual, query. That's being run. It. Is, a. Rest. Request that's. Being run in this case to a service, operated by daybreak, that, is returning, a bunch of data in JSON format that, we're in turn parsing, interacting, with and working with from, a performance point of view it's pretty quick you're, seeing it react pretty quickly so now let's make some changes. One. Of the things I want to do here oh one. Of the things I want to do here is I want to add the. Leader. Right. On top I want to add the leader right here so I don't have to go dig through to figure out who the leader of the group is because I need to go contact the leader so it add them so. First thing I'm going to do is I'm gonna come up here and I'm gonna flush out everything. Here, delete. And, that's, gone often again, API is fast all. Those records are gone okay, now. We're going to go through and create. The. New piece, of data that we need so. Going into entities, in this case what I need to do is I need to create a second. Relationship, between outfit, and member because. My, current relationship relates. All my membership to my outfit now I need one guy as, the. Leader, so. I'm going to come into relationships, I'm going. To create a new relationship, I'm gonna. Add a many to one and, in. This case I'm adding a member. To. My outfit we're gonna call it member. We're. Gonna call it leader. And. We're. Gonna done, that, now. Save that and now we, are creating a new relationship. Between the two now. In this UI you didn't, see the options, to manage the relationship behaviors. Cascade. So on and so forth I'll show you where those are. If. I come back over now to my solutions, view. Refresh. My solutions, view go. Into my entities and in this case expand, outfit go into relationships, and. One. I. Will. Find my, relationship. Right here if. I expand, that relationship, these are all the actual options that you have with that relationship so. Down at the bottom it's currently, set up as referential but, it could be set up as configurable, cascading, delete or configurable. And you can choose the various behaviors, that. Are available to your relationship, so again, available. To you straight through the API you set this up your data models done off you, go again. So, we've done that now we're gonna go put that guy put that piece on the UI go, back to our app go. Into our outfit go, in an edit just we're. Gonna go down to our form I'm. Gonna open up our form, we're. Gonna come in here and we're gonna add our leader, column, right, there, okay. So I'm putting it on the UI so I can see it it's. The only reason I'm doing that, publish. That. Save. And close so. Even close, so we've now added i
2018-07-18 13:56
this presentation is worth gold. thats a tremendous amount of integration possibilities. very much thank you