Hi community!

 

How can i execute a sql query like : 



INSERT INTO [DestinationTable] (fields)

SELECT field1 field2, field3 ..

FROM [SourceTable]

I can't use ESQ and .Net "SqlCommand" class ask a SqlConnection and not a UserConnection ...



Can you help me?

Best regards,

Davyd

 

Like 0

Like

1 comments

Hi community!



I finally found the solution!!! : using the Class CustomQuery like this:

var userConnection = Get<UserConnection>("UserConnection");

string sql =" ......."; 

CustomQuery myQuery = new CustomQuery(userConnection);

myQuery .SqlText = sql;

using (DBExecutor dbExecutor = userConnection.EnsureDBConnection())

{

    dbExecutor.CommandTimeout = 0;

    myQuery .Execute();

}

return true;

Show all comments
detail
7.11
sales_enterprise

Hello Community!

Is posible get a field in js from detail before save them? I need them to make a validation before save.

I'm using BaseFildsDetail.

Regards,

 

Like 0

Like

3 comments

You need to override the saveAsyncValidate method on the page and read the value from the database via ESQ in the method. Then you need to send the validation result on callback of the ESQ. You an find an example in the BaseEntityPage module in the saveAsyncValidate method. 

Eugene Podkovka,

I'm using a field detail so the detail field is wait to save when the edit page is save. Is posible save the detail before save the edit page?

I don't know what is "field detail". If  you are about an editable grid, then the previous answer will work. 

Show all comments
Client-side
ActivityPage
Javascript
sales_enterprise

Hello, 

I am wondering if anyone could help me solve this issue:

I am trying to have a calculation on the client side figure out how much time is between now (current time) and a due date set on the page.

1: I am grabbing the date from the dueDate field on the page and setting it to a variable 

2: Getting the current date and time and setting that to a variable

3 & 4: Initializing int (Number) variables via meta programming standards (not critical step)

5: set a while loop, checking if boolean/checkbox is checked off.

6: Subtracting values to find the difference with Math.abs();

7: defining the variable even further with Math.ceil();

8: Setting the value to a field on the page, with "this.set" 

This was working before I added the while() condition, am I going wrong somewhere?

I have already been trying to figure this out for 3 hours so hopefully someone can see my mistake and teach me something new, haha. 

 

Thanks, Community!

 

File attachments
Like 0

Like

3 comments

I would do something like this

define("ActivityPageV2", [], function() {
	return {
		entitySchemaName: "Activity",
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		methods: {
			onDueDateChanged: function() {
				var now = new Date();
				var dueDate = this.get("DueDate");
				var diffHrs = this.getDateDiff(now, dueDate, "hours");
				this.set("KwlString1", diffHrs.toString());
			},
			getDateDiff: function(firstDate, secondDate, identifier) {
				var diffMs = (secondDate - firstDate); // milliseconds between firstDate &amp; secondDate
				var diffDays = Math.floor(diffMs / 1000 / 60 / 60 / 24);
				var diffHrs = Math.floor(diffMs / 1000 / 60 / 60);
				var diffMins = Math.floor(diffMs / 1000 / 60);
				switch (identifier) {
					case "milliseconds":
						return diffMs;
					case "minutes":
						return diffMins;
					case "hours":
						return diffHrs;
					case "days":
						return diffDays;
					default:
						return diffMs;
				}
			}
		},
		attributes: {
			"OnDueDateChangeAttribute": {
				dependencies: [
					{
						columns: ["DueDate"],
						methodName: "onDueDateChanged"
					}
				]
			}
		},
		rules: {},
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "STRING8bd032e4-6e0f-4e1c-afdb-2ecf1041382b",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 9,
						"layoutName": "Header"
					},
					"bindTo": "KwlString1",
					"enabled": true
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 17
			}
		]/**SCHEMA_DIFF*/
	};
});

 

Eugene Podkovka,

Thank you for your quick response. It works well, but I was wondering how you would modify the method to: 

  1. Only set the "diffHours" once the page is initialized.
  2. Go into a while loop checking "while a checkbox is unchecked - run loop" that would set the hours/minutes/seconds remaining every second (or n time to create a "live" feel to the process).
  3. Once checkbox is checked, stop entire process and save current time. 

I added the a while loop to check if the boolean/checkbox is false (0) and it seems to be working.

As for getting this while loop to run after initialization, this is where I am having troubles, and after going through bpm'online's and the Mozilla Foundation's Documentation I turn to you, Eugene.

methods: {
	onDueDateChanged: function() {
		var now = new Date();
		var completeTask = this.get("UsrCompleteTask");
		var dueDate = this.get("DueDate");
		var diffHrs = this.getDateDiff(now, dueDate, "minutes");
        while(completeTask == 0) {
			this.set("UsrSTRING1", diffHrs.toString());
		}
	},
	getDateDiff: function(firstDate, secondDate, identifier) {
		var diffMs = (secondDate - firstDate); // milliseconds between firstDate &amp; secondDate
			var diffDays = Math.floor(diffMs / 1000 / 60 / 60 / 24);
			var diffHrs = Math.floor(diffMs / 1000 / 60 / 60);
			var diffMins = Math.floor(diffMs / 1000 / 60);
			switch (identifier) {
				case "milliseconds":
					return diffMs;
				case "minutes":
					return diffMins;
				case "hours":
					return diffHrs;
				case "days":
					return diffDays;
				default:
					return diffMs;
			}
		}
	},

Any knowledge on how to create this would be greatly appreciated, and thanks again on your previous response! 







 

  1. Only set the "diffHours" once the page is initialized.

Please override the "onEntityInitialized" method and set the "diffHours" there.

2. Go into a while loop checking "while a checkbox is unchecked - run loop" that would set the hours/minutes/seconds remaining every second (or n time to create a "live" feel to the process).

3. Once checkbox is checked, stop entire process and save current time. 

If you need to track when people physically work on an activity then It's a very bad idea. Just let people manage how much time they spend on a task by themselves. 

Anyway, technically it would be more correct to save a current date time value when the checkbox is checked and then save it when the checkbox is unchecked. Then calculate the difference. 

 

Show all comments

 Require flows or steps to solve the practical scenarios.

Like 0

Like

5 comments

Hello!

Could you please specify your question and provide us the task?

Best regards,

Angela

In the list of the "Accounts" section, display only the customers with A and B category, whose last year's total sales exceeded $50,000

please drop your mail id then i will sent all scenarios solutions.Hope it will be helpful.

Hi,

The point of the certification is to check the knowledge of the partner and his ability to use and configure the system according to the business task. It is very important for us to see that the person who actually takes the tests, comes up with the solution on his own. Thus, we will remove the case above from the certification and will replace it with another one.

We kindly ask you not to cheat as in this case the results do not show the real knowledge level and we will be forced to take the measures for the users who either ask the questions from the certification on our community or answer them.

Thank you for your understanding. 

Lisa

Show all comments
sales_enterprise

Not able to raise an order from Mobile app, and getting an error, 

 

 

Like 0

Like

3 comments

Hello,

To process the error you get while creating the order or synchronizing the mobile app, please click on Send report button so that we will be able to get a mobile bug report and analyze it.

Best regards,

Lily

Model Name: Redmi Note 4

Platform: Android

Platform Version: 7.0

Resolution: 360x640

IsOnlineMode: true

SyncInService: false

UIVersion: UIV2

ApplicationVersion: 7.12.2

ApplicationMajorVersion: 7.12

BackgroundSyncMode: Always

ServerUrl: https://017897-sales-enterprise.bpmonline.com/

ContactId: 76929f8c-7e15-4c64-bdb0-adc62d383727

CultureName: en-US

ApplicationRevision: 3

WorkplaceCode: FieldForceWorkplace

ProductInfo: {"ProductName":"bpm'online sales","ProductEdition":"enterprise","CustomerId":"303","Version":{"Major":7,"Minor":12,"Build":0,"Revision":2702,"MajorRevision":0,"MinorRevision":2702}}

CurrentDateTime: Fri Apr 06 2018 17:53:46 GMT+0530 (IST)



Type: Terrasoft.ODataException

Message: An error occurred while processing this request.

AdditionalInfo: {"error":{"code":"","message":{"lang":"en-US","value":"An error occurred while processing this request."},"innererror":{"message":"Object reference not set to an instance of an object.","type":"System.NullReferenceException","stacktrace":"   at Terrasoft.Core.Entities.Services.ServiceContext.SaveChanges()\r\n   at System.Data.Services.DataService`1.BatchDataService.HandleBatchContent(Stream responseStream)"}}}

Stack trace: 

    at Class.showException (file:///android_asset/www/appV2/Common/Terrasoft.Mobile.Combined.js:54762:42)

    at Class.defaultExceptionHandler (file:///android_asset/www/appV2/MobileApp/app/controller/BaseConfigurationPageController.js:509:24)

    at Class.onDataSavingFailed (file:///android_asset/www/appV2/MobileApp/app/controller/BaseRecordPageController.js:413:8)

    at Object.callback (file:///android_asset/www/appV2/Common/lib/SenchaTouch/sencha-touch-all-debug.js:10397:26)

    at Class.failure (file:///android_asset/www/appV2/Common/Terrasoft.Mobile.Combined.js:32658:9)

    at Object.callback (file:///android_asset/www/appV2/Common/lib/SenchaTouch/sencha-touch-all-debug.js:10397:26)

    at Class.callback (file:///android_asset/www/appV2/Common/lib/SenchaTouch/sencha-touch-all-debug.js:60355:21)

    at Object.callback (file:///android_asset/www/appV2/Common/lib/SenchaTouch/sencha-touch-all-debug.js:10397:26)

    at Class.processFailedResponse (file:///android_asset/www/appV2/Common/Terrasoft.Mobile.Combined.js:19582:7)

    at Class.failure (file:///android_asset/www/appV2/Common/Terrasoft.Mobile.Combined.js:19713:10)

    at Object.callback (file:///android_asset/www/appV2/Common/lib/SenchaTouch/sencha-touch-all-debug.js:10397:26)

    at Object.requestItemFailure (file:///android_asset/www/appV2/Common/Terrasoft.Mobile.Combined.js:35748:12)

    at Class.onRequestFailure (file:///android_asset/www/appV2/Common/Terrasoft.Mobile.Combined.js:35516:12)

    at Object.callback (file:///android_asset/www/appV2/Common/lib/SenchaTouch/sencha-touch-all-debug.js:10397:26)

    at Class.<anonymous> (file:///android_asset/www/appV2/Common/Terrasoft.Mobile.Combined.js:35752:10)

    at Object.callback (file:///android_asset/www/appV2/Common/lib/SenchaTouch/sencha-touch-all-debug.js:10397:26)

    at Class.callFailure (file:///android_asset/www/appV2/Common/Terrasoft.Mobile.Combined.js:36673:7)

    at Class.<anonymous> (file:///android_asset/www/appV2/Common/Terrasoft.Mobile.Combined.js:36660:12)

    at file:///android_asset/www/appV2/Common/lib/datajs/datajs-1.0.3.js:282:13

    at XMLHttpRequest.xhr.onreadystatechange (file:///android_asset/www/appV2/Common/lib/datajs/datajs-1.0.3.js:1053:25)

 

Hello,

It seems that there are some errors in configuration. I recommend you to go to System designer -> Advanced settings -> Configuration and Compile all items. Then fix the errors if some occur. We also recommend to make sure that the details you added in the Mobile application wizard are added correctly. 

Best regards,

Lily

Show all comments
7.11
sales_enterprise

Hello Community!

I have a custom package with a section and need to use the 

BaseFiltersGenerateModule.OwnerFilter

I did add the dependence in the code and NUI dependence in the package, put the filter in the attributes like:

            "Owner": {

                "dataValueType": Terrasoft.DataValueType.LOOKUP,

                "lookupListConfig": {"filter": BaseFiltersGenerateModule.OwnerFilter}

            }

add the reference in the top like:

 

define("UsrMycustomPage", ['BaseFiltersGenerateModule'], function(BaseFiltersGenerateModule) {

 

but when debbug the code the variable is not reference.

 

I'm are missing something?

 

 

Like 0

Like

1 comments

Try to open the google chrome console (developer tools) and check the code of the page. It seems like everything should be fine. I've just done the same on my demo and it worked. 

 

Show all comments
7.11
sales_enterprise

Hello Community!

I have a custom web service created in a source code c#. How can call this method form a external c# application calling OData Services?

 

Regards,

 

Like 0

Like

3 comments

Dear Federico,

The integration with the web services will be available out of the box in the 7.12 release, which will be available very shortly. The documentation is already present on the academy. You can read more about it in the academy article below:

https://academy.bpmonline.com/documents/studio/7-12/integration-web-services

Warm regards,

Matt

Matt Watts,

I have a implementation just like the documentation. 

https://academy.bpmonline.com/documents/technic-sdk/7-12/how-create-own…;

And want to call the method to get the result from a visual studio project in c#. 

The web service is implemented inside of bpm'online.

Exist a way to call the method from my visual studio project? 

Dear Federico,

The web service you have created is not a part of OData protocol, but a separate controller for the GET or POST methods. Therefore, you need to call it by the means of C# for GET or POST requests:

https://stackoverflow.com/questions/4015324/how-to-make-http-post-web-request

However, please pay attention, that you need to authorize initially, so to send authorization cookies along with your request. You can also check ServiceHelper schema for the way the URL should look.

Regards, 

Anastasia

Show all comments
dashboard
infographics
7.11
sales_enterprise

Hello Community! 

I would like to show a % and not the count of records in a graphic. That is posible?

 

Like 0

Like

2 comments

Dear Federico Buffa,

There is no option to display percent sign in the dashboards in the current version of the system. We have the suggestion registered, though. Thus we’ll consider it to be added in one of our future releases.

With best regards,

Oliver Wingston

This is a great idea. Being able to do some coding would be great for the Dashboards to make own equations for columns

Show all comments
7.11
sales_enterprise

Hello Comunity!

How can get the result of imput in a autogenerated-page to use them in a script task?

 

Regards,

 

Like 0

Like

1 comments

Please set auto generated page output values into parameters of the business process and then use the parameters in the script task using the following syntax

get/set value in a business process script task

var parameter1 = Get<Guid>("Parameter1");

Set("Parameter2", parameter1.ToString());

var parameter2 = Get<string>("Parameter2");

get object of type UserConnection

var userConnection = Get<UserConnection>("UserConnection");

Show all comments
  • The process creates a task to call each customer who has not had any calls for the last 30 days.
Like 0

Like

1 comments

Hello,

The business case was taken from our certification program questions. We do not provide an assistance in building the processes that are used to assess the user level of the system understanding. 

Lisa

Show all comments