Autofilling the Document from the Catalog

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 5
Joined: Sep 27, 2011
Company:

I want to autofill the Phone field of the Goods Receipt document and use the OnChange event of the Supplier field for that:

Code
&AtClient
Procedure SupplierOnChange(Item)
   Object.Phone = Object.Supplier.Phone;
EndProcedure

But receive the following error. What I do wrong?

{Document.GoodsReceipt.Form.DocumentForm.Form(168)}: Object field not found (Phone)
   Object.Phone = Object.Supplier.Phone;

 
#2
People who like this:0Yes/0No
Nikitin
Guest

Joined:
Company:

Do you need help?

 
#3
People who like this:0Yes/0No
Active user
Rating: 5
Joined: Sep 27, 2011
Company:

Yes, that's why I'm asking.

 
#4
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Sep 16, 2011
Company: individual

You must to use a server call when the database query is assumed:

Code
&AtClient 
Procedure SupplierOnChange(Item) 
Object.Phone = GetPhone(Object.Supplier); 
EndProcedure 

&AtServerNoContext
Function GetPhone(Supplier) 
Return Supplier.Phone; 
EndFunction

 
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.