{"id":111,"date":"2008-11-04T04:51:41","date_gmt":"2008-11-04T10:51:41","guid":{"rendered":"http:\/\/www.teamdesk.net\/blog\/2008\/11\/api-breaking-change\/"},"modified":"2008-11-04T04:51:41","modified_gmt":"2008-11-04T10:51:41","slug":"api-breaking-change","status":"publish","type":"post","link":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/","title":{"rendered":"API breaking change"},"content":{"rendered":"<p>As a part of the preparation to enrolling new calculation feature, we&#39;ve made breaking change in the <a href=\"http:\/\/www.teamdesk.net\">TeamDesk<\/a> API.<\/p>\n<p>Before, passing NULL as the column value to the Create() function was the sign to API to use default column value.<\/p>\n<p>As now we need to distinguish between column&#39;s NULL and column&#39;s default, passing NULL now means NULL value, while omiting the column from the XML uses default value.<\/p>\n<p>Following scenario is affected by the change:<\/p>\n<p><code><\/p>\n<pre style=\"FONT-SIZE: 10pt\"><span style=\"COLOR: #008000\">\/\/\/ Get empty DataTable with all columns<\/span>\nDataTable dt = ToDataTable(api.Query(&quot;SELECT TOP 0 * FROM [Contacts]&quot;));\nDataRow dr = dt.NewRow();\ndr[&quot;First Name&quot;] = &quot;John&quot;;\ndr[&quot;Last Name&quot;] = &quot;Doe&quot;;\ndt.Rows.Add(dr);\napi.Create(&quot;Contacts&quot;, FromDataTable(dt));<\/pre>\n<p><\/code><\/p>\n<p>In old API version the new row will be initialized with default value during the Create() call. In a new version, Create() call will fail with a &quot;Cannot insert empty value into column &quot;Id&quot; message.<\/p>\n<p>To overcome the problem, request the columns you plan to pass the values for. The easiest way to do it is to rewrite the code to get empty data table via Retrieve() call:<\/p>\n<p><code><\/p>\n<pre style=\"FONT-SIZE: 10pt\">string[] columnList = new string[] { &quot;First Name&quot;, &quot;Last Name&quot; };\n<span style=\"COLOR: #008000\">\/\/\/ Get empty DataTable with selected columns<\/span>\nDataTable dt = ToDataTable(api.<span style=\"COLOR: #0080ff\">Retrieve<\/span>(&quot;Contacts&quot;, columnList, new int[] {0});\nDataRow dr = dt.NewRow();\ndr[&quot;First Name&quot;] = &quot;John&quot;;\ndr[&quot;Last Name&quot;] = &quot;Doe&quot;;\ndt.Rows.Add(dr);\napi.Create(&quot;Contacts&quot;, FromDataTable(dt));<\/pre>\n<p><\/code><\/p>\n<p>Please update your code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a part of the preparation to enrolling new calculation feature, we&#39;ve made breaking change in the TeamDesk API. Before, passing NULL as the column value to the Create() function was the sign to API to use default column value. As now we need to distinguish between column&#39;s NULL and column&#39;s default, passing NULL now [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[6,13,36],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-whats-new","tag-api","tag-soap","tag-teamdesk"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>API breaking change - TeamDesk Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"API breaking change - TeamDesk Blog\" \/>\n<meta property=\"og:description\" content=\"As a part of the preparation to enrolling new calculation feature, we&#039;ve made breaking change in the TeamDesk API. Before, passing NULL as the column value to the Create() function was the sign to API to use default column value. As now we need to distinguish between column&#039;s NULL and column&#039;s default, passing NULL now [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/\" \/>\n<meta property=\"og:site_name\" content=\"TeamDesk Blog\" \/>\n<meta property=\"article:published_time\" content=\"2008-11-04T10:51:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2024\/01\/logo_og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kirill Bondar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirill Bondar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/api-breaking-change\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/api-breaking-change\\\/\"},\"author\":{\"name\":\"Kirill Bondar\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#\\\/schema\\\/person\\\/22c4c05bd657513c8b00122fa364c8d2\"},\"headline\":\"API breaking change\",\"datePublished\":\"2008-11-04T10:51:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/api-breaking-change\\\/\"},\"wordCount\":156,\"commentCount\":0,\"keywords\":[\"API\",\"SOAP\",\"TeamDesk\"],\"articleSection\":[\"What's New\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/api-breaking-change\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/api-breaking-change\\\/\",\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/api-breaking-change\\\/\",\"name\":\"API breaking change - TeamDesk Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#website\"},\"datePublished\":\"2008-11-04T10:51:41+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#\\\/schema\\\/person\\\/22c4c05bd657513c8b00122fa364c8d2\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/api-breaking-change\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/api-breaking-change\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/api-breaking-change\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API breaking change\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/\",\"name\":\"TeamDesk Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#\\\/schema\\\/person\\\/22c4c05bd657513c8b00122fa364c8d2\",\"name\":\"Kirill Bondar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g\",\"caption\":\"Kirill Bondar\"},\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/author\\\/kirill-bondar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"API breaking change - TeamDesk Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/","og_locale":"en_US","og_type":"article","og_title":"API breaking change - TeamDesk Blog","og_description":"As a part of the preparation to enrolling new calculation feature, we&#39;ve made breaking change in the TeamDesk API. Before, passing NULL as the column value to the Create() function was the sign to API to use default column value. As now we need to distinguish between column&#39;s NULL and column&#39;s default, passing NULL now [&hellip;]","og_url":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/","og_site_name":"TeamDesk Blog","article_published_time":"2008-11-04T10:51:41+00:00","og_image":[{"width":600,"height":315,"url":"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2024\/01\/logo_og.png","type":"image\/png"}],"author":"Kirill Bondar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirill Bondar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/#article","isPartOf":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/"},"author":{"name":"Kirill Bondar","@id":"https:\/\/www.teamdesk.net\/blog\/#\/schema\/person\/22c4c05bd657513c8b00122fa364c8d2"},"headline":"API breaking change","datePublished":"2008-11-04T10:51:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/"},"wordCount":156,"commentCount":0,"keywords":["API","SOAP","TeamDesk"],"articleSection":["What's New"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/","url":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/","name":"API breaking change - TeamDesk Blog","isPartOf":{"@id":"https:\/\/www.teamdesk.net\/blog\/#website"},"datePublished":"2008-11-04T10:51:41+00:00","author":{"@id":"https:\/\/www.teamdesk.net\/blog\/#\/schema\/person\/22c4c05bd657513c8b00122fa364c8d2"},"breadcrumb":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/api-breaking-change\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.teamdesk.net\/blog\/"},{"@type":"ListItem","position":2,"name":"API breaking change"}]},{"@type":"WebSite","@id":"https:\/\/www.teamdesk.net\/blog\/#website","url":"https:\/\/www.teamdesk.net\/blog\/","name":"TeamDesk Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.teamdesk.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.teamdesk.net\/blog\/#\/schema\/person\/22c4c05bd657513c8b00122fa364c8d2","name":"Kirill Bondar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g","caption":"Kirill Bondar"},"url":"https:\/\/www.teamdesk.net\/blog\/author\/kirill-bondar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":1,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":506,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts\/111\/revisions\/506"}],"wp:attachment":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}