The forms in SCM can contain a lot of code that we may wish to augment to suit a specific requirement. We have added a service ID field to the sales order, so it may seem a fair requirement to default the service ID if it were called from a service order.
When a form is opened, an args object is passed. If we add the SalesTable menu item to our service order form, and set the dataset to the service order, the args object will be constructed with a reference to this record. We can use this to filter a list of sales orders or use it in the form to set defaults on a new sales order record.