For creating An Api i was tried to create a webservice to retrive an email from employee section  in creatio.it was published without any errors

below is the following code.

 

namespace Terrasoft.Configuration

{

    using System;

    using System.Configuration;

    using System.ServiceModel;

    using System.ServiceModel.Web;

    using System.ServiceModel.Activation;

    using Terrasoft.Common;

    using Terrasoft.Core;

    using Terrasoft.Web.Common;

    using Terrasoft.Core.Entities; 

    [ServiceContract]

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

    public class UsrCustomConfigurationService : BaseService {

    

        [OperationContract]

        [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Wrapped,

            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]

        public string EmployeeDetails(string Name) {

           // Default result.

            var result = " ";

            // The EntitySchemaQuery instance, addressing the Contact database table.

            var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "UsrEmployee");

           

            var Fname = esq.AddColumn("UsrFullName");

            var eid = esq.AddColumn("UsrEmailid");

             var esqFilter = esq.CreateFilterWithParameters(FilterComparisonType.Equal, "UsrFullName",Name);

            esq.Filters.Add(esqFilter);

            // Receiving query results.

            var entities = esq.GetEntityCollection(UserConnection);

            // If condtion the data received.

             if (entities.Count > 0)

            {

                /* Return the "Id" column value of the first query result record. */

                result = entities[0].GetColumnValue("UsrEmailid").ToString();

                /* You can also use this option:

                result = entities[0].GetTypedColumnValue(colId.Name); */

            }

            // Return result.

            return result;

        }

    }

}

Now, I am trying to access the webservice API from postman. But it was giving an error. I was attaching the image for reference. Whether I followed correct procedure or not?

If any other procdures to retrieve data.please,help us.

Like 0

Like

3 comments

Hello Keerthana Yenagandhula

 

I made a similar webservices a few weeks ago.

Here's a Creatio article explaining how to do it:

https://academy.creatio.com/docs/7-18/developer/back_end_development/we…

 

And there is also the walkthrough to test it in Postmain

https://academy.creatio.com/docs/7-18/developer/back_end_development/we…

 

I hope this will help you.

 

Vincent

 

LAVIGNE Vincent,

LAVIGNE Vincent,

In my case, I am facing issue in Postman Issue.could please,help me I am unable to rectify this issue.

Keerthana Yenagandhula,

Hi!

 

Please review all the headers and ensure that the settings are configured correctly.

 

Here is the documentation to get acquainted with:  https://documenter.getpostman.com/view/10204500/SztHX5Qb?version=latest…

 

We will be glad to help with any other questions.

Show all comments

I have tried to compile the cloud environment but i am facing an error can some help me out on how to resolve this error: 

 

File attachments
Like 0

Like

3 comments

Hi!

 

Please try to run the actions 'generate all' and compile the site again.

 

Let us know the result, please!

Alla Blinova,

we are still getting the same error

Hi!

 

The issue is caused by the missing sources of the custom package object. To resolve this issue, we recommend regenerating the sources for the relevant schemas (please see the attached file) ​​​​​​​ and then performing compilation.



To investigate this behavior, we ask you to submit a request to our team via support@creatio.com or the Success Portal. 



We'll need to access the instance remotely in order to help.



Thank you for your cooperation!

Show all comments

Hello team,

 

I have written a script using SEQUENCE & TRIGGERS for PostGres to auto increment the record number. This was a decision taken to avoid writing multiple codes through JS and Server side because we get inputs from a lot of sources - 3rd party integration, manual entry & business process.

 

While our trigger works well, we noticed that using odata, the response returned does not have the auto numbered value, whereas the auto numbering is indeed getting stored in the data base.

 

The question is, does Odata response for POST requests get triggered after all DB triggers are completed or does it happen just before a record is inserted into the DB?



PS: I tried triggers using BEFORE update and it did not work

Like 0

Like

1 comments

Hello,

This question needs to be analyzed mo deeply, but, based on your information, the POST request isn't affected by all the DB triggers and therefore happens before the insert.

Also, a small note, if you have autonumbering both on the JS and Server side than a new number will be generated no matter what is the source of the object (data, business process, etc).

Show all comments

Hi Community, 



Is there anyone who might be able to help me with the code below? I am trying to filter a lookup column, by the value of another lookup column on the same page.

Specifically, my column "PrimaryContact" should be filter Contacts where the "Account" is equal to the "UsrCompanyName" of the same page. 



I've tried many things in the "Value" for rightExpression, but can't seem to get it to work. The rest of the code seems okay because if I add a Guid of an Account to the value, it filters fine. 



Thanks!



 

"LookupAttribute_j53fgnq_List_BusinessRule_Filter": {
					"value": {
						"filterType": 6,
						"isEnabled": true,
						"items": {
							"CustomFilters": {
								"filterType": 6,
								"isEnabled": true,
								"items": {
									"cb855fc4-4526-475a-beea-8e41a7f5a439": {
										"comparisonType": 11,
										"filterType": 1,
										"isEnabled": true,
										"leftExpression": {
											"expressionType": 0,
											"columnPath": "Account"
										},
										"rightExpression": {
											"expressionType": 2,
											"parameter": {
												"dataValueType": 1,
												"value": "$PDS.UsrCompanyName.Id"
											}
										},
										"trimDateTimeParameterToDate": false
									}
								}
							}
						}
					}
				}, 
 

 

Like 2

Like

4 comments
Best reply

Hi Harry,

It would be easier to handle the request for when the lookup requests its data source and then add the filters to that request since you'd have access to page data.

When the lookup is activated (user clicks the dropdown) it sends a crt.LoadDataRequest. You can listen for that and then add the filters there. The request would look something like this: 

handlers: /**SCHEMA_HANDLERS*/[
	{
		request: "crt.LoadDataRequest",
		handler: async (request, next) => {
		    // the data soruce name will be the lookup attribute name + "_List_DS"
			if (request.dataSourceName !== "LookupAttribute_46uzwvy_List_DS") {
				return await next?.handle(request);
			}
 
			// get other page values
			const compId = request.$context.UsrCompanyName.value;
 
			// add filter
			request.parameters.push({
				type: "filter",
				value: {
						"filterType": 6,
						"isEnabled": true,
						"items": {
							"CustomFilters": {
								"filterType": 6,
								"isEnabled": true,
								"items": {
									"cb855fc4-4526-475a-beea-8e41a7f5a439": {
										"comparisonType": 11,
										"filterType": 1,
										"isEnabled": true,
										"leftExpression": {
											"expressionType": 0,
											"columnPath": "Account"
										},
										"rightExpression": {
											"expressionType": 2,
											"parameter": {
												"dataValueType": 1,
												"value": compId
											}
										},
										"trimDateTimeParameterToDate": false
									}
								}
							}
						}
			});
 
			return await next?.handle(request);
		}
	}
]/**SCHEMA_HANDLERS*/,

As a side note, for the filter, I believe something along these lines should work. It's close the working, but the end result request shows in the network tab that the filter key and filter values get added separately to the filters array causing a server error. Hopefully we'll get more details on this sort of thing soon:

(Note, the below doesn't work yet, but sharing it in case someone else gets it to work)

handlers: /**SCHEMA_HANDLERS*/[
	{
		request: "crt.LoadDataRequest",
		handler: async (request, next) => {
		    // data soruce name is lookup attribute + "_List_DS"
			if (request.dataSourceName !== "LookupAttribute_46uzwvy_List_DS") {
				return await next?.handle(request);
			}
 
			let filters = new sdk.FilterGroup();
			filters.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Type.Name", "Partner");
 
			// add filter
			request.parameters.push({
				type: sdk.ModelParameterType.Filter,
				value: filters
			});
 
			return await next?.handle(request);
		}
	}
]/**SCHEMA_HANDLERS*/,

Ryan

Hi Harry,

 

In case you doubt about the filtration on the column you can create a test list based on the object of your lookup column and specify the needed filtration there:

and

save the page and open the code. As a result you will see an autogenerated code of the working filtration that then can be applied to the column:

HI Oleg, 



Thank you. This example works well when applying a static filter. However, it seems not to work the same when trying to apply filter by page data. 



Do you have any example how to translate this same method so that I can filter a lookup column by page data? 



Thank you 

Hi Harry,

It would be easier to handle the request for when the lookup requests its data source and then add the filters to that request since you'd have access to page data.

When the lookup is activated (user clicks the dropdown) it sends a crt.LoadDataRequest. You can listen for that and then add the filters there. The request would look something like this: 

handlers: /**SCHEMA_HANDLERS*/[
	{
		request: "crt.LoadDataRequest",
		handler: async (request, next) => {
		    // the data soruce name will be the lookup attribute name + "_List_DS"
			if (request.dataSourceName !== "LookupAttribute_46uzwvy_List_DS") {
				return await next?.handle(request);
			}
 
			// get other page values
			const compId = request.$context.UsrCompanyName.value;
 
			// add filter
			request.parameters.push({
				type: "filter",
				value: {
						"filterType": 6,
						"isEnabled": true,
						"items": {
							"CustomFilters": {
								"filterType": 6,
								"isEnabled": true,
								"items": {
									"cb855fc4-4526-475a-beea-8e41a7f5a439": {
										"comparisonType": 11,
										"filterType": 1,
										"isEnabled": true,
										"leftExpression": {
											"expressionType": 0,
											"columnPath": "Account"
										},
										"rightExpression": {
											"expressionType": 2,
											"parameter": {
												"dataValueType": 1,
												"value": compId
											}
										},
										"trimDateTimeParameterToDate": false
									}
								}
							}
						}
			});
 
			return await next?.handle(request);
		}
	}
]/**SCHEMA_HANDLERS*/,

As a side note, for the filter, I believe something along these lines should work. It's close the working, but the end result request shows in the network tab that the filter key and filter values get added separately to the filters array causing a server error. Hopefully we'll get more details on this sort of thing soon:

(Note, the below doesn't work yet, but sharing it in case someone else gets it to work)

handlers: /**SCHEMA_HANDLERS*/[
	{
		request: "crt.LoadDataRequest",
		handler: async (request, next) => {
		    // data soruce name is lookup attribute + "_List_DS"
			if (request.dataSourceName !== "LookupAttribute_46uzwvy_List_DS") {
				return await next?.handle(request);
			}
 
			let filters = new sdk.FilterGroup();
			filters.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Type.Name", "Partner");
 
			// add filter
			request.parameters.push({
				type: sdk.ModelParameterType.Filter,
				value: filters
			});
 
			return await next?.handle(request);
		}
	}
]/**SCHEMA_HANDLERS*/,

Ryan

Thank you, Ryan. That worked perfectly. 

Show all comments

Can we hide a section from a workplace for a certain time frame?

 

Regards

Sivanesan

Like 0

Like

1 comments

Hello,

 

If you need to hide the section for some time for a specific user or group of users/role, you can simply remove the section for the needed time from a Workplace in which the user/group of users or specific user role is working and once needed add it to the Workplace again. 

You may also consider creating a separate Workplace for this user/users so it will be easier to manage. 

However, the user will still be able to access records or a section by a direct link for example, if you need to prevent it, we'd suggest considering changing access rights for the object for the user/user role. 



If we are talking about hiding a section for a specific timeframe, for example from 4 to 5 pm each day, such implementation can be done only by means of additional development. 

 

Best regards,

Yuliya Gritsenko

Show all comments

I am restoring a package that I have saved from and into a Creatio trial, the following error seems to be stopping the restore:

2023-02-20 21:59:01,063 Error occurred while installing data "SysModuleInWorkplace_SectionInWorkplaceManager_bb810449aaee4db7bc12146d8b56d702" in package "Certification". UId 3a8e404f-99ee-453b-97e9-1485c6cb3bbe: 23503: insert or update on table "SysModuleInWorkplace" violates foreign key constraint "FKiEw0PrrAuIapzcrL01PohOXeFM"
UPDATE "public"."SysModuleInWorkplace"

At this point all I have done is create two sections and a workplace.  I have disabled the Freedom UI interface.

 

I have been saving the project incrementally and it is the same error twelve saved packages further on.

Like 0

Like

1 comments

Dear Gareth,

 

Thanks for your question.



To find the root cause of the issue, could you please contact us at support@creatio.com

 

Thanks in advance!

 

Best regards,

Anastasiia

Show all comments

Hi community, 



In version 8.06 the no code tools make it easy to add attributes to the SysUserProfile object. For example, we are adding new preference fields. 



I want to run business processes based on this object. However, it does not appear in the dropdown for "read data from" when using "Read Data" function.



Does anyone know if it is possible to register the object in this dropdown? 



Thanks

Harry

Like 0

Like

1 comments

Hello,



The SysUserProfile table is a system table that cannot be used in business processes.

Show all comments

Hi all, i want to make daily report that could be sent via email. The daily report contains all the record that i've made today. So it like list.

I have tried to make printable and then read it in business process but still cant. And i tried to make template in business process:

But i got an empty email:

 

Could someone advice for this?

 

Thank you

Like 0

Like

1 comments

Hello,

 

Have you created the needed template using these instructions?

https://academy.creatio.com/docs/user/marketing_tools/email_marketing/e…

 

You can find out more about these template elements here:

Add template elements

Macros

Show all comments

Hi,

We need to integrate 3rd party web application with Creatio DataBase using OData4.

Our question is:

How many concurrent connections with the same Creatio user does Creatio system support?

 

Is it OK to set "ApiUser" Creatio user, and use this user to interact with Creatio with LOTS of concurrent  API requests to  Creatio?

 

Thanks,

Eran.

 

Like 0

Like

1 comments

Good day,

 

Sadly, we do not have exact specifications and limits on the number of connections to Creatio.

You should only be limited by the specs of your Redis server that will have to process those connections.

 

We would additionally recommend you use a header of ForceUseSession: true.

Using a system user through whom you will pass the API request should also work fine.

 

Thank you.

Show all comments

Hi community,

I have a custom button in the product in order detail action menu.

When I click this custom button, I want it to save the parent order page before it continue to do other work.

How may I get the master record and save? Is it like this.parent.save() or something else?

Thank you!

Like 0

Like

2 comments
Best reply

Oleg Drobina,

Thank you Oscar, it works! I provide my codes below:

onButonClick2: function() {	  
  var config = {
	  sysProcessName: "UsrProcess_46b3b57Dynasafe11",
	  parameters: { 
		  ProcessSchemaRecordID: this.get("MasterRecordId")
	  },
	  callback: function() {
		  this.reloadEntity();
		  Terrasoft.showInformation("The process has completed.");
	  },
	  scope: this
  };			  
  var args = {
	  isSilent: true,
	  messageTags: [this.sandbox.id],
	  callback: function() {
		  ProcessModuleUtilities.executeProcess(config);
	  }
  };
  this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);				  
},

 

Hi Andrew,

 

Probably this approach can save the master record of the detail, but it should be tested (taken from the examples in the BaseGridDetailV2):

const args = {
					isSilent: true,
					messageTags: [this.sandbox.id]
				};
				this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);

 

Oleg Drobina,

Thank you Oscar, it works! I provide my codes below:

onButonClick2: function() {	  
  var config = {
	  sysProcessName: "UsrProcess_46b3b57Dynasafe11",
	  parameters: { 
		  ProcessSchemaRecordID: this.get("MasterRecordId")
	  },
	  callback: function() {
		  this.reloadEntity();
		  Terrasoft.showInformation("The process has completed.");
	  },
	  scope: this
  };			  
  var args = {
	  isSilent: true,
	  messageTags: [this.sandbox.id],
	  callback: function() {
		  ProcessModuleUtilities.executeProcess(config);
	  }
  };
  this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);				  
},

 

Show all comments