You can change properties "ReadOnly" or "Enabled in the "ProcessOrder" command. You need only one of them.
| Code |
|---|
Items.Customer.ReadOnly = True;
Items.Customer.Enabled = False; |
But when you reopen a form, "Customer" field would be enabled again. So, to solve this problem you need to add a new attribute, for example OrderProcessingStarted, fill this attribute in the "ProcessOrder" command and modify procedure "OnCreateAtServer".
Something like this:
| Code |
|---|
&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)
Items.Customer.Enabled = Not Object.OrderProcessingStarted;
EndProcedure
&AtClient
Procedure Start(Command)
Object.OrderProcessingStarted = True;
Items.Customer.Enabled = False;
EndProcedure |