Hello,

 

We have a use case where we send information from a website to creatio via custom code. Landing page was not suited for our usecase.

 

We successfully implemented this using Anonymous Service which has code to manage CORS. We need to make the service work for .net core now. How do we transfer below code to .net core setup since the name 'WebOperationContext' does not exist in .net Core? What is the best practice to overcome CORS error in .net core setup?

 

// Preflight
 
[OperationContract]
        [WebInvoke(Method = "OPTIONS", UriTemplate = "*")]
        public void GetCaptchaPreflight() {
            var outgoingResponseHeaders = WebOperationContext.Current.OutgoingResponse.Headers;
            outgoingResponseHeaders.Add("Access-Control-Allow-Origin", "*");
            outgoingResponseHeaders.Add("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
            outgoingResponseHeaders.Add("Access-Control-Allow-Headers", "*");
            outgoingResponseHeaders.Add("Access-Control-Request-Headers", "X-Requested-With, x-request-source, accept, content-type");
        }
    }
 
// Request endpoint
[OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
        ResponseFormat = WebMessageFormat.Json)]
 
        public void ConfirmCaptcha(Stream responseDetails)
        {
		 var logger = global::Common.Logging.LogManager.GetLogger("CaptchaService");
		 logger.Info("Captcha services entered :");
			var currentWebOperationContext = WebOperationContext.Current;
			var outgoingResponseHeaders = currentWebOperationContext.OutgoingResponse.Headers;
            outgoingResponseHeaders.Add("Access-Control-Allow-Origin", "*");
			outgoingResponseHeaders.Add("Access-Control-Allow-Methods", "POST");
			outgoingResponseHeaders.Add("Access-Control-Allow-Headers", "Origin, Content-Type, Accept");
 
			try
            {
 
            StreamReader reader = new StreamReader(responseDetails);
            string responseJson = reader.ReadToEnd();
            logger.Info("Captcha services :" + responseJson);
 
              ResponseDetails rd = new ResponseDetails();
                rd = JsonConvert.DeserializeObject<ResponseDetails>(responseJson);
                if (!string.IsNullOrEmpty(rd.GToken))
                {
                    if (IsCaptchaVerified(rd.GToken))
                    {
                        logger.Info("Captcha is valid");
						logger.Info(rd.LeadId);
						logger.Info(rd.ContactId);
						logger.Info(rd.LeadResponse);
 
					}
                }
                else
                {
                    logger.Info("Captcha is invalid");
                }
            }
Like 0

Like

1 comments

Hello,

 

As for now we don't have best practices for CORS management for .NET Core however you need to try testing all the recommendations described here (they are for .NET Core).

 

Best regards,

Oscar

Show all comments

Hello,

 

We have a case where we import bulk data into many sections. Is there a way to prevent records from being imported if a given lookup is not present in the master lookup table?

 

Example : Salutation (Title) has the following values : Mr. Dr. Ms Mrs. 

During excel import, if column has Miss, we don't want that record to be added. Can we restrict this through object permissions or any other way?

 

I understand as per the documentation (pasted below), new values will be added. Is there a work around to prevent this, given that the data import is quiet big?
 

  • Be aware that lookup values not found in Creatio will be created automatically. When checking the values, the opening and closing spaces and letter case are not taken into account, while special characters are important. For example, if the imported file has the "customer" value and the [ Contact types ] lookup contains the "Customer" value, new values will not be added to the lookup and the record will be linked to the existing lookup value. However, if the “Client” contact type is specified in the import file, a new “Client” value will be added to the [ Contact types ] lookup. To avoid duplicates in the Creatio lookups, check the lookup values in the imported file.

 

 

Thanks

Like 0

Like

1 comments

Hello Shivani,

 

Unfortunately, are no such basic tools for imported records.

 

1) You can create a business process that will modify\remove data that was created on the exact date (since after data import is finished all imported records receive a similar "Created On" value). You can use this value when finding needed records.
 

2) Records that are imported are tagged using the "Data import" tag and you can use this tag when building a process to find imported records. With the required condition.
 

You can use one of those ways to find imported records and after that apply changes to those records using the business process that is needed for your business task.

 

Best regards,

Bogdan

Show all comments

Hi all,

We have a process set up for approvals with an approver and a backup approver. The issue is that if one of them approves the document. The approval request stays in the backlog of the second approver creating unnecessary amounts of "open" approvals.

Is there anyway to setup an approval cancellation should an approver accept (or rejects) an approval request ?

Like 0

Like

4 comments

Hi Damien,

 

you can modify Approvals status

Hello Damien,

 

the approval stays in the backlog because the business process is still active. If you modify the business process and make it end right after one of the approvers takes a decision, the notification from the backlog will dissapear for the other one. 

 

Best regards,

Dariy

 

 

 

 

Dariy Pavlyk,

 

Hi Dariy, very interesting to know. Does that mean that I need to do a second process for the follow-up steps that depend on these approvals ? On what criteria would the follow-up process be based on to start?

Hello Damien,

 

you can create a signal trigger for the process that will be activated when an Approval status is modified, for example. You can add aditional conditions to make sure that it will be triggered only when needed. 

 

I've just tested this on my end, and it does work properly. The business process is triggered only when you modify the approval Status, not when the approval is created.

 

Best regards,

Dariy

Show all comments

I have set up sales teams 7.18 .net core in windows system. I have come across the following post (https://community.creatio.com/questions/anonymous-custom-configuration-service-net-core) to create anonymous service. Please guide me on following questions:

  1. Should .svc file be externally created? If so where exactly it should be placed in the local folder?
  2. what are the steps for visual studio IDE settings for .net core setup in windows?
Like 0

Like

1 comments

Hello,

 

Regarding your question about creating an anonymous web service: please follow the link below to the documentation, here you can find all the needed information in the "Develop a custom web service that uses anonymous authentication for .NET Core" section.

https://academy.creatio.com/docs/developer/back_end_development/web_services/overview#title-1243-5

The short answer is, in .NetCore you don't need need to create the .svc file, you simply need to modify an appsettings.json file.

 

As for your second question, basically, there are no special steps/settings in VS IDE for .net core. It contains lots of tools but they are all optional and are not absolutely required for .net core. 
The only thing you should understand is that the code will be compiled under netstandard.

 

The application installation package on the .Net Core platform is universal, both on Linux and Windows.

 

Best regards,

Anastasiia

Show all comments

Dear team,

 

We have an observation from 7.18.5 Cloud Version of Creatio. User A has added his email inbox. When User B logs in using User B's credentials and goes to Contact record of User A, User B is able to see all emails sent by User A!

 

This could be a possible security issue unless we are missing something.

Please help us with this.

 

Thanks

Like 1

Like

3 comments

Hello Shivani,

 

Please, check the following setting:

 

image.png

 

This option should be disabled for the user in question. In case, this is not enabled for user B - please, reach out to us at support@creatio.com so that we could have a closer look at the problem.

 

Best regards,

Anastasiia

Anastasiia Lazurenko,

I am unable to see this image. Could you please reupload or type out the  setting?

Anastasiia Lazurenko,

Can we have an update on this please?

Show all comments

Hi,

I've an old instance of sales team creatio edition.

On Account page I can't see the new feature "DUPLICATE" search.

How can I solve this?

 

Like 0

Like

1 comments

Hello Stefano,

 

Could you please contact our technical support in order to take a closer look at the issue?

Please contact us by sending us an email at support@creatio.com

 

Thank you,

Artem!

Show all comments

Hello community,

I'm working on an assembly package and I'm currently using OData3 for some integrations. I noticed that the end-point "/0/ServiceModel/EntityDataService.svc/" is not exposing the methods of the custom entities. Do you have any ideas to solve this problem?
Let me know.

 

Thanks in advance,

Luca

Like 0

Like

3 comments

Hello Luca,

 

I am not sure I understand you correctly. Can you please send an expected result and an actual result you receive?

 

Thank you!

 

Best regards,

Oscar

Hi Oscar Dylan,

I have a visual studio C# project binded to OdataV3 endpoint ("/0/ServiceModel/EntityDataService.svc/") and I don't find the custom entities created by me.

 

Using the following URL: "http://localhost/0/odata/$metadata" (ODataV4) I can see the expected entities.

 

The problem is that if I try to generate ODataV4 client code using "Unchase OData Connected Service" add-On it returns this error when I use ODataV4 endpoint.

 

While if I use ODataV3 endpoint with "Unchase OData Connected Service" add-On everything runs fine but the custom entities are missing (first picture). Furthermore if I use ODataV3 in a simple package every custom entity endpoint is available.

 

Did I make myself clear?

Thanks,

Luca

Luca Tavasanis,

 

Yes, it's clear now, thank you!

 

The problem is that OData3 forms its metadata based on the default assembly and doesn't include separate assemblies (where your objects are located), while OData4 uses a separate special assembly (neither default nor the custom one). And that's why its impossible to get access objects in packages compiled in the separate assembly using OData 3.

 

Our core R&D team will review this logic in the future releases, meanwhile the only way to access the object is using OData 4 only.

 

Best regards,

Oscar

Show all comments

Hi Team,

We have a scenario, where a lead is approved by two users. But just before they approve the lead, we want to create a optional task for those 2 users to ensure all the necessary details are verified. We want to show the tasks only to the approvers so that only they can edit or complete the task.

 

We have created both the task in DCM and dynamically giving access to those tasks to the 2 users through business process (removing view/edit access to all users and giving the same only to the owner of the task). We face issues on following points in following regards:

1. when someone other than the approver views the record, we get 2 empty tasks being displayed- NonApprover.png

2. approvers can see or edit their task but get another empty task (task that has to be done by other approver) - Approver.png

can you help us out resolving the issue.

Thanks,

Gokul

 

 

File attachments
Like 0

Like

1 comments

Hi,

 

Could you please write to us at support@creatio.com so we could better analyze the issue with external access?

 

Best regards,

Max.

Show all comments

Hello community, while installing ExcelReportBuilder on the production environment I get the following error:

2021-12-15 17:58:14,812 Terrasoft.Common.DbOperationException: 23503: insert or update on table "SysPackageDataLcz" violates foreign key constraint "FKfg1JPl35PDx2FCE8Oagxv7VAMIc" ---> Npgsql.PostgresException: 23503: insert or update on table "SysPackageDataLcz" violates foreign key constraint "FKfg1JPl35PDx2FCE8Oagxv7VAMIc"
   at Npgsql.NpgsqlConnector.<DoReadMessage>d__157.MoveNext()
--- End of stack trace from previous location where exception was thrown ---

Like 0

Like

2 comments
Best reply

This is not an issue with the Excel reports package but is due to an issue with new systems only including two records in the SysCulture table (that is my assumption of the issue). The package will attempt to write data to the SysPackageDataLcz table for cultures that do not exist in the system and cause the constraint violation when the package is installed.

If you report it to support, you can reference my open case about this issue #SR-01065588

Ryan

This is not an issue with the Excel reports package but is due to an issue with new systems only including two records in the SysCulture table (that is my assumption of the issue). The package will attempt to write data to the SysPackageDataLcz table for cultures that do not exist in the system and cause the constraint violation when the package is installed.

If you report it to support, you can reference my open case about this issue #SR-01065588

Ryan

Thank you Ryan, in fact I noticed afterwards that the environment had some major problems. I wrote to the support.

Show all comments

Hi Team,

I am passing a message from business process via script task and receiving the same in the edit page. On receiving, I am displaying a pop up message. Though it is working functionally, I am getting error attached. I have also attached script task and message receiving code.

I am able to capture the message ("PreviewEmail") and getting the pop up as well. However, I am getting the error in console after this. kindly help me on this regard.

Thanks,

Gokul

Guid CurrentUserId = Get&lt;Guid&gt;("CurrentUserId");
string sender = "PreviewEmail";
// Example for message
//string message = "Please check email preview to approve the lead.";
string message = JsonConvert.SerializeObject(new {
    RecordId = Guid.NewGuid(), // your record Id
    Name = "Please confirm the email template to approve the lead"
    // some other parameters
});
 
// For specific user with sysAdminUnitId
IMsgChannel channel = MsgChannelManager.Instance.FindItemByUId(CurrentUserId);
if (channel != null) {
    var simpleMessage = new SimpleMessage() {
        Id = CurrentUserId,
        Body = message,
        Header = {
            Sender = sender
        }
    };
    channel.PostMessage(simpleMessage);
}
 
 
return true;
onMessageReceived: function(sender, message) {
	try
	{
 
 
		if (message &amp;&amp; message.Header &amp;&amp; message.Body) {
 
			if (message.Header.Sender === "UpdateLeadSection") {
				var result = this.Ext.decode(message.Body);
				if(this.get("Id") === result.RecordId)
					this.reloadEntity();
			}
 
			if(message.Header.Sender === "PreviewEmail")
			{
				this.log("received message");
				var resultMsg = this.Ext.decode(message.Body);
				this.showInformationDialog(resultMsg.Name);
 
			}	
 
		}
	}catch(e)	
	{this.log(e);}
 
 
},

Like 0

Like

1 comments

Hi Gokul,

 

There is an easier approach for the message to be sent to the current user. In your case you receive undefined as a message and as a result you receive a JSON decode error (the client-side logic tries to deserialize an undefined object). Please use the approach below:

 

1) Business process script-task:

string sender = "PreviewEmail";
string message = JsonConvert.SerializeObject(new {
    RecordId = Guid.NewGuid(),
    Name = "Please confirm the email template to approve the lead"
});
MsgChannelUtilities.PostMessage(UserConnection, sender, message);
return true;

add the following usings to the process:

Terrasoft.Configuration;
Terrasoft.Messaging.Common;
Newtonsoft.Json

2) Create a replacing view module for the ClientMessageBridge module with the following code:

 define("ClientMessageBridge", ["ConfigurationConstants"],
    function(ConfigurationConstants) {
        return {
            messages: {
                "PreviewEmail": {
                    "mode": Terrasoft.MessageMode.BROADCAST,
                    "direction": Terrasoft.MessageDirectionType.PUBLISH
                }
            },
            methods: {
                init: function() {
                    this.callParent(arguments);
                    this.addMessageConfig({
                        sender: "PreviewEmail",
                        messageName: "PreviewEmail"
                    });
                }
            }
        };
    });

3) In the replaced schema of the edit page add the following code:

messages:{
			"PreviewEmail": {
				"mode": Terrasoft.MessageMode.BROADCAST,
				"direction": Terrasoft.MessageDirectionType.SUBSCRIBE
			}
		},
		methods: {
			init: function() {
                    this.callParent(arguments);
                    this.sandbox.subscribe("PreviewEmail", this.onMessageReceived, this);
                },
			onMessageReceived: function(sender) {
				if(sender.Header.Sender === "PreviewEmail"){
					this.log("received message");
					var resultMsg = sender.Name;
					this.showInformationDialog(resultMsg);
				}
			},
		},

As a result the message will be successfully posted via WebSockets:

it will be correctly processed by the onMessageReceived method and there won't be console errors:

and the popup will appear:

The general recommendation is: please debug the logic when you receive something that is not expected.

 

Best regards,

Oscar

Show all comments