{"id":27281,"date":"2021-03-11T06:43:52","date_gmt":"2021-03-11T06:43:52","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=27281"},"modified":"2021-09-03T06:07:53","modified_gmt":"2021-09-03T06:07:53","slug":"create-custom-function-using-custom-api-in-dynamics-365-crm","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/03\/create-custom-function-using-custom-api-in-dynamics-365-crm\/","title":{"rendered":"Create Custom Function using Custom API in Dynamics 365 CRM"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>In the <a href=\"https:\/\/www.inogic.com\/blog\/2021\/03\/work-with-the-all-available-parameters-type-in-the-custom-api\/\" target=\"_blank\" rel=\"noopener noreferrer\">last blog<\/a>, we saw how we could execute all available data types in Custom API. In this blog, we will be creating Custom Function using Custom API.<\/p>\n<p>Let\u2019s create a custom API similarly to retrieve multiple as we have in Dynamics 365. However, we will extend the limit of 5000 records per request to 20000 per request.<\/p>\n<p>We will be passing a table name and columns as parameters to Custom API and our Custom API should send back the response with the data based on the same.<\/p>\n<p>Let us go with the code first approach for this Custom API.<\/p>\n<p>We have written an Assembly shown below that has three input parameters and two Output Parameters.<\/p>\n<p><strong>Input Parameters:<\/strong><\/p>\n<p>\u2022 Table Name (Entity)<br \/>\n\u2022 Columns Name (Field)<br \/>\n\u2022 Cookie (This is the paging cooking, in case there are more than 20000 records and the Custom API needs to be called a second time to get the other 20000 records).<\/p>\n<p><strong>Output Parameters:<\/strong><\/p>\n<p>\u2022 Values<br \/>\n\u2022 Cookie (Paging Cooking that needs to be passed to the next request)<\/p>\n<p><strong>Create Assembly:<\/strong><\/p>\n<p>public void Execute(IServiceProvider serviceProvider)<br \/>\n{<br \/>\ntry<br \/>\n{ \/\/ tracing object<br \/>\nITracingService tracing = (ITracingService)serviceProvider.GetService(typeof(ITracingService));<br \/>\n\/\/ ExecutionContext object<br \/>\nIPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));<br \/>\n\/\/ object Organization service factory object<br \/>\nIOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));<br \/>\n\/\/ object organization object<br \/>\nIOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);<br \/>\nstring cookie = context.InputParameters.Contains(&#8220;cookie&#8221;) ? Convert.ToString(context.InputParameters[&#8220;cookie&#8221;]) : string.Empty;<br \/>\nbool moreRecords = false;<br \/>\nint pageNumber = !string.IsNullOrEmpty(cookie) ? Convert.ToInt32(cookie.Substring(cookie.IndexOf(&#8220;page=&#8221;) + 6, 1)) : 1;<br \/>\nif (pageNumber &gt; 1)<br \/>\nmoreRecords = true;<br \/>\nEntityCollection eCollection = new EntityCollection();<br \/>\ntracing.Trace($&#8221;Before Request&#8221;);<br \/>\n\/\/check the key is present<br \/>\nif (context.InputParameters.Contains(&#8220;table&#8221;))<br \/>\n{<br \/>\n\/*We get the 5000 max record per request using OOB way,<br \/>\n* For making to 20000 records max we will be executing OOB request to max for time *\/<br \/>\nfor (int i = 0; i &lt; 4; i++)<br \/>\n{<br \/>\ntracing.Trace($&#8221;Loop number {i}&#8221;);<br \/>\n\/\/Create queryexpression query<br \/>\nvar query = new QueryExpression(Convert.ToString(context.InputParameters[&#8220;table&#8221;]));<br \/>\n\/\/define dynamic variable for storing the columns<br \/>\ndynamic columns = context.InputParameters.Contains(&#8220;columns&#8221;) ? Convert.ToString(context.InputParameters[&#8220;columns&#8221;]) : string.Empty;<br \/>\nif (string.IsNullOrEmpty(columns))<br \/>\ncolumns = true;<br \/>\nelse<br \/>\ncolumns = columns.Split(&#8216;,&#8217;);<\/p>\n<p>query.ColumnSet = new ColumnSet(columns);<br \/>\n\/\/If more records are there<br \/>\nif (moreRecords)<br \/>\n{<br \/>\nquery.PageInfo.PagingCookie = cookie;<br \/>\nquery.PageInfo.PageNumber = pageNumber;<br \/>\n}<br \/>\nvar result = service.RetrieveMultiple(query);<br \/>\n\/\/Add the all records in the collection variable<br \/>\neCollection.Entities.AddRange(result.Entities.AsEnumerable());<br \/>\ntracing.Trace($&#8221;data Count {eCollection.Entities.Count}&#8221;);<br \/>\ncookie = result.PagingCookie;<br \/>\nmoreRecords = result.MoreRecords;<br \/>\npageNumber = pageNumber + 1;<br \/>\nif (!moreRecords)<br \/>\nbreak;<\/p>\n<p>}<\/p>\n<p>context.OutputParameters[&#8220;values&#8221;] = eCollection;<br \/>\ncontext.OutputParameters[&#8220;cookie&#8221;] = cookie;<br \/>\ntracing.Trace($&#8221;Cookie {cookie}&#8221;);<br \/>\ntracing.Trace($&#8221;After OutPut Parameter set&#8221;);<br \/>\n}<\/p>\n<p>}<br \/>\ncatch (Exception ex)<br \/>\n{<\/p>\n<p>throw new InvalidPluginExecutionException(ex.InnerException != null &amp;&amp; ex.InnerException.Message != null ? ex.InnerException.Message : ex.Message);<br \/>\n}<\/p>\n<p>}<\/p>\n<p><strong>Now create the Custom API record as below:<\/strong><\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27247\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"838\" height=\"641\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg 838w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x229.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-Create-Custom-Function-using-Custom-API-in-Dynamics-365-768x587.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x505.jpeg 660w\" sizes=\"(max-width: 838px) 100vw, 838px\" \/><\/a><\/p>\n<p><strong>As mentioned above, create three Input parameters:<\/strong><\/p>\n<p><strong>1) Table Name:<\/strong> A required parameter to be passed to Custom API for retrieving entity-specific data.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/2-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27248\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/2-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"762\" height=\"601\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/2-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg 762w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/2-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x237.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/2-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x521.jpeg 660w\" sizes=\"(max-width: 762px) 100vw, 762px\" \/><\/a><\/p>\n<p><strong>2) Columns:<\/strong> An optional parameter, which will define the columns to be retrieved by our request.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27249\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"835\" height=\"587\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg 835w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x211.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-Create-Custom-Function-using-Custom-API-in-Dynamics-365-768x540.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x464.jpeg 660w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-Create-Custom-Function-using-Custom-API-in-Dynamics-365-200x140.jpeg 200w\" sizes=\"(max-width: 835px) 100vw, 835px\" \/><\/a><\/p>\n<p><strong>3) Cookie:<\/strong> Paging Cookie, in case we have more than 20000 and for getting data in a sequence after every request.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/4-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27250\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/4-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"733\" height=\"584\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/4-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg 733w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/4-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x239.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/4-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x526.jpeg 660w\" sizes=\"(max-width: 733px) 100vw, 733px\" \/><\/a><\/p>\n<p><strong>Output Parameters:<\/strong><\/p>\n<p><strong>1) Values: <\/strong>Since this Custom API can be used to retrieve data of any table, we have deliberately left the Logical Entity Name blank, which means that Entity Collection can be of any table.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/5-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27251\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/5-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"720\" height=\"562\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/5-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg 720w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/5-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x234.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/5-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x515.jpeg 660w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><strong>2) Cookie: <\/strong>Paging Cookie that needs to be passed along the next request for the same table.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/6-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27252\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/6-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"783\" height=\"579\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/6-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg 783w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/6-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x222.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/6-Create-Custom-Function-using-Custom-API-in-Dynamics-365-768x568.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/6-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x488.jpeg 660w\" sizes=\"(max-width: 783px) 100vw, 783px\" \/><\/a><\/p>\n<p>We have completed with the configuration part. Now we can execute our Custom API.<\/p>\n<p>Move to a browser and execute the custom function as shown below.<\/p>\n<p>custom_retrievetabledata is our Custom API table, columns and cookie are our parameters, amongst them table is our required parameters.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/7-Create-Custom-Function-using-Custom-API-in-Dynamics-365.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27255\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/7-Create-Custom-Function-using-Custom-API-in-Dynamics-365.png\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"962\" height=\"500\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/7-Create-Custom-Function-using-Custom-API-in-Dynamics-365.png 962w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/7-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x156.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/7-Create-Custom-Function-using-Custom-API-in-Dynamics-365-768x399.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/7-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x343.png 660w\" sizes=\"(max-width: 962px) 100vw, 962px\" \/><\/a><\/p>\n<p>For passing parameters as QueryString, you can create aliases for the parameters and then execute it as below.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/8-Create-Custom-Function-using-Custom-API-in-Dynamics-365.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27256\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/8-Create-Custom-Function-using-Custom-API-in-Dynamics-365.png\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"1167\" height=\"399\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/8-Create-Custom-Function-using-Custom-API-in-Dynamics-365.png 1167w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/8-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x103.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/8-Create-Custom-Function-using-Custom-API-in-Dynamics-365-768x263.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/8-Create-Custom-Function-using-Custom-API-in-Dynamics-365-1024x350.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/8-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x226.png 660w\" sizes=\"(max-width: 1167px) 100vw, 1167px\" \/><\/a><\/p>\n<p>First, we need to create parameter aliases, which shall reference the parameter, and using that aliases we can pass the parameters as QueryString. Please note for creating parameter aliases we need to use the \u2018@\u2019 keyword else, it will give us an error. You can read more about it from <a href=\"https:\/\/www.odata.org\/documentation\/odata-version-3-0\/url-conventions\/#:~:text=A%20URL%20used%20by%20an,meaning%20to%20such%20additional%20constructs.\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p>Execute it using Fetch API.<\/p>\n<p>await (await fetch(&#8220;\/api\/data\/v9.2\/custom_retrievetabledata(table=&#8217;account&#8217;,columns=&#8217;name,telephone1&#8242;)&#8221;)).json()<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/9-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27253\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/9-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"1064\" height=\"199\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/9-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg 1064w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/9-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x56.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/9-Create-Custom-Function-using-Custom-API-in-Dynamics-365-768x144.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/9-Create-Custom-Function-using-Custom-API-in-Dynamics-365-1024x192.jpeg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/9-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x123.jpeg 660w\" sizes=\"(max-width: 1064px) 100vw, 1064px\" \/><\/a><\/p>\n<p>Execute using Xrm.WebApi.online.execute function.<br \/>\nvar getTableData= async function(tableName){<br \/>\nvar Request = {};<br \/>\n\/**<br \/>\n* Request to Get All Relationship Count<br \/>\n* @param {String} EntityName &#8211; Entity Logical Name.<br \/>\n*\/<br \/>\nRequest = function(table) {<br \/>\nthis.table = table;<br \/>\n};<\/p>\n<p>\/\/ NOTE: The getMetadata property should be attached to the function prototype instead of the<br \/>\n\/\/ function object itself.<br \/>\nRequest.prototype.getMetadata = function () {<br \/>\nreturn {<br \/>\nboundParameter: null,<br \/>\nparameterTypes: {<br \/>\n&#8220;table&#8221;: {<br \/>\n&#8220;typeName&#8221;: &#8220;Edm.String&#8221;,<br \/>\n&#8220;structuralProperty&#8221;: 1 \/\/ Primitive Type<br \/>\n}<br \/>\n},<br \/>\noperationType: 1, \/\/ This is an action. Use &#8216;1&#8217; for functions and &#8216;2&#8217; for CRUD<br \/>\noperationName: &#8220;custom_retrievetabledata&#8221;,<br \/>\n};<br \/>\n};<\/p>\n<p>\/\/ Construct a request object from the metadata<br \/>\nvar req = new Request(tableName);<br \/>\nresult = await Xrm.WebApi.online.execute(req);<br \/>\nreturn await result.json();<br \/>\n}<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/10-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27254\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/10-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg\" alt=\"Create Custom Function using Custom API in Dynamics 365\" width=\"994\" height=\"632\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/10-Create-Custom-Function-using-Custom-API-in-Dynamics-365.jpeg 994w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/10-Create-Custom-Function-using-Custom-API-in-Dynamics-365-300x191.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/10-Create-Custom-Function-using-Custom-API-in-Dynamics-365-768x488.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/10-Create-Custom-Function-using-Custom-API-in-Dynamics-365-660x420.jpeg 660w\" sizes=\"(max-width: 994px) 100vw, 994px\" \/><\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>This way we can create and execute the function type Custom API.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/click-2-clone-microsoft-dynamics-crm-records\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-27245 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/c2c-1.jpg\" alt=\"\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/c2c-1.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/c2c-1-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/c2c-1-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/c2c-1-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In the last blog, we saw how we could execute all available data types in Custom API. In this blog, we will be creating Custom Function using Custom API. Let\u2019s create a custom API similarly to retrieve multiple as we have in Dynamics 365. However, we will extend the limit of 5000 records per\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/03\/create-custom-function-using-custom-api-in-dynamics-365-crm\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,19],"tags":[2201,2169,545,592],"class_list":["post-27281","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-crm","tag-create-custom-function","tag-custom-api","tag-dynamics-365-crm","tag-dynamics-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/27281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=27281"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/27281\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=27281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=27281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=27281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}