Select your user interface:
Exercise 7: Use the BatchTypeSpec's DefaultSelectedFields Element
Step 1 - Add the DefaultSelectedFields element to the BatchTypeSpec.
Suppose we wish to encourage the inclusion of other fields within the batch template. Within the BatchTypeSpec, you will find an optional element called DefaultSelectedFields. Within this element, you can include Field child elements and the Form Field ID within the Field element. See the following for an example.
<DefaultSelectedFields> <Field>LOWINVENTORYTHRESHOLD</Field> </DefaultSelectedFields>
With the inclusion of the DefaultSelectedFields element in the BatchTypeSpec, you will see the behavior below when you create a batch template.
Figure: The Low Inventory Threshold field is defaulted
-
Go ahead and modify the BatchTypeSpec with the new DefaultSelectedFields element (yellow highlight).
<BatchTypeSpec xmlns:common="bb_appfx_commontypes" ID="5ad654f2-d64d-4f35-86dc-4742ab93fe5e" Name="Food Item Add Batch" Description="Batch type for adding food item records." Author="Technical Training" BaseTableName="USR_BATCHFOODITEMADD" Category="Food Item" xmlns="bb_appfx_batchtype"> <common:DependencyList> <common:Dependency CatalogAssembly="Blackbaud.CustomFx.BatchTraining.Catalog.dll" CatalogItem="Blackbaud.CustomFx.BatchTraining.Catalog.FoodItemAddBatch.Add.xml" /> <common:Dependency CatalogAssembly="Blackbaud.CustomFx.BatchTraining.Catalog.dll" CatalogItem="Blackbaud.CustomFx.BatchTraining.Catalog.FoodItemAddBatch.Edit.xml" /> <common:Dependency CatalogAssembly="Blackbaud.CustomFx.BatchTraining.Catalog.dll" CatalogItem="Blackbaud.CustomFx.BatchTraining.Catalog.FoodItemAddBatchDelete.RecordOperation.xml" /> <common:Dependency CatalogAssembly="Blackbaud.CustomFx.BatchTraining.Catalog.dll" CatalogItem="Blackbaud.CustomFx.BatchTraining.Catalog.FoodItemAddBatchCommit.Add.xml" /> </common:DependencyList> <AddRowDataFormTemplate CatalogItemID="cd2f3971-5b17-4b97-8b7f-1f2dbcfddfea" /> <EditRowDataFormTemplate CatalogItemID="e3402fc1-6783-4003-8853-89ca2b90a2cc" /> <CommitRowDataForms> <CommitRowAddDataFormTemplate CatalogItemID="96d20428-a73d-44a7-ac74-44a75bfada37" /> </CommitRowDataForms> <BatchDeleteRowRecordOperation CatalogItemID="42b3c606-57ff-4ec1-9cf7-3fb2875471f2" /> <DefaultSelectedFields> <Field>LOWINVENTORYTHRESHOLD</Field> </DefaultSelectedFields> </BatchTypeSpec>
-
Save and load the modified BatchTypeSpec. Next we will configure a batch template from our batch type.