I have few folders created on the Account section. I want to create a detail in a different section page. On that that detail I want to be able to insert the account records which are read from the AccountFolder.
So ideally, I like to have a pop up which shows me all the folders on AccountFolder and when I select a folder, I want to be able to add all of the accounts on that folder to that detail.
In this case you need to create a simple detail using detail wizard and use "Account folder" object. After that you need to go to the schema of the detail and find the method that is called when clicking on "+" button that adds new record standardly. You need to replace the methos that is called there (that creates a record) and put the method which generates a pop-up that displays account folders and after that you need to add a method that calls accounts that are present in the selected folder. Here is the link to technical documentation on development https://academy.bpmonline.com/documents/technic-sdkmob/7-12/bpmonline-d….
Please take a look at openLookupPage function of the BaseSchemaViewModel schema. This method is triggered when clicking on the lookup and opens the module page. You can pass it the needed arguments so to open account folders.
As for the folders, the filtration for folders are preset by user. The idea is to apply the same filters for each folder using ESQ functions. In other words, when clicking on particular folder an ESQ function is triggered to Account object with the filters, which are used for the folder.
if (Terrasoft.MessageBoxButtons.OK.returnCode === returnCode) {
var rocId = this.get("MasterRecordId");
var esq = Ext.create("Terrasoft.EntitySchemaQuery",{
rootSchemaName: "AccountFolder",
});
esq.addColumn("Name");
esq.addColumn("SearchData");
var esqFilter = Terrasoft.createColumnFilterWithParameter( this.Terrasoft.ComparisonType.EQUAL,"Name",controlData.UsrAccountFolder.value.displayValue);
esq.filters.add(esqFilter);
esq.getEntityCollection(function(result){
result.collection.each(function (item) {
var searchData = item.get("SearchData");
var esqAccounts = Ext.create("Terrasoft.EntitySchemaQuery",{
You are applying filter to the binary column, which would not work. Your task is, however, to recreate a filter to Account object same as the folder is working under. This means that for example if account folder "Show accounts from England" has a filter by country, you need to add such filter to the ESQ.