Hello, I need some help in printables . I want printable to be enabled based on Status . Example if status of selected record is Completed then printable must be enabled.

I have override  "isSectionPrintFormEnabled" method in my section page as i noticed it is the method which bind to enabled value in "initSectionPrintForms" method in PrintReportUtilities . It is not working as expected as printable is always showing as disabled.

Thank You.

Like 0

Like

3 comments

Dear Sushma,

Please find the example of button being enable in the Order section.

1. You need to override your section schema.  

2. Modify the diff of the button. Add "enabled" property to it. Bind it to your custom attribute. e.g.

{
	"operation": "merge",
	"parentName": "RightContainer",
	"propertyName": "items",
	"name": "PrintButton",
	"values": {
		itemType: Terrasoft.ViewItemType.BUTTON,
		"caption": {"bindTo": "Resources.Strings.PrintButtonCaption"},
		"classes": {"wrapperClass": ["actions-button-margin-right"]},
		"controlConfig": {"menu": {"items": {"bindTo": "CardPrintMenuItems"}}},
		"visible": {"bindTo": "IsCardPrintButtonVisible"},
		"enabled": {"bindTo": "IsPrintableEnabled"}
		}
}

3. Add the attribute, which default value is set to false. e.g.

"IsPrintableEnabled": {
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"dataValueType": Terrasoft.DataValueType.BOOLEAN,
	"value": false
}

4. Add custom method, which will set the attribute value to true after status check on initialising the page. e.g.

methods: {
	onEntityInitialized: function() {
		this.callParent(arguments);
		this.checkStatus();
	},
	checkStatus: function() {
		var status = this.get("Status").value;
		if (status !== "1f3ad326-effd-4ac3-a3e2-957e7def3684") {
		   this.set("IsPrintableEnabled", true);
	    }
    }
}

Hope you will find it helpful.

Regards,

Anastasia

Anastasia Botezat,

Thank you for reply, I implemented the example as you have suggested.

It seems that when I am opening the record from my section view, it is still displaying the PRINT button. However, once the record is open, when I reload the same page, it's disabling the button - as expected.



My reasoning is 'onEntityInitialized' method is not available in the section page to change the status of the "IsPrintableEnabled" attribute.

Dear Sushma,

in this case I would like to offer you to return to the approach overriding the PrintReportUtilities schema. Particularly draw your attention to getRowPrintButtonVisible method. It is responsible for displaying Print button in the rows, when clicking on records. As I understood this is of your interest. Please override this method to add status validation. The idea is that this method should return false in case status does not allow printables.

Also, you might be also interested in getCardPrintButtonVisible method responsible for the button in the section header.

Regards,

Anastasia

Show all comments

Hi Community,

I have here a scenario below

 

Scenario:

I want to override Account communication options ( NUI ) detail for me to add field validation on its fields.

 

My replacing client module

 

But upon overriding setValidationConfig(), I got this error

How could I fix this? or is it posible to override setValidationConfig() inside a detail or the setValidationConfig() only works inside an edit page?

Thanks

 

Like 0

Like

2 comments

Give your code with a call setValidationConfig

But I think it's better case override  BaseCommunicationDetail and overriding addItem() 

And add your validator by analogy as there is added duplicate checking and number checking:

this.addColumnValidator("Number", newItem.validateField, newItem);
this.addColumnValidator("Number", newItem.checkCommunicationDuplicates, newItem);
 

:

Grigoriy,

Thanks Grigoriy, I got an idea.

Show all comments

I have an entity with a BLOB column. In a script task I get a C# byte array. Now I would like to save that array in the object using Add data block. The problem is that I don't know how to pass that data since I cannot find any process parameter type for binary data.

As an alternative I tried to convert the binary data to Base64 and save it in Unlimited length text column. In this case the problem was that the unlimited length column was limited and only part of the string got saved to the database.

Do you know how to deal with those problems?

Like 0

Like

2 comments

if the process is interpreted then use in scriptask method

Set ("component name. Property name", value)

The value needs to be serialeze to string

But it is better to use InsertQuery or UpdateQuery or esq as

Stream stream = new MemoryStream(UTF8Encoding.UTF8.GetBytes(serializedString));
stream.Position = 0;
var manager = UserConnection.GetSchemaManager("EntitySchemaManager") as Terrasoft.Core.Entities.EntitySchemaManager;
	var entitySchema = manager.GetInstanceByName("FileContactVisa");
	Entity entity = entitySchema.CreateEntity(UserConnection);
	var valueColumn = entitySchema.Columns.GetByUId(StoringColumnUId);
	entity.SetStreamValue("Blob", stream);
	entity.Save();
 
or
 
var _caseFile = new Terrasoft.Configuration.CaseFile(UserConnection);
_caseFile.FetchFromDB(recordId); 
_caseFile.SetStreamValue("Blob", memo);
_caseFile.Save();

 

Grigoriy,

Ok, I used ESQ. Thanks.

Show all comments

I noticed that you can put tag and markerValue properties on a button but I was unable to find out what are those used for. Do you know what's their purpose?

Like 0

Like

2 comments

markerValue  - for automated testing,

tag - can be used in the event handler. for example, assign one method to several buttons and, using this property, understand which element caused the event

Grigoriy,

Ok, thank you for the explanation.

Show all comments

I'm using ConfirmationDialog to show a confirmation modal when user clicks a button. That's the method I use:

confirmClick: function(eventName, modelMethod, model, tag) {
	this.showConfirmationDialog(this.get("Resources.Strings.ConfirmMessage"),
	function(returnCode) {
		if (returnCode === this.Terrasoft.MessageBoxButtons.YES.returnCode) {
			this.onProcessActionButtonClick(eventName, modelMethod, model, tag);
		}
	},
	[this.Terrasoft.MessageBoxButtons.YES.returnCode, this.Terrasoft.MessageBoxButtons.NO.returnCode],
	null);
}

The problem is that the YES and NO buttons don't get translated to my language:

Do you know what should I do to translate them?

Like 0

Like

1 comments

Dear Carlos,

The buttons' captions are stored in the system core resources. Therefore, button captions are set in accordance with the user profile language. In case you have deployed/supplied with application, that has your language by default, but captions are in English, please give us an email to support@bpmonline.com and we will investigate the issue further.

Regards,

Anastasia

Show all comments

I tried to add a custom button to an edit page, so I inserted the following code to the diff array:

{
	"operation": "insert",
	"parentName": "LeftContainer",
	"propertyName": "items",
	"name": "CustomButton",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": {"bindTo": "Resources.Strings.CustomButtonCaption"},
		"classes": {"textClass": "actions-button-margin-right"},
		"click": {"bindTo": "customAction"},
		"style": Terrasoft.controls.ButtonEnums.style.GREEN,
		"tag": "custom",
		"markerValue": "CustomButton"
	},
	"visible": true,
	"index": 4
}

The button is shown if I enter the edit page directly by coping and pasting its URL or refreshing the page but if I enter it from the section's main page, it is not shown. Do you know how to fix this problem?

Like 0

Like

4 comments

Hello!

You need to add the following button to the section schema as well and you will see the button you need.

Matt

I tried to do that and my code in UsrCustomEntitySection.js is:

 

{
	"operation": "insert",
	"parentName": "SeparateModeActionButtonsLeftContainer",
	"propertyName": "items",
	"name": "CustomButton",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": {"bindTo": "Resources.Strings.CustomButtonCaption"},
		"classes": {"textClass": "actions-button-margin-right"},
		"click": {"bindTo": "customAction"},
		"style": Terrasoft.controls.ButtonEnums.style.GREEN,
		"tag": "custom",
		"markerValue": "CustomButton",
	},
	"index": 4
}

The button appears on the section page but still not on the edit page (except when reloading it).

Carlos Zaldivar Batista,

Hello.

Please make sure you have done the necessary modifications according to the article below:

https://academy.bpmonline.com/documents/technic-sdk/7-12/adding-button-…

Matt

Matt Watts,

Ok, thank you, it works. I didn't find this article myself.

Show all comments

Hi Team,

Does anybody worked on Single sign on between BPMonline and other application? I have a button in the Contacts object which will redirects to the another cloud application. This button will open app in a seperate tab and user needs to login manually. I need to login to other application with BPM User name and password automatically. Currently my BPMOnline application is a cloud instance. I have read about one login and I am able to login to other application from one login but not from BPMOnline.

Please help if you have any solution.

Thanks,

Venkat.

Like 0

Like

1 comments

Hello,

You can use the SSO credentials to enter bpmonline system as well as other websites you choose, but you can’t use bpm’online credentials to log in to the external resources.

Show all comments

Hi everyone,



I have query:

SELECT (
	SELECT
		count(DISTINCT(c.id))
	-- c.id, c.name
	FROM flight_detail fd
		JOIN contact c
			ON c.id = fd.contact_id
		WHERE
			-- get last year 
			(fd.departure_date >= '2016-09-01' AND fd.departure_date <= '2017-09-30')	
			AND
			-- get this year
			fd.contact_id IN (
				SELECT fd_ly.contact_id
				FROM flight_detail fd_ly
				WHERE 
					fd_ly.departure_date >= '2017-09-01' AND fd_ly.departure_date <= '2018-09-30'
			)
) AS 'Customer Last Year Who Still Buy Ticket This Year',
(
	SELECT
		count(DISTINCT(c.id))
		-- c.id, c.name
	FROM flight_detail fd
		JOIN contact c
			ON c.id = fd.contact_id
		WHERE
			-- get last year 
			(fd.departure_date >= '2016-09-01' AND fd.departure_date <= '2017-09-30')
) AS 'Customer Last Year';

How to transform query to JSON format for sending data paramater DataService.

This query for get data from bpm and I want show the result to my 3rd app.



Thanks.

Like 0

Like

1 comments

Dear Romadan,

Not all queries can be easily translated in a single DataService request. In the most complex cases consider refactoring a query into few smaller queries and sending them one by one storing the result from first query and passing it as a parameter to the next query. 

Show all comments

Hello community,

I am trying to perform the following command from a Script Task element:

DELETE FROM [dbo].[UsrListDocuments] WHERE [Opportunity] = @P1 AND [Product] = @P2

Currently, the C# code is similar to this:

var opportunityId = Get("Read opportunity product.Opportunity");
var productId = Get("Read opportunity product.Product");
var delete = new Delete(userConnection)
        .From("UsrListDocuments")
        .Where("Opportunity").IsEqual(opportunityId)
        .Where("Product").IsEqual(productId);
        
return true;

Is this accurate? What would be the best practice in this case? The code is not working properly that´s why I am looking for your assistance.

Thanks.

Like 0

Like

2 comments

Hello,

As far as I understood your business goal, you are trying to fetch some parameters via [Read Data] element in your script task and pass it further to the Delete query.



Firstly, you need to get parameters in the [Script Task] from the [Read Data] element.

For the interpreted process the algorithm is the next:

1) Create a business process parameters and map it to the needed Read Data element. You can learn more about business parameters in our guide - https://academy.bpmonline.com/documents/technic-bpms/7-12/how-add-param…

In your example it will be something like:

[#Read opportunity product.First item of resulting collection.Opportunity#] and [#Read opportunity product.First item of resulting collection.Product#]

2) Use business-parameters in your Script-task.

var opportunityId = Get<Guid>("ProcessParam1");

var productId = Get<Guid>("ProcessParam2");

Then you need to get the userConnection in order to pass it in the Delete query:

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

After that you can create a delete query:

var delete = new Delete(userConnection)

        .From("UsrListDocuments")

        .Where("Opportunity").IsEqual(opportunityId)

        .Where("Product").IsEqual(productId);

        

And execute it:

 delete.execute();

Tetiana Markova,

Thanks, Thetiana. It worked.

Show all comments

Hi Community,

 

I am commiting changes on my package to SVN repository and I got this error "ROOT CAUSE INCONSISTENT LINE ENDING STYLE" (please see image below), how can I fix this error? Thanks

 

 

Like 0

Like

2 comments

Hello,

Could you please, specify the way ActivityPageV2 was created? Did you change it via Section Wizard or create a replacing module in the Configuration manually?

If the source code of the replacing schema for ActivityPageV2 was changed manually, it is possible that UNIX and WINDOWS line end characters exist in the Activity page edit schema.

You need to set only UNIX EOL. Please, see solution here - https://stackoverflow.com/questions/917392/how-should-i-fix-svn-inconsi…

Hi Fulgen,

I have gotten this a lot. 

Simply open the schema this is causing this issue and save the schema in the advance settings. This should work.

Show all comments