Hello,

 

I have a web service that generates a file. I need to attach that file to a record. I see there is an option to the Process File Component passing a File as parameter, but the Parameter is Expecting a IFileLocator. How can I use a script to create a IFileLocator from a full file path on Creatio Studio version 8.1? 

 

Thanks,

Jose

File attachments
Like 0

Like

2 comments
Best reply

Hello,

You should use a script task to work with files from the web service.

 

More details about the API file:



https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

Hello,

You should use a script task to work with files from the web service.

 

More details about the API file:



https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

Thanks Cherednichenko. Using the information provided I wrote the C# below to attach a generated file to a record.



public void AttachFile(string schemaName, Guid recordId, string fullFilePath) {

            /* Create a unique ID for the new file. */

            Guid fileId = Guid.NewGuid(); 

            /* Create a file locator for the new file. */

            var fileLocator= new EntityFileLocator("SysFile", fileId); 

            /* Get an IFile object for the new file. */ 

            IFile file = UserConnection.CreateFile(fileLocator); 

            /* There is no file metadata or file content in the available file storages. Specify the file name in the file metadata. */

            file.Name = (new System.IO.FileInfo(fullFilePath)).Name; 

            /* Set an attributes for the new file: */

            file.SetAttribute("RecordSchemaName", schemaName); 

            file.SetAttribute("RecordId", recordId);             

            /* Save the file metadata Do this BEFORE saving the content. */

            file.Save(); 

            using (var sourceStream = new FileStream( fullFilePath, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize: 4096, useAsync: true)) {

                file.Write(sourceStream, FileWriteOptions.SinglePart);            

            }

        }

Show all comments

Hello,

 

I have a problem when trying to modify a lookup value in a Business Process. I have a Source field in Opportunity and when I first select the lookup it displays all of the values. After I click on anything else this happens:

The problem is that there are values in the lookup. I don't know what is happening.

 

Thank you!

Like 0

Like

1 comments

Hello,

 

It`s seems to be an issue that our support should take a look. Please send us an email at support@creatio.com

 

Best regards,

Serhii

Show all comments
Question

Hi, 

Can you help me on this use case in which the activities are created based on the user input?

for example, if I input in the field:

Activity quantity: 3 

then 3 activites are created with 3 different Subjects: activity 1, activity 2, activity 3.

Thanks 

 

Like 0

Like

2 comments

Hello,



Your business task could be achieved by the business process. For example:

 

1. Create Parameters: Start by adding parameters to the process to input values such as "start date," "end date," and "user." 



2. Configure the Business Process:

Add a pre-configured page where you can input the required values.

Use formulas to set the start and end dates using the parameters you defined earlier.

Add an "Add data" element to create a new activity. Configure the columns for start and end date, type, and user.

 

3. Add a conditional flow with a condition to check if the date doesn't match the end date from the pre-configured page.

If the condition is true, proceed to the next formula element to increment

Nguyen Trang,

 

We are sending you the Conditional flow instruction, for your review. If you have any specific questions about this, please describe them in more detail.

 

Show all comments

Hi all,

 

How to copy a new business process from the development server to the production server?

 

Thank you.

Like 0

Like

1 comments

Hi David,



Processes are transferred to the same other custom changes. Please see this article about transferring changes from site to site:

https://academy.creatio.com/docs/7-17/developer/development_tools/packa…

Show all comments

I am trying to process a collection of objects. But I am unsure how to pass the collection from a read data element in a business process to a user task. I am also unsure what parameter type I should use on the user task. Can someone tell me the name of a process/user task in creatio I can look at for an example? Or tell me how I can do this?

Like 0

Like

2 comments

Hello, Josh.

I think you can find an example here 

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

Check the example with CompositeObjectList

Hello, Josh.

Check this article 

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

 

Example you need is CompositeObjectList

Show all comments

I am getting meaningless Compilation errors , any ideawhat it is about ? 

namespace Terrasoft.Core.Process
{
 
	using System;
	using System.Collections.Generic;
	using System.Collections.ObjectModel;
	using System.Drawing;
	using System.Globalization;
	using System.Text;
	using Terrasoft.Common;
	using Terrasoft.Configuration;
	using Terrasoft.Core;
	using Terrasoft.Core.Configuration;
	using Terrasoft.Core.DB;
	using Terrasoft.Core.Entities;
	using Terrasoft.Core.Process;
	using Terrasoft.Core.Process.Configuration;
	using Terrasoft.UI.WebControls.Utilities;
 
	#region Class: UsrProcess_7b09d28TravelAgencyDev1MethodsWrapper
 
	/// <exclude/>
	public class UsrProcess_7b09d28TravelAgencyDev1MethodsWrapper : ProcessModel
	{
 
		public UsrProcess_7b09d28TravelAgencyDev1MethodsWrapper(Process process)
			: base(process) {
			AddScriptTaskMethod("ScriptTask2Execute", ScriptTask2Execute);
			AddScriptTaskMethod("ScriptTask3Execute", ScriptTask3Execute);
			AddScriptTaskMethod("ScriptTask4Execute", ScriptTask4Execute);
		}
 
		#region Methods: Private
 
		private bool ScriptTask2Execute(ProcessExecutingContext context) {
			string sender="AutoAddVisits";
			string msgbody="something";
			MsgChannelUtilities.PostMessage(UserConnection,sender,msgbody);
			return true;
		}
 
		private bool ScriptTask3Execute(ProcessExecutingContext context) {
			var frequency="frequencyInDays";
			switch (frequency) {
			         case "Daily":
			            Set(frequency, 1);
			                        break;
			                    case "Weekly":
			                        Set("frequency", 7);
			                        break;
			                    case "Monthly":
			                        Set("frequency", 30);
			                        break;
			                    default:
			                       break;
			 }
			return true;
		}
 
		private bool ScriptTask4Execute(ProcessExecutingContext context) {
			var travelOfferId = "TravelId"; 
			var travelOfferSchemaName = "TravelOffers";
			var travelOfferEsq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, travelOfferSchemaName);
			travelOfferEsq.addColumn("TravelOfferFrequency");
			var travelOffer = travelOfferEsq.getEntity(travelOfferId);
 
			var tourSchemaName = "Tours";
			var tourEsq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, tourSchemaName);
			var tourCollection = new Collection();
 
			var currentDate = new Date();
			var firstTour = tourCollection.add(tourEsq.createEntity(UserConnection));
			firstTour.set("TravelOffer", travelOfferId);
			firstTour.set("TourDate", currentDate);
 
			var travelOfferFrequency = travelOffer.get("UsrTravelOfferFrequencyId").displayValue;
			var tourDate = currentDate;
			for (var i = 1; i < 8; i++) {
			    switch (travelOfferFrequency) {
			        case "Daily":
			            tourDate.setDate(tourDate.getDate() + 1);
			            break;
			        case "Weekly":
			            tourDate.setDate(tourDate.getDate() + 7);
			            break;
			        case "Monthly":
			            tourDate.setDate(tourDate.getDate() + 30);
			            break;
			        default:
			            throw new UnknownException("Invalid travel offer frequency");
			    }
			    var tour = tourCollection.add(tourEsq.createEntity(UserConnection));
			    tour.set("TravelOffer", travelOfferId);
			    tour.set("TourDate", tourDate);
			}
 
			tourCollection.saveAll({
			    isExternal: true,
			    success: function() {
			        // The tour entities have been saved
			    },
			    failure: function() {
			        // An error occurred while saving the tour entities
			    }
			});
		}
 
		#endregion
 
	}
 
	#endregion
 
}

 

Like 0

Like

2 comments

Hello,

We need more information to solve your problem, please contact our support team - support@creatio.com

Pavlo Sokil,

I sent you a mail 

Show all comments

Hi Team,



How to change the label of the process in the section list page and record edit page.

when a Business Process is added to the section wizard, a "Run Process" drop-down button is displayed in both the edit page and section list.

 

How to rename or change the label to a different or meaningful name pertaining to the section.?



Below are the reference screenshot where the change is required

#REQ 1: Section List page

#REQ 2:  Record Edit page

 

 

BR,

Bhoobalan Palanivelu.

Like 0

Like

3 comments

Hello Bhoobalan,

Both the edit page and the section have a localizable string called "ProsessButtonCaption" which you can change to change this caption. You need to change this in both the section and the edit page. 

If you're wanting to change this for all sections/pages, you would need to do a replacing schema for BasePageV2 and BaseDataView and modify the ProsessButtonCaption string there. However, to just change it for one section you can change it in the specific section and edit pages. 

Ryan

Ryan Farley,



Thanks for the information

Where is the diff{} for this element and what is its structure?

Bhoobalan Palanivelu,

The element is named ProcessButton. For the page it is in BasePageV2 and the section it is in BaseDataView. You’ll find it in the diff there. 

Ryan

Show all comments

Hello!

 

I have a process that needs to check the value of a field. If the value is correct, another field will be unlocked, if it is not, a popup will appear.

 

The problem is that sometimes the pop-up appears before the page gets refreshed. I have the "Refresh active page" add-on inserted in the process that updates that field.

 

I think sometimes the pop-up is quicker than the refresh. The pop-up has been implemented by code. 

 

Thank you!

Like 0

Like

1 comments
Best reply

Hello Diana,

 

As a suggestion you can add a timer after the "Refresh active page" element, and set it to two seconds for example.

This way you could ensure that the element is completly executed in the background and only then the pop-up is displayed.

 

 

This add-on was developed by a third party, so if you would like to receive assistance regarding how does it work in detail, please contact  info@solutionsmetrix.com . Unfortunately we can not ensure how will behave the business process with third party custom developments.

 

Best regards,

Dariy

Hello Diana,

 

As a suggestion you can add a timer after the "Refresh active page" element, and set it to two seconds for example.

This way you could ensure that the element is completly executed in the background and only then the pop-up is displayed.

 

 

This add-on was developed by a third party, so if you would like to receive assistance regarding how does it work in detail, please contact  info@solutionsmetrix.com . Unfortunately we can not ensure how will behave the business process with third party custom developments.

 

Best regards,

Dariy

Show all comments

Hello,



I want to make a cascading dropdown. For example; user selects City, then County, then District, then Street... I want to fill the dropdowns from external web service whenever user selected previous dropdown.



How should i go about it?



Like 3

Like

3 comments

Hello Ensar,

Loos like you just need to add a filter to the column based on the other column value.

You can do it by adding attribute on the needed column.

For example:

"Transport": {
                "dataValueType": Terrasoft.DataValueType.LOOKUP,
                "lookupListConfig": {
                    "filters": [
                        function() {
                            var filterGroup = Ext.create("Terrasoft.FilterGroup");
                            filterGroup.add("WhatWeight",
                                Terrasoft.createColumnFilterWithParameter(
                                    Terrasoft.ComparisonType.GREATER,
                                    "[StTransport:Id].StMaxWeight",
                                    this.get("Weight")));
                            return filterGroup;
                        }
                    ]
                }

In this example we have column "Transport" and we wont to display values where their column "StMaxWeight" is greater that out column "Weight".

Thanks for your reply Dmytro Vovchenko,

 

Filtering is ok. At the same time, i need to get data from external web service not database. Is there a way binding lookups to external web service dynamically?

Not quite understand what are you trying to do but I think you can store the value from your web service in the schemas attribute and then work with it. To make it work you just need to somehow get the needed value from the web server in the schema code. 

Show all comments

Hi there! how are you? 

It would be very useful if processes can receive a JSON parameter type and be able to handle it as a JSON.

For example we have this JSON:

{

"ContentType" : "0",

"ShortNumber" : "50150",

}

we create the parameter Input as json type we can access the values in the business process as parameters for example Input.ContentType

I know that now there a some workaround (use string parameter and then read as JSON in a script task) but this new parameter type but this new type of parameter would speed up configuration times.

 

Thank you!

Regards.

1 comments

Hello Uriel,

 

Thank you for your idea!

We will create a request for our development team in order to bring this functionality in future releases.

 

Best regards,

Artem.

Show all comments