Hi,

 

Is there a way to read data in an edit page url ?

Like 0

Like

5 comments

Hello Thibault,

 

Would you please provide more details on your question, so that we can check it for you?

Hello Yuliya,

 

I am calling a third party service in order to obtain an authorization code from scratch. After that, I am redirected back to my edit page with a code. The url looks like this: https://079046-studio.creatio.com/0/Shell/?code=Uq-EurbsQyJ1si-mXiw_DW7…. I would like to know how I can retrieve the code to put it in a business process.

Hello,

 

Please review this video material, as it may assist you in implementing your task:

https://www.youtube.com/live/mHaGY1DxETw?feature=share&t=292

https://www.youtube.com/live/ehjfcBxpLsQ?feature=share&t=247

Hi, I think you can try this

 

1. Make parameter to record your code, in my example it is simple string parameter called UsrTest2

2. add script task:

 

string resultString = "https://079046-studio.creatio.com/0/Shell/?code=Uq-EurbsQyJ1si-mXiw_DW7…";

string part = resultString.Substring(0, resultString.LastIndexOf('#'));

string newURL = part;

string[] parts = newURL.Split('=');

string itIsCode = parts[parts.Length-1];

Set<string>("UsrTest2", itIsCode);

return true;



 

3. Get some autogenerated page to see the result

4. Result

now my parameter UsrTest2 holds the code from URL. I can use it anywhere in the process now.

 

Note: this example works if your url is going to be static and there will be no extra symbols. If your url format is changed - this code might not work properly. In that case you will have to query the string to find the code after the word "code=", something like this

 

foreach (string queryString in queryStrings)
{
 if (queryString.StartsWith("code="))
	{	
    string codeValue = queryString.Substring("==".Length);
     Console.WriteLine(codeValue);
   }
}

 

Hi, 

 

Thank you for your answer. The URL will not be static since the code will change with every call. However, I am unsure of how to retrieve the URL string.

Show all comments

Hi Team,

 

I need help in automatic mapping of excel file fields with the creatio fields for the scenario as follows:

 

The fields of section are mapped while import if the titles of fields are same in both excel and creatio instance section. But in the case of linked fields, we have to manually map the fields. How can this mapping process be automated?

 

 

The field settlement party got mapped automatically as the field title is same in excel and in creatio. However, in case of the Risk Location, the field is in another section which is linked through the Claim ID lookup. Hence, had to be mapped manually.

 

please suggest a solution for how risk location can also be mapped automatically without user intervention.

 

Best Regards,

 

Sarika

Like 0

Like

1 comments

Hello,

 

As for now, there is no built-in functionality that allows binding columns while importing as Connected object -> column from this connected object automatically, since it can provoke more errors after the import. But we have a suggestion registered to our R&D team regarding this topic in the "Accepted" status so it is included in the plan to make the functionality better. I will also let them know about your request so to make the priority of the problem higher! Currently, you need to specify connections manually and there is no workaround for this functionality.

Thank you for helping us to make our application better!

 

Kind regards,

Mira

Show all comments

Hey community !

 

TL;DR : How can I Read data from  a lookup that was fetch in a previous Read data ?

 

I have a business process that is called when a field in an object is changed. Based on this, I get the object ID and read the data from it. Until then, no problem.

 

This object contains lookup fields (they are all filled in) and I also need to read the data from these objects.

 

Here is my business process, I will explain what I do after the screenshot :

 

So my "Candidat retenu" signal passes the object ID which is changed to "read recruteurs" and I ask for all the lines in the recruteurs object :

 

Based on the data received, I have my second read data (read contact) which I have configured as follows:

 

All read data are very similar after that:

"read opportinite" : Opportunité.id = read recruteurs.Premier élément de la collection résultante.Opportunité

"read Soft skill 1" : custom object.id = read contact.Premier élément de la collection résultante.Soft Skills 1

"read Soft skill 2" : custom object.id = read contact.Premier élément de la collection résultante.Soft Skills 2

"read Soft skill 3" : custom object.id = read contact.Premier élément de la collection résultante.Soft Skills 3

"read Soft skill 4" : custom object.id = read contact.Premier élément de la collection résultante.Soft Skills 4

 

Based on all previously queried table I create a new object "candidature" :

 

All fields which I try to query data from are filled in.

 

Unfortunately when the candidature object is created the only fields that are filled in are the fields from "read recruteurs" and the "Disponibilité" field and I don't understand why. In the process diagram everything's "working" :

 

I don't have any errors and I don't understand what are my mistakes.

 

How can I query data from objects previously queried like I'm trying to do ?

 

Thanks in advance for your response !

 

Best regards,

 

 

Julien Gunther

Like 0

Like

1 comments

Dear Julien,

 

Try to contact the support team via support@creatio.com. It is necessary to have the access to the website to have and have a look at entire process. Most likely you linked some elements incorrectly, it is necessary to find the place. 

 

Regards,

Dean

Show all comments

Hi,

 

I have a business process where I need to read the read element values in a script task.

When the read element is set to "read a collection of records" I'm using the following code:



var AccountsData = Get>("ReadDataUserTask12.ResultCompositeObjectList");

var AccountData = AccountsData.First();



var AccountAddress="";

AccountData.TryGetValue("Address", out AccountAddress);

 

What change do I need to do when the read element is set to "read the first record"?

 

Thanks,

Raz

 

 

Like 0

Like

3 comments

 

 

 

 

 

 

 

 

string name = string.Empty;
string email = string.Empty;
Guid RecordId = Guid.Empty;
 
/**
 * This approach should not be used in production
 * Please create process parameters and set values with standard tools (i.e. Formula)
 * ReadDataUserTask1 is the Code of "Read One Contact" element
 */
var re = context.Process.FindFlowElementByName("ReadDataUserTask1").GetPropertyValue("ResultEntity");
 
if (re.TryGetPropertyValue("Email", out object _email))
{
	email = _email.ToString();
}
 
if (re.TryGetPropertyValue("Name", out object _name))
{
	name = _name.ToString();
}
 
if (re.TryGetPropertyValue("Id", out object _id))
{
	if(Guid.TryParse(_id.ToString(), out Guid Id))
	{
		RecordId = Id;
	}
}
 
//Set values to process parameters
Set&lt;string&gt;("Name", name);
Set&lt;string&gt;("Email", email);
Set&lt;Guid&gt;("RecordId", RecordId);
 
return true;

 

 

 

Kirill Krylov CPA,

Hi Kirill,

 

I don't understand you code.

So if shouldn't use this code in production.

 

what should I do?

 

I don't manage to get the values from ResultEntry.

 

Thanks,

Raz

Kirill Krylov CPA,

Your code is exactly what I need if I don't want to use "get a set of records" and if I don't what to use the "Formula" process element.

Why not to use it in production?

Show all comments

I was trying to choose a random user as a sender of the automatic email in Business process.

I wanted to avoid development in C#. Using only business process elements as in the cloud version. Creatio Sales Enterprise v.7.16.



The workaround I found for random is a formula like

RoundOff(DateTime.Now.Ticks / 17) % 2 == 0 ? "user1" : "user2"

This selects one of the strings "user1" or "user2", and by this string, whether it's Full name, Email, or else, the user can be determined.

But this works only for 2 users and crashes if any string changes.

 

I think such situations happen when we simply need to pick up a random element of selection.

 

But then I thought Creatio could add a new read data mode:

 

This isn't as complicated to implement, is it?

2 comments

Dear Yuriy,

 

Thank you for the idea! I will definitely pass it to our R&D team so they could consider implementing the following functionality.

 

Best regards,

Angela

Hi Yuriy,

 

As a workaround this gap of ootb solution You can store list of users in eg. Parameter 1- Text unlimited , separated by semicolon.

 

Next You may use Your random function to build formula like this one ...

[#Parameter 1#].Split(';')[RoundOf(....)%1]) .

 

Regards,

Marcin

Show all comments

Hello,

I tried the script task to read multiple records as below:

EntityCollection entities = Get("MyEntity");

var result = new Collection();

foreach(Entity entity in entities) {

                var productName = entity.GetTypedColumnValue("Name");

                string temp = productName.ToString();

                result.Add(temp);

                }

string displayValue = result.ConcatIfNotEmpty(",");

Set("UsrLatestOrderProduct", displayValue);

return true;

But, here I'm getting below errors:

Like 0

Like

1 comments

Dear Riddhi,

 

The issue happened due to the incorrect using of generic methods (Get<T> and GetTypedColumnValue<TResult>) and generic type (Collection<T>). In order to resolve the issue you should add the type argument for every generic construction in the code. Please see the example of the code:

 

EntityCollection entities = Get<type>(“MyEntity”);

var result = new Collection<type>();

var productName = entity.GetTypedColumnValue<string>(“Name”);

 

Please find additional information in the article by the link below:

 

https://academy.creatio.com/documents/technic-bpms/7-15/script-task-process-element

 

Best regards,

Norton

Show all comments

I created a Business Process and when calling the service externally by Postman for example I can not receive the returned data. I need to return customer data. I am using the object "Read Data".

File attachments
Like 0

Like

1 comments

Hello, 

Regarding to the read data part, we would recommend you to use script task as in example on the academy. 

https://academy.bpmonline.com/documents/technic-sdk/7-13/how-run-bpmonline-processes-web-service



The call of the process with script task returns nothing as you haven't specified return parameter, that is why it returns 1 stating that the process was called. Please try calling the process with the link http[s]://<bpm'online_application_address>/0/ServiceModel/ProcessEngineService.svc/UsrGetCustomer/Execute?ResultParameterName=ParameterReturn

Best regards,

Dennis 

Show all comments

Hi,

 

Can someone please direct me to any documentation around how to add data to bpmonline when receiving the data through an API?

 

Does the JSON.NET work for bpmonline or do I have to use JavaScriptSerializer class?

Like 0

Like

1 comments

Hi aaykay

Please refer to the below link:

https://academy.bpmonline.com/documents/technic-sdk/7-13/integration-bpmonline-and-public-api

The above link will have all information related to API integration and the management of data recieved through them.

In the below link, you will specifically find how to do CRUD operations in BPMOnline objects like Contacts etc.

https://academy.bpmonline.com/documents/technic-sdk/7-13/working-bpmonline-objects-over-odata-protocol-wcf-client

Thanks

Abinaya

 

 

Show all comments

Let's say I read one object using Read data step and I choose to only read columns First name and Last name. How do I reference that data in Script task? I know I can copy those strings from step parameters to process parameters using Formula step but maybe there is a better way.

Like 0

Like

15 comments

Dear Carlos,

For the [Script-task] elements and methods that have the [For an interpreted process] checkbox selected, the wrapper class is generated that contains the initialization and declaration of methods. This wrapper enables you to access the process values. 

The Get method returns the value of an item or process.

Method signature:

Get<T>(string path)

where:

  • T — parameter value type.
  • path — a string that specifies the path to a parameter or property. The path is built according to these rules:
  1. “parameter name”
  2. “property name”
  3. “element name.parameter name”
  4. “element name.property name”

Oliver

Oliver,

I don't see a parameter First name though. The only related parameter that I see is Columns to read.

Carlos Zaldivar Batista,

You don't need any parameters and select any specific columns to read in the element Read Data, simply use “element name.property name” to get the field value in the Script task.

Oliver

Oleh Chudiiovych,

Ok, so I have a step with code ReadSomeData and I try to read the columns of returned object like this:

Get&lt;Entity&gt;("ReadSomeData.ResultEntity").GetTypedColumnValue&lt;string&gt;("UsrFirstName")

I get NullReferenceException though because the Get method returned null.

Try read data from all columns. Also possible for your query (filter) no records? Do it work if you remove the filter

Grigoriy,

I read data from all columns and the query returns records.

Dear Carlos,

As far as we can see from your method you are trying to read values from the "UsrFirstName" column and we don't know what data is stored there and what are you trying to read. Please re-check all your columns and also try Grigoriy's suggestion about filters.

Oscar

Ok, so I created a new trial environment with default test data and in that environment I created a process:

 

The Read data step looks like this:

I set up the step name too:

And that is my Script task code:

Name is a process parameter that is shown in the auto-generated screen. That's what the screen shows after running the process:

There are no filters in the read data step and the data is there. What should I change to make the script task work?

Hi by default read data have code "ReadDataUserTask1".

Try this:

var entity = Get<Entity>("ReadDataUserTask1.ResultEntity"); 

 

See read data advanced mode for get elenent code (

In the advanced mode, the element setup area contains additional parameters and connections with system records

To access the advanced mode, click the btn_advanced_mode.png button in the element setup area and select the [Advanced mode] menu command

)

Sory. For interpretable processes, you can only directly work with the methods and parameters of the elements through the formula.

In autogenerate page set page item via formula like:

[#Read data 1.First item of resulting collection.First name#] 

Grigoriy,

Thank you. And is it possible to use this formula in a script tasks?

Yes

1. Create a process parameter of type String - TestParam.

2. In the parameter value specify [#Read data 1.First item of the resulting collectionFirst name#].

3. In the Task-script element, work with the parameter.

     var contactFullName = Get<string> ("TestParam");

Grigoriy,

Ok, thank you.

Does anyone know if this is still the case? i.e. that it's necessary to save each individual field to a parameter in order to access them inside a Script Task element of a Business Process? It seems like it really should be simpler to access data on any of the fields!

 

I am aware of being able to query the entity directly within the Script Task, but I'd like to keep as much of the business logic in easy-to-read BP steps as possible, including reading data.

Dear Harvey,

 

Yes, the logic remains the same. There is still to call for read data element through the script task without the intermediate process parameters or settings. This logic will be review by our developers, it is confirmed by our R&D but we do not know when it will be done.

 

Regards,

Dean

 

Show all comments

Hi Team,

I am fetching list of records from account which are modified yesterday or certain date. But it throws Internal Server Error. 

Below is my code snippet:

 



         var selectFilters = new Filters()

         {



                    FilterType = Terrasoft.Nui.ServiceModel.DataContract.FilterType.FilterGroup,



                Items = new Dictionary

                {

                    {

                        "FilterByCreatedOn",

                        // Value.

                        new Filter

                        {



                            FilterType = Terrasoft.Nui.ServiceModel.DataContract.FilterType.CompareFilter,



                            ComparisonType = FilterComparisonType.GreaterOrEqual,



                            LeftExpression = new BaseExpression ()

                            {

                                // Expression type - SchemaColumn.

                                ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                                // Path to the column relative to the root schema.

                                ColumnPath = "ModifiedOn",

                            },

                            // Filter range final expression.

                            RightExpression= new BaseExpression ()

                            {



                                ExpressionType = EntitySchemaQueryExpressionType.Parameter,



                                Parameter = new Parameter ()

                                {



                                    DataValueType = DataValueType.DateTime,

                                    Value = "5/11/2018" or new DateTime(2018,05,11)

                                }

                            }

                        }

                    }

                }

           };

 

Like 0

Like

11 comments

Hi

If you remember, bpmonline itself uses DataService for connecting to server. So the better way to apply a correct filter is to look at a browser console. Just apply an advanced filter you want in the interface and then watch Network section in the browser console.

In c# you should use a standart TimeStamp: 

const string startDate = @"""\""2000-12-31T09:41:59\"""""""""";

 

Peter Vdovukhin,

Thank you so much. It is really helpful for me. I have tried exactly like this but still getting Internal Server Error.

I do not understand, It was helpful or you still getting the error?

It is helpful that I get to know some of the things from this. But I have tried exactly like console filter and still getting error. Not able to resolve issue.

Please, post here a complete code example with validation. So I could reproduce it under my environment

 

 

 

 

 

 

Here is my complete code of my console application

 

 class ResponseStatus

    {

        public int Code { get; set; }

        public string Message { get; set; }

        public object Exception { get; set; }

        public object PasswordChangeUrl { get; set; }

        public object RedirectUrl { get; set; }

    }

    class Program

    {

        private const string baseUri = @"https://[example].bpmonline.com";

        // Query string to the Login method of the AuthService.svc service.

        private const string authServiceUri = baseUri + @"/ServiceModel/AuthService.svc/Login";

        // SelectQuery path string.

        private const string selectQueryUri = baseUri + @"/0/DataService/json/SyncReply/SelectQuery";

        // Bpm'online authentication cookie.

        private static CookieContainer AuthCookie = new CookieContainer();

        private static bool TryLogin(string userName, string userPassword)

        {

            // Creating an instance of the authentication service request.

            var authRequest = HttpWebRequest.Create(authServiceUri) as HttpWebRequest;

            // Defining the request's method.

            authRequest.Method = "POST";

            // Defining the request's content type.

            authRequest.ContentType = "application/json";

            // Enabling the use of cookie in the request.

            authRequest.CookieContainer = AuthCookie;

            // Placing user credentials to the request.

            using (var requestStream = authRequest.GetRequestStream())

            {

                using (var writer = new StreamWriter(requestStream))

                {

                    writer.Write(@"{

                ""UserName"":""" + userName + @""",

                ""UserPassword"":""" + userPassword + @"""

                }");

                }

            }

            // Auxiliary object where the HTTP reply data will be de-serialized.

            ResponseStatus status = null;

            // Getting a reply from the server. If the authentication is successful, cookie will be placed to the AuthCookie property.

            // These cookies can be used for subsequent requests.

            using (var response = (HttpWebResponse)authRequest.GetResponse())

            {

                using (var reader = new StreamReader(response.GetResponseStream()))

                {

                    // De-serialization of the HTTP reply to an auxiliary object.

                    string responseText = reader.ReadToEnd();

                    status = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<ResponseStatus>(responseText);

                }

            }

            // Checking authentication status.

            if (status != null)

            {

                // Authentication is successful.

                if (status.Code == 0)

                {

                    return true;

                }

                // Authentication is unsuccessful.

                Console.WriteLine(status.Message);

            }

            return false;

        }

        static void AddAuthCookie(HttpWebRequest request)

        {

            request.CookieContainer = AuthCookie;

            // Adding a CSRF token to the request title.

            CookieCollection cookieCollection = AuthCookie.GetCookies(new Uri(authServiceUri));

            string csrfToken = cookieCollection["BPMCSRF"].Value;

            ((HttpWebRequest)request).Headers.Add("BPMCSRF", csrfToken);

        }

        static void Main(string[] args)

        {

            if (!TryLogin("Supervisor", "Supervisor1"))

            {

                return;

            }

            try

            {

                var selectQuery = new SelectQuery()

                {

                    RootSchemaName = "Account",

                    Columns = new SelectQueryColumns()

                };

                var columnExpressionName = new ColumnExpression()

                {

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    ColumnPath = "Name"

                };

                var selectQueryColumnName = new SelectQueryColumn()

                {

                    Caption = "Company Name",

                    OrderDirection = OrderDirection.Ascending,

                    // Sorting order position.

                    OrderPosition = 0,

                    // Expression that specifies column type.

                    Expression = columnExpressionName

                };

                var columnExpressionContactName = new ColumnExpression()

                {

                    // Expression type — subquery.

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    // Path to column in relation to root schema.

                    ColumnPath = "PrimaryContact",

                };

                var selectQueryColumnContactName = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "Full Name",

                    // Expression, which specifies column type.

                    Expression = columnExpressionContactName

                };

                var columnExpressionJobTitle = new ColumnExpression()

                {

                    // Expression type — subquery.

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    // Path to column in relation to root schema.

                    ColumnPath = "JobTitle"

                };

                var selectQueryColumnJobTitle = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "Job Title",

                    // Sorting direction — ascending.

                    OrderDirection = OrderDirection.Ascending,

                    // Sorting order position.

                    OrderPosition = 1,

                    // Expression, which specifies column type.

                    Expression = columnExpressionJobTitle

                };

                var columnExpressionREPCode = new ColumnExpression()

                {

                    // Expression type — subquery.

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    // Path to column in relation to root schema.

                    ColumnPath = "UsrREPCode"

                };

                var selectQueryColumnREPCode = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "REP Code",

                    // Sorting direction — ascending.

                    OrderDirection = OrderDirection.Ascending,

                    // Sorting order position.

                    OrderPosition = 2,

                    // Expression, which specifies column type.

                    Expression = columnExpressionREPCode

                };

                var columnExpressionDAC = new ColumnExpression()

                {

                    // Expression type — subquery.

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    // Path to column in relation to root schema.

                    ColumnPath = "UsrDAC"

                };

                var selectQueryColumnDAC = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "DAC",

                    // Expression, which specifies column type.

                    Expression = columnExpressionDAC

                };

                var columnExpressionOwner = new ColumnExpression()

                {

                    // Expression type — subquery.

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    // Path to column in relation to root schema.

                    ColumnPath = "Owner"

                };

                var selectQueryColumnOwner = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "Owner",

                    // Sorting direction — ascending.

                    OrderDirection = OrderDirection.Ascending,

                    // Sorting order position.

                    OrderPosition = 4,

                    // Expression, which specifies column type.

                    Expression = columnExpressionOwner

                };

                var columnExpressionPhoneNumber = new ColumnExpression()

                {

                    // Expression type — SchemaColumn.

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    // Path to column in relation to root schema.

                    ColumnPath = "Phone"

                };

                var selectQueryColumnPhoneNumber = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "Contact Number",

                    // Expression, which specifies column type.

                    Expression = columnExpressionPhoneNumber

                };

                var columnExpressionEmail = new ColumnExpression()

                {

                    // Expression type — subquery.

                    ExpressionType = EntitySchemaQueryExpressionType.SubQuery,

                    // Path to column in relation to root schema.

                    ColumnPath = "[Account:Contact].Email"

                };

                var selectQueryColumnEmail = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "Email",

                    // Sorting direction — ascending.

                    OrderDirection = OrderDirection.Ascending,

                    // Sorting order position.

                    OrderPosition = 1,

                    // Expression, which specifies column type.

                    Expression = columnExpressionEmail

                };

                var columnExpressionCity = new ColumnExpression()

                {

                    // Expression type — subquery.

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    // Path to column in relation to root schema.

                    ColumnPath = "City"

                };

                var selectQueryColumnCity = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "City",

                    // Expression, which specifies column type.

                    Expression = columnExpressionCity

                };

                var columnExpressionState = new ColumnExpression()

                {

                    // Expression type — subquery.

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    // Path to column in relation to root schema.

                    ColumnPath = "Region"

                };

                var selectQueryColumnState = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "State",

                    // Expression, which specifies column type.

                    Expression = columnExpressionState

                };

                var columnExpressionCountry = new ColumnExpression()

                {

                    // Expression type — subquery.

                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                    // Path to column in relation to root schema.

                    ColumnPath = "Country"

                };

                var selectQueryColumnCountry = new SelectQueryColumn()

                {

                    //Title.

                    Caption = "Country",

                    // Expression, which specifies column type.

                    Expression = columnExpressionCountry

                };



                // Adding columns to query.

                selectQuery.Columns.Items = new Dictionary<string, SelectQueryColumn>()

                {

                    {

                        "Company Name",

                        selectQueryColumnName

                    },

                    {

                        "Full Name",

                        selectQueryColumnContactName

                    },

                    {

                        "Job Title",

                        selectQueryColumnJobTitle

                    },

                    {

                        "REP Code",

                        selectQueryColumnREPCode

                    },

                    {

                        "DAC",

                        selectQueryColumnDAC

                    },

                    {

                        "Owner",

                        selectQueryColumnOwner

                    },

                    {

                        "Contact Number",

                        selectQueryColumnPhoneNumber

                    },

                    //{

                    //    "Email",

                    //    selectQueryColumnEmail

                    //},

                    {

                        "City",

                        selectQueryColumnCity

                    },

                    {

                        "State",

                        selectQueryColumnState

                    },

                    {

                        "Country",

                        selectQueryColumnCountry

                    }

                };

                // Query filters.

                var selectFilters = new Filters()

                {

                    FilterType = Terrasoft.Nui.ServiceModel.DataContract.FilterType.FilterGroup,

                    IsEnabled = true,

                    RootSchemaName = "Account",

                    Items = new Dictionary<string, Filter>

                    {

                        {

                            "FilterByCreatedOn",

                            new Filter

                            {

                                FilterType = Terrasoft.Nui.ServiceModel.DataContract.FilterType.CompareFilter,

                                ComparisonType = FilterComparisonType.Greater,

                                IsEnabled = true,

                                LeftExpression = new BaseExpression ()

                                {

                                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                                    ColumnPath = "ModifiedOn",

                                },

                                RightExpression= new BaseExpression ()

                                {

                                    ExpressionType = EntitySchemaQueryExpressionType.Parameter,

                                    Parameter = new Parameter ()

                                    {

                                        DataValueType = DataValueType.DateTime,

                                        Value= "2018-05-11T11:17:04.000"

                                    }

                                },

                                TrimDateTimeParameterToDate = true,

                            }

                        },

                        {

                            "FilterByName",

                            new Filter

                            {

                                FilterType = Terrasoft.Nui.ServiceModel.DataContract.FilterType.CompareFilter,

                                ComparisonType = FilterComparisonType.Contain,

                                IsEnabled = true,

                                LeftExpression = new BaseExpression ()

                                {

                                    ExpressionType = EntitySchemaQueryExpressionType.SchemaColumn,

                                    ColumnPath = "Name",

                                },

                                RightExpression= new BaseExpression ()

                                {

                                    ExpressionType = EntitySchemaQueryExpressionType.Parameter,

                                    Parameter = new Parameter ()

                                    {

                                        DataValueType = DataValueType.Text,

                                        Value= "Test"

                                    }

                                },

                                TrimDateTimeParameterToDate = true,

                            }

                        }

                    }

                };

                selectQuery.Filters = selectFilters;

                // Serialization of an instance of query class to add to JSON string.

                var json = new JavaScriptSerializer().Serialize(selectQuery);

                byte[] jsonArray = Encoding.UTF8.GetBytes(json);

                var selectRequest = HttpWebRequest.Create(selectQueryUri) as HttpWebRequest;

                selectRequest.Method = "POST";

                selectRequest.ContentType = "application/json";

                // Adding earlier received authentication cookies to a data fetch query.

                selectRequest.CookieContainer = AuthCookie;

                selectRequest.ContentLength = jsonArray.Length;

                AddAuthCookie(selectRequest);

                using (var requestStream = selectRequest.GetRequestStream())

                {

                    requestStream.Write(jsonArray, 0, jsonArray.Length);

                }

                using (var response = (HttpWebResponse)selectRequest.GetResponse())

                {

                    using (StreamReader reader = new StreamReader(response.GetResponseStream()))

                    {

                        var result = reader.ReadToEnd();

                    }

                }

            }

            catch (Exception ex)

            {

                Console.WriteLine(ex.Message);                

            }

        }

    }

Pay attention to this code: private const string baseUri = @"https://[example].bpmonline.com";

it should be the address of your application

yes i know... I have just write down example in this code only... for comment

 

You can put there 'example' instead of 'example'. It will give you exact scenario. Thanks

You passed a wrong date format. Again, if look at browser console when applying a date filter you will see the next format: ""2018-06-05T23:59:59.999"". So you should escape one more quote mark to rich the goal in c#: Value = "\""+DateTime.Now+ "\""

Okay thanks.

Show all comments