In Designer mode

Then you need to adjust the GoodsReceipt document. You have to add the option to specify a property set in a document and have this property set recorded when the document is posted.

  1. In Designer, open the editor of the GoodsReceipt document configuration object.
  2. On the Data tab, add the PropertySet attribute with the CatalogRef.MaterialOptions type to the document tabular section (fig. 15.40).


    Fig. 15.40. New PropertySet attribute

    You need to fill the Choice parameters links property for this attribute to limit the selection of property sets by those available for a specific material.
  3. In the property palette, in the Choice parameters links field, click the Select  button.
  4. Drag the Materials.Material attribute from the list of available attributes to the list of parameters (fig. 15.41) and click OK.


    Fig. 15.41. Choice parameters links

    So you have defined that when a user attempts to select a value for the PropertySet field, the list of Material options catalog items available for selection only includes the items subordinate to the material selected in the Material column.

    Let us add this attribute to the tabular section of the document form.
  5. On the Forms tab, in the list of forms, double-click DocumentForm.
  6. In the upper right pane of the form editor, on the Attributes tab, expand the Object form attribute.

    You can see that it includes all the attributes of the GoodsReceipt document.
  7. Expand the Materials tabular section and drag the PropertySet attribute to the form elements pane (the upper left pane), to the position after the Material field (fig. 15.42).


    Fig. 15.42. Modification of GoodsReceipt document form

    Note that in the property palette of the PropertySet form control you can see that the PropertySet tabular section attribute is selected as the DataPath property value. The platform filled this property automatically when you dragged the attribute to the form.

    The DataPath property matches a form control to a form attribute (the data displayed in the form). This property must be filled because otherwise the form control is not displayed.

    Note. When you add a form control using the Add button, you have to fill its DataPath property manually in order to link the control to a form attribute.
  8. In the editor of the GoodsReceipt document configuration object, click the Other tab and open the object module.
  9. Open the Posting event handler procedure and, in the section that generates register records, assign a value to the PropertySet dimension of the BalanceOfMaterials register as shown in listing 15.3.

    Listing 15.3. Posting() procedure (fragment)

    ...
    // register BalanceOfMaterials Receipt
    ...
    Record.Material = CurRowMaterials.Material;
    Record.PropertySet = CurRowMaterials.PropertySet;
    Record.Warehouse = Warehouse;
    ... 
Next page: The Services document
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.