Hello,

I have a section called Applications which has an Owner field that points to contact lookup. The application section also has a field that points to Company Lookup. I also have a Company section. Inside this section there is a detail called Workers to which contacts are added.

 

I want to filter Owner lookup to show contacts who are added to the Workers detail of the company which is mapped to the Application. Please see below image. Can someone help with the lookup filter?

 

Like 0

Like

3 comments
Best reply

Shivani Lakshman,

 

Change the filter from "[UsrWorkers.UsrWorker].UsrAccount.Id" to "[UsrWorkers:UsrWorker].UsrAccount.Id"

 

My bad, I forgot that in reverse join it work using ":", for example :

[EntityCode:FieldCode]

 

and not [EntityCode.FieldCode]

 

regards,

 

Julien

Hi Shivani,

 

To filter your lookup you need to add this attribute in the application page :

attributes: {
    "Owner": {
        "dataValueType": Terrasoft.DataValueType.LOOKUP,
        "lookupListConfig": {
            "filters": [function() {
                var filters = Ext.create("Terrasoft.FilterGroup");
                filters.add("WorkInThisCompany", 
                    Terrasoft.createColumnFilterWithParameter(
                        Terrasoft.ComparisonType.EQUAL,
                        "[Workers:Worker].Company.Id",
                        this.get("Company").value
                    )
                );
                return filters;
            }]
        }
    }
}

Replace "Workers" by the object code of the workers detail.

 

FYI :

here is the filter breakdown :

"[WorkerObjectCode:WorkerFieldCodeInWorkers].CompanyFieldInWorkers.Id"

 

Watch out that all the codes correspond to your environment, for example, the workers object code can be "UsrWorkers" or whatever you defined it. Check it out in the advanced settings.

 

Kind regards,

 

Julien

Julien Gunther,

Thank you for your response. I tried your code but received the error 

Collection item with name [UsrWorkers not found.

 

 request data: {"rootSchemaName":"Contact","operationType":0,"includeProcessExecutionData":true,"filters":{"items":{"searchFilter":{"items":{"1f59bb71-8f5d-45ed-b4eb...

 

Looks like the system is trying to reach UsrWorkers from Contact table. This is the case with my requirement. There is no direct relation between the 2 tables. Would appreciate any suggestion!

 

Here is the code I used

"UsrOwner": {
        "dataValueType": Terrasoft.DataValueType.LOOKUP,
        "lookupListConfig": {
            "filters": [function() {
                var filters = Ext.create("Terrasoft.FilterGroup");
                filters.add("WorkInThisCompany", 
                    Terrasoft.createColumnFilterWithParameter(
                        Terrasoft.ComparisonType.EQUAL,
                        "[UsrWorkers.UsrWorker].UsrAccount.Id",
                        this.get("UsrAccount").value
                    )
                );
                return filters;
            }]
        }

 

Shivani Lakshman,

 

Change the filter from "[UsrWorkers.UsrWorker].UsrAccount.Id" to "[UsrWorkers:UsrWorker].UsrAccount.Id"

 

My bad, I forgot that in reverse join it work using ":", for example :

[EntityCode:FieldCode]

 

and not [EntityCode.FieldCode]

 

regards,

 

Julien

Show all comments

Hello. I have two critical ideas for improving Parameter selection for example in Email Templates, especially the Macros.

Ability to JOIN datatypes on reverse relation.

Example: I am working with Email Template of type Order. I have no chance to included products of the order because the relation is this:

Order <-- Products in Order <-- Product

If u had ability to join Products in Order on OrderID and then Product on ProductID I could show it.

SQL Code would be:

SELECT * FROM Order
JOIN Products in Order AS PiO on PiO.OrderID = Order.OrderID
JOIN Product on Product.ProductID= PiO.ProductID

 

Then I could use the other tables data through join. Currently this is not possible as far as I can tell.

We should be able to join everywhere in bpm'online where we use the parameter-menu:

However it is possible to do JOIN on Printable tables and on Details:

 

To summarize: I can have foreign table data shown on Details and Printables. But not for example in Email Template. I believe this is very important

3 comments

I can get a Table of my Products and Products in Order when setting up a Detail or a Printable Table. I need to be able to do the same with Email Template > Macros

Hi Julius,

Totally support the idea. We are having this need in nearly every project and allways have to find a workaround.

Rgds,

Luis

Hello Julius!

We have already registered a query for our R&D team to implement this functionality. Thank you for the suggestion!

Best regards,

Bogdan

Show all comments

Hello, 

I am trying to do something like this:

Grab information to current page, based off of value in Lookup field.

Example would be, on the current page when the User (Contact) lookup is filled in, also grab the contacts Address (String value), Phone Number (String value), and Account name (Lookup value) and fill it in on the current page. 

I am fairly sure I need to run a client side ESQ, and a few joins to get the information I am looking for, but I have not been successful yet. 

Any help is appreciated!

Like 0

Like

1 comments

Please investigate how to work with ESQ

https://academy.bpmonline.com/documents/technic-sdk/7-11/use-entitysche…

Then check the article by the link below. It shows how to select aggregate data.

https://community.bpmonline.com/questions/esq-query-find-role

Then check the next article. There you'll find how to fill in a lookup value. 

https://community.bpmonline.com/questions/update-query-change-lookup-va…

If you want to set a text or integer value, you need to use the following syntax:

this.set("fieldname", value); in a replacing client module.

Please find more information about modules in the article by the link below.

https://academy.bpmonline.com/documents/technic-sdk/7-11/adding-calcula…

Show all comments

Hi all,

2 days ago I posted asking for odata query with relationship: https://community.bpmonline.com/questions/odata-joins

I solved this issue and I posted a solution for that.

I come back because I made working querys with 1/1 relationship but not 1/n for example the idea is to get all the contacts for a particular account:

https://URL/0/ServiceModel/EntityDataService.svc/AccountCollection(guid…

I get the attached error.

Do i have an error with the relationship names? It's possible to do in bpm'online ?

Kind regards

File attachments
Like 0

Like

3 comments

Dear Uriel,

You can achieve such task by referring to the contact collection, filtering the results by Account Id. 

The request line should look like this:

// GET <BPMonline application address>/0/ServiceModel/EntityDataService.svc/ContactCollection?$filter=AccountId eq guid'00000000-0000-0000-0000-000000000000'

You can find more filter usage here:

https://academy.bpmonline.com/documents/technic-sdk/7-8/working-bpmonli…

Also, in case you use $expand in your requests, please, take into account, that in this case OData is limited to not more than13 objects to return (see info box).

https://msdn.microsoft.com/en-us/library/gg309461(v=crm.7).aspx#BKMK_ex…

Regards,

Anastasia

Anastasia, how are you?

thanks for the comment.

We need something different. The query would be from 1 to N, for example from an account bring all contacts as a collection and for each contact for example bring us all the addresses.

Thinking of an XML response we should have something like this:

 



<?xml version="1.0" encoding="UTF-8"?>

<Response>

       <Account>

              <Name>Coca Cola</Name>

              <Contacts>

                     <Contact>

                            <Name>john</Name>

                            <Addresses>

                                   <Address>234 street</Address>

                   <Address>2234 street</Address>

                               </Addresses>

                        </Contact>

                     <Contact>

                            <Name>Peter</Name>

                <Addresses>

                                   <Address>234 street</Address>

                               </Addresses>

                        </Contact>

                     <Contact>

                            <Name>Caroline</Name>

                        </Contact>

                 </Contacts>

          </Account>

   </Response>



thank you very much.

Kind regards

Uriel,

Unfortunately, possibility to expand collection is not yet implemented in the system. However, please feel free to use the above mentioned approach, as a workaround. 

Regards, 

Anastasia

Show all comments

Hi All!

We need to make the following query in OData using Http request.

 

SQL query:

 

select A.FieldZ, B.FieldX

from A inner join B on A.FieldA = B.FieldA

Basically the idea is to get data between relationships por example in one request to get an account including their contacts

if it is possible?

 

Thank you

Regards

 

Like 0

Like

1 comments
Show all comments