How to check value for composite type?

Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Jul 18, 2012
Company:

Good morning!

I have an attribute of composite type and I need to perform different actions depending on type of this attribute value. I'm trying the following script, but it does not work:

Code
   If TypeOf(Object.Ref) = Type(CatalogRef.Contractors) Then
      ...
   EndIf;

{Document.Invoice.Form.DocumentForm.Form(41,31)}: Variable is not defined (CatalogRef)
If TypeOf(Object.Ref) = Type(<<?>>CatalogRef.Contractors) Then (Verification: Server)

 
#2
People who like this:0Yes/0No
Active user
Rating: 7
Joined: Sep 26, 2012
Company: individual

You need write type as string

Code
Type("CatalogRef.Contractors")

 
#3
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Jul 18, 2012
Company:

That helped! Thank you!

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.