Congratulations. 

I have a task of filtering the reference field (Platform) by specific parameters in the page code.
Contact-Account-Licenses-Product-Platform.


In the SQL query, it looks like this:

select "Id", "Name" from "UsrPlatformList" as "platforms" 
	where 
		exists (select * from "Product" as "product" where  ("platforms"."Id") = ("product"."UsrPlatformId") and 
			exists (select * from "UsrLicenceClient" as "license" where ("product"."Id") = ("license"."UsrProductLicId") and 
			"license"."UsrAccountId" = '601cef3f-aa30-4fc0-b681-18d3e748ec65'
			)
		)

I'm trying to follow this instruction, but I can't.
I will be grateful for your help.

Like 1

Like

2 comments
Best reply

Ryan Farley,

I am sincerely grateful to you. With your help, other answers in the community and articles from the Academy, I learned and managed to write this complex filter. Thank you. The code currently looks like this:

attributes: {
	"UsrPlatform": {
		"dataValueType": Terrasoft.DataValueType.LOOKUP,
		"lookupListConfig": {
			"filter": function() {
				var platformFilter = this.Ext.create("Terrasoft.FilterGroup");
				var accountId = this.get("Account").value;
 
				var licenceFilter = Terrasoft.createExistsFilter(
					"[UsrLicenceClient:UsrProductLic].Id");
 
				licenceFilter.subFilters.addItem(
					Terrasoft.createColumnFilterWithParameter(
						Terrasoft.ComparisonType.EQUAL,
							"UsrAccount", accountId));
 
				var productFilter = Terrasoft.createExistsFilter(
					"[Product:UsrPlatform].Id", licenceFilter);
					platformFilter.addItem(productFilter);
				return platformFilter;
			}
		}
	}
}

I hope it helps someone and saves a lot of time.

 

You can create an exists filter by using something like the following. This example would get accounts where an activity exists with a particular owner.

// create the sub filter for the condition inside the exists
var subFilters = Terrasoft.createFilterGroup();
subFilters.addItem(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Owner", "a6b4ea0c-420c-45ab-81e7-6e76c8cc15f7"));
 
// now create the exists filter and pass the sub filter conditions to it
// note, this second param of subFilters is optional if all you want is the exists without sub conditions
var existsFilter = Terrasoft.createExistsFilter("[Activity:Account].Id", subFilters);
esq.filters.addItem(existsFilter);

That is the equivalent to the following:

Ryan

Ryan Farley,

I am sincerely grateful to you. With your help, other answers in the community and articles from the Academy, I learned and managed to write this complex filter. Thank you. The code currently looks like this:

attributes: {
	"UsrPlatform": {
		"dataValueType": Terrasoft.DataValueType.LOOKUP,
		"lookupListConfig": {
			"filter": function() {
				var platformFilter = this.Ext.create("Terrasoft.FilterGroup");
				var accountId = this.get("Account").value;
 
				var licenceFilter = Terrasoft.createExistsFilter(
					"[UsrLicenceClient:UsrProductLic].Id");
 
				licenceFilter.subFilters.addItem(
					Terrasoft.createColumnFilterWithParameter(
						Terrasoft.ComparisonType.EQUAL,
							"UsrAccount", accountId));
 
				var productFilter = Terrasoft.createExistsFilter(
					"[Product:UsrPlatform].Id", licenceFilter);
					platformFilter.addItem(productFilter);
				return platformFilter;
			}
		}
	}
}

I hope it helps someone and saves a lot of time.

 

Show all comments

Is there any way to implement on a Detail Group when the user wants to Add a new record the option to choose between Add Existing & Add New?

Somethink Like when you want to add a user to a department/functional role, of course must be an add existin & add new options, I want to implemet the same on some of my details, but dont' know how

Some ideas, samples?

 

Thanks in advance

Like 0

Like

5 comments

 

I think this is is MUST BE on bpm'online, so to avoid data duplication, for example if you're on Accounts Module and want to add a Contact, always add a new one, if it existing, bpm'online don't care about this and create a duplicate record with the obvious problems. :-(

Dear Julio, please open the code of the UsersDetailV2 schema and find how to create the functionality. All of the code is in the schema so it won't be hard to find the solution.

The fact that the functionality is missing in bpm'online is a great opportunity for you as the partner. Please feel free to create a marketplace application that will provide the described functionality.

Hi all, some body had idea how to solve this? I understand it must be a MUST HAVE, what do you think?

Julio.Falcon_Nodos,

 

Hello Julio,

 

As was mentioned previously, such functionality cannot be achieved with basic system tools but with a help of additional development. 



We have registered a query for our responsible R&D team to consider implementing such functionality in the upcoming releases, but as of now there is no ETA. 

I will assign this case to mentioned project to increase it's priority. 



Best regards,

Anastasiia

Show all comments