The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
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: 0 Yes / 0 No
Nikitin
Guest

Joined:
Company:

Do you need help?

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

Yes, that's why I'm asking.

 
#4
People who like this: 0 Yes / 0 No
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.

/* Прямое попадание по классу из инспектора */ .article-content h6, div.article-content h6 { font-size: 18px !important; color: #222 !important; font-weight: bold !important; display: block !important; text-transform: none !important; margin: 25px 0 10px 0 !important; line-height: 1.4 !important; } /* На случай, если это все же h5 */ .article-content h5, div.article-content h5 { font-size: 20px !important; color: #222 !important; font-weight: bold !important; display: block !important; }