Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Autofilling the Document from the Catalog

Forum

Search UsersRules
Autofilling the Document from the Catalog
#1
Active user
Points:: 0
Joined:: Sep 27, 2011

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;

Profile
#2
Guest
Points::
Joined::

Do you need help?

Profile
#3
Active user
Points:: 0
Joined:: Sep 27, 2011

Yes, that's why I'm asking.

Profile
#4
Active user
Points:: 32
Joined:: Sep 16, 2011

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

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.