Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Getting to catalog tabular data - help?

Forum

Search UsersRules
Getting to catalog tabular data - help?
#1
Active user
Points:: 0
Joined:: Sep 2, 2013

Hello;

I'd like to ask you about DynamicList and filtering.

I have two catalogs:
- Clients
- Caretakers

Clients catalog has tabular section, in which References to Caretakers can be saved. So One Client can have many Caretakers.

And now in ItemForm of Caretaker, I want to display the Clients which are under care of the Caretaker. I added a DynamicList, sel ected the Clients Catalog ... and now I want to filter it based on the tabular data fr om Clients catalog (in which the references to Caretakers are held). How can I do this?

I tried Custom Query, but then I'm stuck with the Parameter - I don't know how to assign the Form's Object.Ref to it. :(

Please help :)

Profile
#2
Just came
Points:: 0
Joined:: Mar 8, 2012

Hello,

In the ItemForm's module, try using this:

Code
&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)
   ClientsList.Parameters.SetParameterValue("Caretaker", Object.Ref);
EndProcedure

where "ClientsList" is the name of the DynamicList and "Caretaker" is the name of the parameter from the DynamicList's query used for getting the client(s) corresponding to current caretaker.

The DynamicList's query text can look like this:
Code
SEL ECT
   ClientsCaretakers.Ref
FR OM
   Catalog.Clients.Caretakers AS ClientsCaretakers
WH ERE
   ClientsCaretakers.Caretaker = &Caretaker

Use no main table for the DynamicList.

Profile
#3
Active user
Points:: 0
Joined:: Sep 2, 2013

Thank you very much, it works! :)

My Query is as follows:

Code
SEL ECT
   CatalogClients.Ref,
   CatalogClients.DataVersion,
   CatalogClients.DeletionMark,
   CatalogClients.Predefined,
   CatalogClients.Code,
   CatalogClients.Description,
   CatalogClients.Caretakers.(
      Ref,
      LineNumber,
      Caretaker,
      Percent
   )
FR OM
   Catalog.Clients AS CatalogClients
WHERE
   CatalogClients.Caretakers.Caretaker.Ref = &Caretaker

Profile
#4
Just came
Points:: 0
Joined:: Mar 8, 2012

You're welcome, good day!

Profile
#5
Active user
Points:: 0
Joined:: Sep 2, 2013

Good day to you as well :) I would like your post if I could, but I don't have permission to vote.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.