Trying to GET data from creatio using API
Can someone help please, I have been through as much documentation as I can find and nothing is helping.
I feel something is missing from our site.
Background
We installed Creatio Cloud earlier this year, through a partner Webrixs and we have set up the site ourselves.
I want to use Power BI to call data from Creatio to use in other areas for analysis.
I can not authorise through Power Bi, getting "Method Not Allowed. (Method Not Allowed)"
Authorised through PostMan however, I am having difficulties defining the ENDPOINTS.
Can someone advise please?
Like
Hello Nicola,
Endpoints can be found directly in the source code of the service you are calling (basically it should be some method). For example in the source code below:
namespace Terrasoft.Configuration.UsrCustomNamespace { using System; using System.ServiceModel; using System.ServiceModel.Web; using System.ServiceModel.Activation; using Terrasoft.Core; using Terrasoft.Web.Common; using Terrasoft.Core.Entities; [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] public class UsrCustomConfigurationService: BaseService { // Method returning contact identifier by name. [OperationContract] [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string GetContactIdByName(string Name) { // Default result. var result = ""; // The EntitySchemaQuery instance, addressing the Contact database table. var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "Contact"); // Adding columns to query. var colId = esq.AddColumn("Id"); var colName = esq.AddColumn("Name"); // Filtering query data. var esqFilter = esq.CreateFilterWithParameters(FilterComparisonType.Equal, "Name", Name); esq.Filters.Add(esqFilter); // Receiving query results. var entities = esq.GetEntityCollection(UserConnection); // If the data are received. if (entities.Count > 0) { // Return the "Id" column value of the first record of the query result. result = entities[0].GetColumnValue(colId.Name).ToString(); // You can also use the below variant: // result = entities[0].GetTypedColumnValue<string>(colId.Name); } // Return result. return result; } } }
GetContactIdByName is an endpoint for the UsrCustomConfigurationService service which allows recieveing the
Name parameter value in it.
Please review the source code of your web-services so to find out endpoints of these services.
Best regards,
Oscar
Oscar Dylan,
Thank you for responding to my query.
I have reviewed our source code, however, there is no service name for what I need.
This may sound odd, or I may be looking at it wrong?
namespace Terrasoft.Configuration { using DataContract = Terrasoft.Nui.ServiceModel.DataContract; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data; using System.Drawing; using System.Globalization; using System.IO; using System.Linq; using Terrasoft.Common; using Terrasoft.Common.Json; using Terrasoft.Configuration; using Terrasoft.Core; using Terrasoft.Core.Configuration; using Terrasoft.Core.DB; using Terrasoft.Core.DcmProcess; using Terrasoft.Core.Entities; using Terrasoft.Core.Factories; using Terrasoft.Core.Process; using Terrasoft.Core.Process.Configuration; using Terrasoft.GlobalSearch.Indexing; using Terrasoft.UI.WebControls.Controls; using Terrasoft.UI.WebControls.Utilities.Json.Converters; #region Class: #SchemaNameMacros#Schema
Nicola Wall,
You seems to look at the base Terrasoft.Configuration source code because a custom web-service should have some name in the Terrasoft.Configuration namespace (like Terrasoft.Configuration.UsrCustomNamespace). Also the code should contain more rows in it since you have an opening { symbol, but there is no } symbol to close the namespace declaration.
Best regards,
Oscar
Oscar Dylan,
Thank you Oscar, the code is longer, please see below. I just took the top snippet.
I'm trying to get specific information from the Account.
I need the UsrCompanyURL
As a Test, I tried Terrasoft.Configuration.UsrCustomNamespace, but that gives me a '400 Bad Request'
{{BaseURI}}/0/ServiceModel/EntityDataService.svc/UsrCustomNamespace/GetContactIdByName=6089
This is an actual name I am requesting
namespace Terrasoft.Configuration { using DataContract = Terrasoft.Nui.ServiceModel.DataContract; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data; using System.Drawing; using System.Globalization; using System.IO; using System.Linq; using Terrasoft.Common; using Terrasoft.Common.Json; using Terrasoft.Configuration; using Terrasoft.Core; using Terrasoft.Core.Configuration; using Terrasoft.Core.DB; using Terrasoft.Core.DcmProcess; using Terrasoft.Core.Entities; using Terrasoft.Core.Factories; using Terrasoft.Core.Process; using Terrasoft.Core.Process.Configuration; using Terrasoft.GlobalSearch.Indexing; using Terrasoft.UI.WebControls.Controls; using Terrasoft.UI.WebControls.Utilities.Json.Converters; #region Class: #SchemaNameMacros#Schema /// <exclude/> public class #SchemaNameMacros#Schema : Terrasoft.Configuration.#ParentSchemaNameMacros#Schema { #region Constructors: Public public #SchemaNameMacros#Schema(EntitySchemaManager entitySchemaManager) : base(entitySchemaManager) { } public #SchemaNameMacros#Schema(#SchemaNameMacros#Schema source, bool isShallowClone) : base(source, isShallowClone) { } public #SchemaNameMacros#Schema(#SchemaNameMacros#Schema source) : base(source) { } #endregion #region Methods: Private private EntitySchemaIndex CreateIAccountAlternativeNameIndex() { EntitySchemaIndex index = new EntitySchemaIndex() { IsAutoName = false, IsClustered = false, IsUnique = false }; index.UId = new Guid("ebe37f22-d03b-4ff5-85ab-b19cfd41de7b"); index.Name = "IAccountAlternativeName"; index.CreatedInSchemaUId = new Guid("b9b0db9a-65de-4b97-aece-47ffe851884b"); index.ModifiedInSchemaUId = new Guid("b9b0db9a-65de-4b97-aece-47ffe851884b"); index.CreatedInPackageId = new Guid("b6327e89-1dee-4b6f-a695-226c016beae1"); EntitySchemaIndexColumn alternativeNameIndexColumn = new EntitySchemaIndexColumn() { UId = new Guid("58081ad2-6e01-4b09-8a7f-d6e550fd4d71"), ColumnUId = new Guid("e36ae687-347d-4bf7-b260-90129862e357"), CreatedInSchemaUId = new Guid("b9b0db9a-65de-4b97-aece-47ffe851884b"), ModifiedInSchemaUId = new Guid("b9b0db9a-65de-4b97-aece-47ffe851884b"), CreatedInPackageId = new Guid("b6327e89-1dee-4b6f-a695-226c016beae1"), OrderDirection = OrderDirectionStrict.Ascending }; index.Columns.Add(alternativeNameIndexColumn); return index; } #endregion #region Methods: Protected protected override void InitializeProperties() { base.InitializeProperties(); RealUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); Name = "#SchemaNameMacros#"; ParentSchemaUId = new Guid("25d7c1ab-1de0-4501-b402-02e0e5a72d6e"); ExtendParent = true; CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a"); IsDBView = false; UseDenyRecordRights = false; UseRecordDeactivation = false; } protected override void InitializeColumns() { base.InitializeColumns(); if (Columns.FindByUId(new Guid("a7e02dfb-cba5-410e-8fa4-9adfc0e3c01a")) == null) { Columns.Add(CreateUsrLicenceStructureColumn()); } if (Columns.FindByUId(new Guid("3b8ecd2d-6cee-4651-8611-2d4b806fd4b4")) == null) { Columns.Add(CreateUsrNumberOfProjectsColumn()); } if (Columns.FindByUId(new Guid("27c4101c-6096-4fff-a635-6fc2464e0336")) == null) { Columns.Add(CreateUsrCompanyURLColumn()); } if (Columns.FindByUId(new Guid("ad7c5fad-7f95-4f38-8955-f0888b07284b")) == null) { Columns.Add(CreateUsrAccountCurrencyColumn()); } if (Columns.FindByUId(new Guid("53dca450-d360-4d49-a3c9-8644fdc8555d")) == null) { Columns.Add(CreateUsrVATNumberColumn()); } if (Columns.FindByUId(new Guid("be8b74db-7fd8-44ef-8245-1923ca2f75dd")) == null) { Columns.Add(CreateUsrInvoiceEmailAddressColumn()); } if (Columns.FindByUId(new Guid("2d33b423-41ac-4cfa-96dc-82c6be56d2cd")) == null) { Columns.Add(CreateUsrLicenceStartDateColumn()); } if (Columns.FindByUId(new Guid("50ae14b4-d6bf-46b4-97f6-c0a0ca788a46")) == null) { Columns.Add(CreateUsrLicenceEndDateColumn()); } if (Columns.FindByUId(new Guid("bfcf81d6-2b80-4a74-ae2c-1a224e9a7129")) == null) { Columns.Add(CreateUsrPaymentTermInDaysColumn()); } if (Columns.FindByUId(new Guid("e46b1286-2972-409c-947a-7f49d832399a")) == null) { Columns.Add(CreateUsrOwnerOfficeAccountColumn()); } if (Columns.FindByUId(new Guid("b3edd4e7-49d2-48f7-b136-adda6dfa1705")) == null) { Columns.Add(CreateUsrSpinoffCompanyAccountColumn()); } if (Columns.FindByUId(new Guid("4f9eaf8d-da8a-4119-9e55-0b4e82797c0e")) == null) { Columns.Add(CreateUsrCurrentlicenceValueDecColumn()); } if (Columns.FindByUId(new Guid("99671b76-06f6-4cd3-bb72-e49ec69b02c6")) == null) { Columns.Add(CreateUsrForecastDecColumn()); } if (Columns.FindByUId(new Guid("366ba9b7-81eb-42ac-b432-47faaa5800bd")) == null) { Columns.Add(CreateUsrProjectSetupColumn()); } if (Columns.FindByUId(new Guid("4fed2299-508f-4678-ad87-52445119af33")) == null) { Columns.Add(CreateUsrHasDealsColumn()); } if (Columns.FindByUId(new Guid("7afad3b7-91bf-42ee-af3a-ad5a0c6dd86b")) == null) { Columns.Add(CreateUsrUsingPlatformColumn()); } if (Columns.FindByUId(new Guid("0080f4a1-2d25-4ef4-803a-c4fa94d121c8")) == null) { Columns.Add(CreateUsrCustomerStatusColumn()); } if (Columns.FindByUId(new Guid("87f2364b-4caf-4366-8bca-cc876ea2cc59")) == null) { Columns.Add(CreateUsrNoProjectsinLicenceIntColumn()); } if (Columns.FindByUId(new Guid("d5e5a8de-e5d6-4acd-b501-cbd2713b2d1b")) == null) { Columns.Add(CreateUsrContractTermIntColumn()); } if (Columns.FindByUId(new Guid("02cfcf0e-ccd4-4c41-adc4-6474e1ae4852")) == null) { Columns.Add(CreateUsrAccountNotesColumn()); } } protected override EntitySchemaColumn CreateIdColumn() { EntitySchemaColumn column = base.CreateIdColumn(); column.UsageType = EntitySchemaColumnUsageType.General; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected override EntitySchemaColumn CreateCreatedOnColumn() { EntitySchemaColumn column = base.CreateCreatedOnColumn(); column.UsageType = EntitySchemaColumnUsageType.General; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected override EntitySchemaColumn CreateCreatedByColumn() { EntitySchemaColumn column = base.CreateCreatedByColumn(); column.UsageType = EntitySchemaColumnUsageType.General; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected override EntitySchemaColumn CreateModifiedOnColumn() { EntitySchemaColumn column = base.CreateModifiedOnColumn(); column.UsageType = EntitySchemaColumnUsageType.General; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected override EntitySchemaColumn CreateModifiedByColumn() { EntitySchemaColumn column = base.CreateModifiedByColumn(); column.UsageType = EntitySchemaColumnUsageType.General; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected override EntitySchemaColumn CreateProcessListenersColumn() { EntitySchemaColumn column = base.CreateProcessListenersColumn(); column.UsageType = EntitySchemaColumnUsageType.General; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected override EntitySchemaColumn CreateTypeColumn() { EntitySchemaColumn column = base.CreateTypeColumn(); column.DefValue = new EntitySchemaColumnDef() { Source = EntitySchemaColumnDefSource.Const, ValueSource = @"03a75490-53e6-df11-971b-001d60e938c6" }; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected override EntitySchemaColumn CreateNotesColumn() { EntitySchemaColumn column = base.CreateNotesColumn(); column.UsageType = EntitySchemaColumnUsageType.General; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected override EntitySchemaColumn CreateGPSNColumn() { EntitySchemaColumn column = base.CreateGPSNColumn(); column.UsageType = EntitySchemaColumnUsageType.General; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected override EntitySchemaColumn CreateGPSEColumn() { EntitySchemaColumn column = base.CreateGPSEColumn(); column.UsageType = EntitySchemaColumnUsageType.General; column.ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); return column; } protected virtual EntitySchemaColumn CreateUsrLicenceStructureColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Lookup")) { UId = new Guid("a7e02dfb-cba5-410e-8fa4-9adfc0e3c01a"), Name = @"UsrLicenceStructure", ReferenceSchemaUId = new Guid("11708efa-3c33-4f2a-b6ee-7c9d10c75e4d"), IsValueCloneable = false, IsIndexed = true, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a"), IsSimpleLookup = true }; } protected virtual EntitySchemaColumn CreateUsrNumberOfProjectsColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Text")) { UId = new Guid("3b8ecd2d-6cee-4651-8611-2d4b806fd4b4"), Name = @"UsrNumberOfProjects", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrCompanyURLColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("MediumText")) { UId = new Guid("27c4101c-6096-4fff-a635-6fc2464e0336"), Name = @"UsrCompanyURL", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrAccountCurrencyColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Lookup")) { UId = new Guid("ad7c5fad-7f95-4f38-8955-f0888b07284b"), Name = @"UsrAccountCurrency", ReferenceSchemaUId = new Guid("2d36aca6-5b8c-4122-9648-baf3b7f8256d"), IsValueCloneable = false, IsIndexed = true, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a"), IsSimpleLookup = true }; } protected virtual EntitySchemaColumn CreateUsrVATNumberColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Text")) { UId = new Guid("53dca450-d360-4d49-a3c9-8644fdc8555d"), Name = @"UsrVATNumber", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrInvoiceEmailAddressColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Text")) { UId = new Guid("be8b74db-7fd8-44ef-8245-1923ca2f75dd"), Name = @"UsrInvoiceEmailAddress", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrLicenceStartDateColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Date")) { UId = new Guid("2d33b423-41ac-4cfa-96dc-82c6be56d2cd"), Name = @"UsrLicenceStartDate", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrLicenceEndDateColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Date")) { UId = new Guid("50ae14b4-d6bf-46b4-97f6-c0a0ca788a46"), Name = @"UsrLicenceEndDate", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrPaymentTermInDaysColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Text")) { UId = new Guid("bfcf81d6-2b80-4a74-ae2c-1a224e9a7129"), Name = @"UsrPaymentTermInDays", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrOwnerOfficeAccountColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Lookup")) { UId = new Guid("e46b1286-2972-409c-947a-7f49d832399a"), Name = @"UsrOwnerOfficeAccount", ReferenceSchemaUId = new Guid("25d7c1ab-1de0-4501-b402-02e0e5a72d6e"), IsValueCloneable = false, IsIndexed = true, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a"), IsSimpleLookup = true, DefValue = new EntitySchemaColumnDef() { Source = EntitySchemaColumnDefSource.SystemValue, ValueSource = SystemValueManager.GetInstanceByName(@"CurrentUserAccount") } }; } protected virtual EntitySchemaColumn CreateUsrSpinoffCompanyAccountColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Lookup")) { UId = new Guid("b3edd4e7-49d2-48f7-b136-adda6dfa1705"), Name = @"UsrSpinoffCompanyAccount", ReferenceSchemaUId = new Guid("25d7c1ab-1de0-4501-b402-02e0e5a72d6e"), IsValueCloneable = false, IsIndexed = true, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a"), IsSimpleLookup = true }; } protected virtual EntitySchemaColumn CreateUsrCurrentlicenceValueDecColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Float2")) { UId = new Guid("4f9eaf8d-da8a-4119-9e55-0b4e82797c0e"), Name = @"UsrCurrentlicenceValueDec", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrForecastDecColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Float2")) { UId = new Guid("99671b76-06f6-4cd3-bb72-e49ec69b02c6"), Name = @"UsrForecastDec", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrProjectSetupColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Lookup")) { UId = new Guid("366ba9b7-81eb-42ac-b432-47faaa5800bd"), Name = @"UsrProjectSetup", ReferenceSchemaUId = new Guid("551cb8ae-3a49-4016-acf2-1ea81c84b6c8"), IsValueCloneable = false, IsIndexed = true, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrHasDealsColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Boolean")) { UId = new Guid("4fed2299-508f-4678-ad87-52445119af33"), Name = @"UsrHasDeals", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrUsingPlatformColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Lookup")) { UId = new Guid("7afad3b7-91bf-42ee-af3a-ad5a0c6dd86b"), Name = @"UsrUsingPlatform", ReferenceSchemaUId = new Guid("91bda100-4fb7-4008-9a1a-2da33c0fcd0e"), IsValueCloneable = false, IsIndexed = true, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a"), IsSimpleLookup = true }; } protected virtual EntitySchemaColumn CreateUsrCustomerStatusColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Lookup")) { UId = new Guid("0080f4a1-2d25-4ef4-803a-c4fa94d121c8"), Name = @"UsrCustomerStatus", ReferenceSchemaUId = new Guid("981fad1e-60a9-4bc5-9f88-6b9d7ca05d29"), IsValueCloneable = false, IsIndexed = true, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a"), IsSimpleLookup = true }; } protected virtual EntitySchemaColumn CreateUsrNoProjectsinLicenceIntColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Integer")) { UId = new Guid("87f2364b-4caf-4366-8bca-cc876ea2cc59"), Name = @"UsrNoProjectsinLicenceInt", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrContractTermIntColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Integer")) { UId = new Guid("d5e5a8de-e5d6-4acd-b501-cbd2713b2d1b"), Name = @"UsrContractTermInt", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected virtual EntitySchemaColumn CreateUsrAccountNotesColumn() { return new EntitySchemaColumn(this, DataValueTypeManager.GetInstanceByName("Text")) { UId = new Guid("02cfcf0e-ccd4-4c41-adc4-6474e1ae4852"), Name = @"UsrAccountNotes", IsValueCloneable = false, CreatedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), ModifiedInSchemaUId = new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"), CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a") }; } protected override void InitializeMethods() { base.InitializeMethods(); SetMethodsDefInheritance(); } protected override void InitializeIndexes() { base.InitializeIndexes(); Indexes.Add(CreateIAccountAlternativeNameIndex()); } protected override void InitializeEventsProcessSchema() { EventsProcessSchema = Create#SchemaNameMacros#EventsProcessSchema(); } protected virtual ProcessSchema Create#SchemaNameMacros#EventsProcessSchema() { var schema = new #SchemaNameMacros#EventsProcessSchema(ProcessSchemaManager, this); schema.InitializePrimaryInfo(); return schema; } #endregion #region Methods: Public public override Entity CreateEntity(UserConnection userConnection) { return new #SchemaNameMacros#(userConnection) {Schema = this}; } public override EmbeddedProcess CreateEventsProcess(UserConnection userConnection) { return new #SchemaNameMacros#EventsProcess(userConnection); } public override object Clone() { return new #SchemaNameMacros#Schema(this); } public override EntitySchema CloneShallow() { return new #SchemaNameMacros#Schema(this, true); } public override void GetParentRealUIds(Collection<Guid> realUIds) { base.GetParentRealUIds(realUIds); realUIds.Add(new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a")); } #endregion } #endregion #region Class: #SchemaNameMacros# /// <summary> /// Account. /// </summary> public class #SchemaNameMacros# : Terrasoft.Configuration.#ParentSchemaNameMacros# { #region Constructors: Public public #SchemaNameMacros#(UserConnection userConnection) : base(userConnection) { SchemaName = "#SchemaNameMacros#"; } public #SchemaNameMacros#(#SchemaNameMacros# source) : base(source) { } #endregion #region Properties: Public /// <exclude/> public Guid UsrLicenceStructureId { get { return GetTypedColumnValue<Guid>("UsrLicenceStructureId"); } set { SetColumnValue("UsrLicenceStructureId", value); _usrLicenceStructure = null; } } /// <exclude/> public string UsrLicenceStructureName { get { return GetTypedColumnValue<string>("UsrLicenceStructureName"); } set { SetColumnValue("UsrLicenceStructureName", value); if (_usrLicenceStructure != null) { _usrLicenceStructure.Name = value; } } } private UsrLicenceStructure _usrLicenceStructure; /// <summary> /// Licence Structure. /// </summary> public UsrLicenceStructure UsrLicenceStructure { get { return _usrLicenceStructure ?? (_usrLicenceStructure = LookupColumnEntities.GetEntity("UsrLicenceStructure") as UsrLicenceStructure); } } /// <summary> /// Number of Projects. /// </summary> public string UsrNumberOfProjects { get { return GetTypedColumnValue<string>("UsrNumberOfProjects"); } set { SetColumnValue("UsrNumberOfProjects", value); } } /// <summary> /// RDrive Company URL. /// </summary> public string UsrCompanyURL { get { return GetTypedColumnValue<string>("UsrCompanyURL"); } set { SetColumnValue("UsrCompanyURL", value); } } /// <exclude/> public Guid UsrAccountCurrencyId { get { return GetTypedColumnValue<Guid>("UsrAccountCurrencyId"); } set { SetColumnValue("UsrAccountCurrencyId", value); _usrAccountCurrency = null; } } /// <exclude/> public string UsrAccountCurrencyName { get { return GetTypedColumnValue<string>("UsrAccountCurrencyName"); } set { SetColumnValue("UsrAccountCurrencyName", value); if (_usrAccountCurrency != null) { _usrAccountCurrency.Name = value; } } } private Currency _usrAccountCurrency; /// <summary> /// Currency. /// </summary> public Currency UsrAccountCurrency { get { return _usrAccountCurrency ?? (_usrAccountCurrency = LookupColumnEntities.GetEntity("UsrAccountCurrency") as Currency); } } /// <summary> /// VAT Number. /// </summary> public string UsrVATNumber { get { return GetTypedColumnValue<string>("UsrVATNumber"); } set { SetColumnValue("UsrVATNumber", value); } } /// <summary> /// Invoice email address. /// </summary> public string UsrInvoiceEmailAddress { get { return GetTypedColumnValue<string>("UsrInvoiceEmailAddress"); } set { SetColumnValue("UsrInvoiceEmailAddress", value); } } /// <summary> /// Licence Start Date. /// </summary> public DateTime UsrLicenceStartDate { get { return GetTypedColumnValue<DateTime>("UsrLicenceStartDate"); } set { SetColumnValue("UsrLicenceStartDate", value); } } /// <summary> /// Licence End Date. /// </summary> public DateTime UsrLicenceEndDate { get { return GetTypedColumnValue<DateTime>("UsrLicenceEndDate"); } set { SetColumnValue("UsrLicenceEndDate", value); } } /// <summary> /// Payment Term in days. /// </summary> public string UsrPaymentTermInDays { get { return GetTypedColumnValue<string>("UsrPaymentTermInDays"); } set { SetColumnValue("UsrPaymentTermInDays", value); } } /// <exclude/> public Guid UsrOwnerOfficeAccountId { get { return GetTypedColumnValue<Guid>("UsrOwnerOfficeAccountId"); } set { SetColumnValue("UsrOwnerOfficeAccountId", value); _usrOwnerOfficeAccount = null; } } /// <exclude/> public string UsrOwnerOfficeAccountName { get { return GetTypedColumnValue<string>("UsrOwnerOfficeAccountName"); } set { SetColumnValue("UsrOwnerOfficeAccountName", value); if (_usrOwnerOfficeAccount != null) { _usrOwnerOfficeAccount.Name = value; } } } private Account _usrOwnerOfficeAccount; /// <summary> /// Owner Office. /// </summary> public Account UsrOwnerOfficeAccount { get { return _usrOwnerOfficeAccount ?? (_usrOwnerOfficeAccount = LookupColumnEntities.GetEntity("UsrOwnerOfficeAccount") as Account); } } /// <exclude/> public Guid UsrSpinoffCompanyAccountId { get { return GetTypedColumnValue<Guid>("UsrSpinoffCompanyAccountId"); } set { SetColumnValue("UsrSpinoffCompanyAccountId", value); _usrSpinoffCompanyAccount = null; } } /// <exclude/> public string UsrSpinoffCompanyAccountName { get { return GetTypedColumnValue<string>("UsrSpinoffCompanyAccountName"); } set { SetColumnValue("UsrSpinoffCompanyAccountName", value); if (_usrSpinoffCompanyAccount != null) { _usrSpinoffCompanyAccount.Name = value; } } } private Account _usrSpinoffCompanyAccount; /// <summary> /// Spin-off Company. /// </summary> public Account UsrSpinoffCompanyAccount { get { return _usrSpinoffCompanyAccount ?? (_usrSpinoffCompanyAccount = LookupColumnEntities.GetEntity("UsrSpinoffCompanyAccount") as Account); } } /// <summary> /// Current Licence Value. /// </summary> public Decimal UsrCurrentlicenceValueDec { get { return GetTypedColumnValue<Decimal>("UsrCurrentlicenceValueDec"); } set { SetColumnValue("UsrCurrentlicenceValueDec", value); } } /// <summary> /// Forecast. /// </summary> public Decimal UsrForecastDec { get { return GetTypedColumnValue<Decimal>("UsrForecastDec"); } set { SetColumnValue("UsrForecastDec", value); } } /// <exclude/> public Guid UsrProjectSetupId { get { return GetTypedColumnValue<Guid>("UsrProjectSetupId"); } set { SetColumnValue("UsrProjectSetupId", value); _usrProjectSetup = null; } } /// <exclude/> public string UsrProjectSetupName { get { return GetTypedColumnValue<string>("UsrProjectSetupName"); } set { SetColumnValue("UsrProjectSetupName", value); if (_usrProjectSetup != null) { _usrProjectSetup.Name = value; } } } private UsrProjectSetup _usrProjectSetup; /// <summary> /// Project Setup. /// </summary> public UsrProjectSetup UsrProjectSetup { get { return _usrProjectSetup ?? (_usrProjectSetup = LookupColumnEntities.GetEntity("UsrProjectSetup") as UsrProjectSetup); } } /// <summary> /// Has Deals. /// </summary> public bool UsrHasDeals { get { return GetTypedColumnValue<bool>("UsrHasDeals"); } set { SetColumnValue("UsrHasDeals", value); } } /// <exclude/> public Guid UsrUsingPlatformId { get { return GetTypedColumnValue<Guid>("UsrUsingPlatformId"); } set { SetColumnValue("UsrUsingPlatformId", value); _usrUsingPlatform = null; } } /// <exclude/> public string UsrUsingPlatformName { get { return GetTypedColumnValue<string>("UsrUsingPlatformName"); } set { SetColumnValue("UsrUsingPlatformName", value); if (_usrUsingPlatform != null) { _usrUsingPlatform.Name = value; } } } private UsrUsingPlatform _usrUsingPlatform; /// <summary> /// Using Platform. /// </summary> public UsrUsingPlatform UsrUsingPlatform { get { return _usrUsingPlatform ?? (_usrUsingPlatform = LookupColumnEntities.GetEntity("UsrUsingPlatform") as UsrUsingPlatform); } } /// <exclude/> public Guid UsrCustomerStatusId { get { return GetTypedColumnValue<Guid>("UsrCustomerStatusId"); } set { SetColumnValue("UsrCustomerStatusId", value); _usrCustomerStatus = null; } } /// <exclude/> public string UsrCustomerStatusName { get { return GetTypedColumnValue<string>("UsrCustomerStatusName"); } set { SetColumnValue("UsrCustomerStatusName", value); if (_usrCustomerStatus != null) { _usrCustomerStatus.Name = value; } } } private UsrCustomerStatus _usrCustomerStatus; /// <summary> /// Customer Status. /// </summary> public UsrCustomerStatus UsrCustomerStatus { get { return _usrCustomerStatus ?? (_usrCustomerStatus = LookupColumnEntities.GetEntity("UsrCustomerStatus") as UsrCustomerStatus); } } /// <summary> /// No. Projects in Licence. /// </summary> public int UsrNoProjectsinLicenceInt { get { return GetTypedColumnValue<int>("UsrNoProjectsinLicenceInt"); } set { SetColumnValue("UsrNoProjectsinLicenceInt", value); } } /// <summary> /// Contract term (in years). /// </summary> public int UsrContractTermInt { get { return GetTypedColumnValue<int>("UsrContractTermInt"); } set { SetColumnValue("UsrContractTermInt", value); } } /// <summary> /// Account Notes. /// </summary> public string UsrAccountNotes { get { return GetTypedColumnValue<string>("UsrAccountNotes"); } set { SetColumnValue("UsrAccountNotes", value); } } #endregion #region Methods: Protected protected override Process InitializeEmbeddedProcess() { var process = new #SchemaNameMacros#EventsProcess(UserConnection); process.Entity = this; return process; } #endregion #region Methods: Protected protected override void InitializeThrowEvents() { base.InitializeThrowEvents(); } #endregion #region Methods: Public public override object Clone() { return new #SchemaNameMacros#(this); } #endregion } #endregion #region Class: #SchemaNameMacros#EventsProcess /// <exclude/> public partial class #SchemaNameMacros#EventsProcess<TEntity> : Terrasoft.Configuration.#ParentSchemaNameMacros#EventsProcess<TEntity> where TEntity : #SchemaNameMacros# { public #SchemaNameMacros#EventsProcess(UserConnection userConnection) : base(userConnection) { InitializeMetaPathParameterValues(); UId = Guid.NewGuid(); Name = "#SchemaNameMacros#EventsProcess"; SchemaManagerName = "EntitySchemaManager"; SerializeToDB = false; IsLogging = false; InitializeFlowElements(); } #region Properties: Private private Guid InternalSchemaUId { get { return new Guid("2592255a-1a9e-4805-8d04-2e46c2120c4a"); } } #endregion #region Properties: Public public override string InstanceUId { get { return Entity.InstanceUId.ToString(); } } #endregion #region Methods: Private private void InitializeFlowElements() { } private void OnExecuted(object sender, ProcessActivityAfterEventArgs e) { ProcessQueue(e.Context); } #endregion #region Methods: Protected protected override void PrepareStart(ProcessExecutingContext context) { base.PrepareStart(context); context.Process = this; } protected override bool ProcessQueue(ProcessExecutingContext context) { bool result = base.ProcessQueue(context); if (context.QueueTasks.Count == 0) { return result; } if (!result && context.QueueTasks.Count > 0) { ProcessQueue(context); } return result; } protected override void CompleteApplyingFlowElementsPropertiesData() { base.CompleteApplyingFlowElementsPropertiesData(); foreach (var item in FlowElements) { foreach (var itemValue in item.Value) { if (Guid.Equals(itemValue.CreatedInSchemaUId, InternalSchemaUId)) { itemValue.ExecutedEventHandler = OnExecuted; } } } } #endregion #region Methods: Public public override void ThrowEvent(ProcessExecutingContext context, string message) { base.ThrowEvent(context, message); ProcessQueue(context); } public override void WritePropertiesData(DataWriter writer, bool writeFlowElements = true) { base.WritePropertiesData(writer, writeFlowElements); } public override object CloneShallow() { return base.CloneShallow(); } #endregion } #endregion #region Class: #SchemaNameMacros#EventsProcess /// <exclude/> public class #SchemaNameMacros#EventsProcess : #SchemaNameMacros#EventsProcess<#SchemaNameMacros#> { public #SchemaNameMacros#EventsProcess(UserConnection userConnection) : base(userConnection) { } } #endregion #region Class: #SchemaNameMacros#EventsProcess public partial class #SchemaNameMacros#EventsProcess<TEntity> { #region Methods: Public #endregion } #endregion #region Class: #SchemaNameMacros#EventsProcessSchema /// <exclude/> public class #SchemaNameMacros#EventsProcessSchema : Terrasoft.Configuration.#ParentSchemaNameMacros#EventsProcessSchema { #region Constructors: Public public #SchemaNameMacros#EventsProcessSchema(ProcessSchemaManager processSchemaManager, ProcessBasedSchema ownerSchema) : base(processSchemaManager, ownerSchema) { } public #SchemaNameMacros#EventsProcessSchema(#SchemaNameMacros#EventsProcessSchema source) : base(source) { } #endregion #region Methods: Protected protected override void InitializeProperties() { base.InitializeProperties(); Name = "#SchemaNameMacros#EventsProcess"; UId = new Guid("6824274f-ce71-44a9-8f96-c74acc8a7f90"); CreatedInPackageId = new Guid("b4f6ddca-8b56-4d67-b37c-83523d7b899a"); CreatedInSchemaUId = Guid.Empty; CreatedInVersion = @"7.15.2.501"; CultureName = null; EntitySchemaUId = Guid.Empty; ModifiedInSchemaUId = Guid.Empty; ParametersEditPageSchemaUId = Guid.Empty; ParentSchemaUId = new Guid("0f4f89bf-f369-4ab4-890e-8c8f5521752f"); SequenceFlowStrokeDefColor = Color.FromArgb(-4473925); TaskFillDefColor = Color.FromArgb(-1); UsageType = ProcessSchemaUsageType.Advanced; } protected override void InitializeParameters() { base.InitializeParameters(); } protected override void InitializeBaseElements() { base.InitializeBaseElements(); } protected override void InitializeMethods() { base.InitializeMethods(); SetMethodsDefInheritance(); } protected override void InitializeUsings() { Usings.Add(new SchemaUsing() { UId = new Guid("fb7b81ba-7c3c-45a5-ae9e-c6c03dceb812"), Name = "Terrasoft.UI.WebControls.Controls", Alias = "", CreatedInPackageId = new Guid("66e9e705-64b4-4dda-925e-d1e05a389eb6") }); Usings.Add(new SchemaUsing() { UId = new Guid("cde525cf-d220-4d2a-b963-e55254c639fc"), Name = "Terrasoft.UI.WebControls.Utilities.Json.Converters", Alias = "", CreatedInPackageId = new Guid("66e9e705-64b4-4dda-925e-d1e05a389eb6") }); Usings.Add(new SchemaUsing() { UId = new Guid("5c9c82c6-ba6d-4a57-9a14-87fe8faa4ebb"), Name = "Terrasoft.Core.DB", Alias = "", CreatedInPackageId = new Guid("66e9e705-64b4-4dda-925e-d1e05a389eb6") }); Usings.Add(new SchemaUsing() { UId = new Guid("7821de68-c82b-4917-a6cd-add2adfbe400"), Name = "Terrasoft.Common", Alias = "", CreatedInPackageId = new Guid("66e9e705-64b4-4dda-925e-d1e05a389eb6") }); Usings.Add(new SchemaUsing() { UId = new Guid("d67de76f-9cbc-4bfc-babb-6f65cb89b973"), Name = "System.Data", Alias = "", CreatedInPackageId = new Guid("66e9e705-64b4-4dda-925e-d1e05a389eb6") }); Usings.Add(new SchemaUsing() { UId = new Guid("74160d3b-65e3-4694-b554-089f2d980e54"), Name = "Newtonsoft.Json", Alias = "", CreatedInPackageId = new Guid("66e9e705-64b4-4dda-925e-d1e05a389eb6") }); Usings.Add(new SchemaUsing() { UId = new Guid("e401300a-9f16-40c2-9788-cf310ae9d1c5"), Name = "Terrasoft.Common.Json", Alias = "", CreatedInPackageId = new Guid("66e9e705-64b4-4dda-925e-d1e05a389eb6") }); Usings.Add(new SchemaUsing() { UId = new Guid("19435ec9-e585-4b01-a7b6-0a11d4877ad6"), Name = "Terrasoft.Configuration", Alias = "", CreatedInPackageId = new Guid("467e8661-453f-46e6-ab9a-2749b5699bb7") }); Usings.Add(new SchemaUsing() { UId = new Guid("e7a7acf9-9ccf-4a9b-b612-ba2a5292290e"), Name = "System.Linq", Alias = "", CreatedInPackageId = new Guid("5603834c-d982-4f87-a976-a9411eeb30f3") }); Usings.Add(new SchemaUsing() { UId = new Guid("d5bb3512-71e0-482a-9c7e-16bf22c586b7"), Name = "Terrasoft.Nui.ServiceModel.DataContract", Alias = "DataContract", CreatedInPackageId = new Guid("76eace8e-4a48-486b-bf04-de18fe06b0a2") }); Usings.Add(new SchemaUsing() { UId = new Guid("b261d1c9-cc98-44e8-aabd-7806d1dc26ed"), Name = "Terrasoft.Core.Factories", Alias = "", CreatedInPackageId = new Guid("76eace8e-4a48-486b-bf04-de18fe06b0a2") }); Usings.Add(new SchemaUsing() { UId = new Guid("c261d1c9-cc98-44e8-aabd-7806d1dc26ec"), Name = "Terrasoft.Core.DcmProcess", Alias = "", CreatedInPackageId = new Guid("76eace8e-4a48-486b-bf04-de18fe06b0a2") }); Usings.Add(new SchemaUsing() { UId = new Guid("aca2294b-e209-4c40-9400-0d59d9ecd1ea"), Name = "Terrasoft.GlobalSearch.Indexing", Alias = "", CreatedInPackageId = new Guid("76eace8e-4a48-486b-bf04-de18fe06b0a2") }); } #endregion #region Methods: Public public override object Clone() { return new #SchemaNameMacros#EventsProcessSchema(this); } public override void GetParentRealUIds(Collection<Guid> realUIds) { base.GetParentRealUIds(realUIds); realUIds.Add(new Guid("6824274f-ce71-44a9-8f96-c74acc8a7f90")); } #endregion } #endregion }
Nicola Wall,
And how about this URL?
http://mysite.creatio.com/0/rest/UsrCustomNamespace/GetContactIdByName?…
Also please make sure that you've created the UsrCustomNamespace and the GetContactIdByName method there (because they are missing in your code). Here is a complete example of the service available here.
Best regards,
Oscar
Thank you for your support Oscar,
http://mysite.creatio.com/0/rest/UsrCustomNamespace/GetContactIdByName?…
(config to our site before running) Brings back a '404 not found error'
The method is in the UsrCustomNameSpace and the GetContactIdByName source code
I have included the source code for the UsrCustomConfigurationService
What I sent previously was the source code for our Accounts, agree it isn't in there, but should I not get results from running the UsrCustomNameSpace
using System; using System.ServiceModel; using System.ServiceModel.Web; using System.ServiceModel.Activation; using Terrasoft.Core; using Terrasoft.Web.Common; using Terrasoft.Core.Entities; [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] public class UsrCustomConfigurationService: BaseService { // Method returning contact identifier by name. [OperationContract] [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string GetContactIdByName(string Name) { // Default result. var result = ""; // The EntitySchemaQuery instance, addressing the Contact database table. var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "Contact"); // Adding columns to query. var colId = esq.AddColumn("Id"); var colName = esq.AddColumn("Name"); // Filtering query data. var esqFilter = esq.CreateFilterWithParameters(FilterComparisonType.Equal, "Name", Name); esq.Filters.Add(esqFilter); // Receiving query results. var entities = esq.GetEntityCollection(UserConnection); // If the data are received. if (entities.Count > 0) { // Return the "Id" column value of the first record of the query result. result = entities[0].GetColumnValue(colId.Name).ToString(); // You can also use the below variant: // result = entities[0].GetTypedColumnValue<string>(colId.Name); } // Return result. return result; } } }
Nicola Wall,
Sorry, mistyping here - we need this link
http(s)://sitename/0/rest/UsrCustomConfigurationService/GetContactIdByName?Name=Supervisor
because UsrCustomConfigurationService is a public class containing the GetContactIdByName method. This worked on my end:
Best regards,
Oscar
I'm still not having any luck, i'm afraid.
Would these errors haven't any relation?
Oscar Dylan,
Thanks Oscar,
I have now managed to Get oData through the browser, I can at least confirm the connection is correct.
For me to progress, I need to be able to pull the information into Power Bi and I am having difficulties there but will add a new post for this.
Many thanks for your support.