Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > when searching a catalog, I want to change the Dropdown selection to show more fields

Forum

Search UsersRules
when searching a catalog, I want to change the Dropdown selection to show more fields
#1
Active user
Points:: 0
Joined:: Feb 9, 2016

Hi,

please look at the attached picture. I have a catalog called cities. it has an owner attribute which is state\province. When the user searches the dropdown selection for a city then by default it shows the city name and its code. I want to show the state\province instead of the code. How can I do it?
for example, lets say there is a city montreal in Quebec with code CRM00002. and another city called also montreal but in Ohio and its code is CRM30918. Currently by default when searching it shows city name (code). I want it to show city name (state name)

Profile
#2
Active user
Points:: 0
Joined:: Mar 10, 2017

Hello  Mubarak Sami!

The easiest way to do this in my view is to create customized representation of the cities elements in the cities catalog manager module. After you create this presentation it will appear in all choice fields.


Code
Procedure PresentationGetProcessing(Data, Presentation, StandardProcessing)
   
   
   StandardProcessing = false;
   
   Presentation = Data.ref.description+" / "+Data.ref.state+" / "+Data.ref.province;
   
   
EndProcedure

Profile
#3
Active user
Points:: 0
Joined:: Feb 9, 2016

Dear Alex,

thank you for your kind support.
I tried what you suggested and unfortunately it didn't get the result that I want.
Kindly look at the attached pictures:
1. it did change the presentation of the city catalog every where. as you can see in the list column city shows city ( province ).
2. However, it does not change the drop down search.
What I want is the opposite of this, I want to change only the drop down search to become city (province). And I want to keep the presentation reference in list columns to only city.

Profile
#4
Active user
Points:: 0
Joined:: Mar 10, 2017

It seems to me that your dropdown menu is compiled as a choice list programatically and attached to the dropped down menu. If you just use pure quick choice option it should work in the way I mentioned earlier.

Profile
#5
Active user
Points:: 0
Joined:: Feb 9, 2016

Thanks Alex for the follow up.
would you please explain what you meant by use pure quick choice option.

Profile
#6
Active user
Points:: 0
Joined:: Feb 9, 2016

while looking at the other properties of the catalog, I found this as in the shown picture. It seems there is a way to set the fields that show up in the drop down list. However, only Description and Code fields can be used. How can I put Owner instead of Code?

Profile
#7
Active user
Points:: 0
Joined:: Feb 9, 2016

by the way, I tried to remove the code field from the presentation of drop down as shown in the attached pictures but unfortunately still showing in the drop down list

Profile
#8
Active user
Points:: 0
Joined:: Oct 4, 2018

Hello, Mubarak!
If you don't need code, you can remove it just set its lenght to 0.

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.