Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Easier Way to Get Catalog Item by Code

Forum

Search UsersRules
Easier Way to Get Catalog Item by Code
#1
Active user
Points:: 0
Joined:: Sep 16, 2011

Hello!
AFAIK, to get data not by a link in an object or form attribute I need to create and execute a query. Is there a shorter way if I have a unique standard attribute Code in my catalog?

Profile
#2
Active user
Points:: 1
Joined:: Nov 24, 2011

Code
CodeString = "840";
Currencies = Cataloges.Currencies;
SearchRef = Currencies.FindByCode(CodeString);
If SearchRef = Currencies.EmptyRef() Then
    DoMessageBox("There is no currencies by code " + CodeString);
EndIf;

Profile
#3
Just came
Points:: 9
Joined:: Dec 6, 2011

Use FindByCode method of CatalogManager

Profile
#4
Active user
Points:: 1
Joined:: Nov 24, 2011

but...Queries is best(and more nice) way for this, cause FindByCode isn't accesible in all version of clients, but at server you can use it always:)

Profile
#5
Active user
Points:: 1
Joined:: Nov 24, 2011

.. FindByAttribute, FindByDescription..

Profile
#6
Active user
Points:: 0
Joined:: Sep 16, 2011

Oh, thank you, guys! You're great!

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.