KBA-01483: Creating a Custom doc type with Unit * Rate features in the Item Detail

Question:

Can I configure my custom Doc type to work like the Bid doc type?   I‘d like to use the Unit * Rate feature and have the Total appear on the Doc Detail part.

Answer:

Yes! Use the following DocItemConfig rules.

Item Grid Calculations

DocItemConfigRulesForItemCalcs

Review KBA-01158 and add the following rules:

  • ExpandWhenSingle (and optionally ExpandWhenAdded) to avoid item detail view.
  • JSIncludes for your document type (use ItemAmountCalcs as the result value.)
  • JSInput if you want input from grid mode (very likely).

Note:You can also add the AlwaysAllowUnits to allow units regardless of the unit of measure; however, we recommend you not use this rule and instead Enable Units for the UOM code set in the Code Maintenance tool.

Then, use the UI Customization tool and set up your Item Grid to include these fields, changing the labels and sequence for your purposes.  Note that the calculated amount (Net Amount Col) is stored in DocItemTask.ExpenseAmount.  Of course, you can consider moving that value using a workflow script or custom save extension.

Doc Item UI Config For Grid Calculations

Item Detail Calculations

Item Detail calculations are more complicated: find the base document type that behaves the way you want, perhaps the Subcontract, Voucher (Expense) or Bid.

For example, to use the Doc Details and the Item Details parts used on the Bid Doc type on your custom Doc type, add the following code to your SiteConfig.xml file. Be sure to replace the text in orange with your custom Doc type’s GUID, NAME.

<DocTypeConfig>
<Key>6D384462-6C13-42C5-A744-8E70DBD7E95D</Key>
<Value>Custom</Value>
<Body>DocBody</Body>
<Comment>Custom doc</Comment>
<DocWidth>600</DocWidth>
<HalfHeight>0</HalfHeight>
<DetailBlocks>;@PanelItems!DocItems1:/dcmodules/DocItemDetail,/bcmodules/ip-ProjectContract</DetailBlocks>
</DocTypeConfig>

Note: refer to KBA-01279 for information on how to customize the SiteConfig.xml file.

Note: You may also wish to use an expense detail block, such as

  • <DetailBlocks>;@PanelItems!DocItems1:/dcmodules/DocItemDetail,/bcmodules/SubcontractItemDetail</DetailBlocks>
    …which is used by Expense Entry related doc types
  • <DetailBlocks>;@PanelItems!DocItems1:/bcmodules/VoucherItemDetail</DetailBlocks>
    …which is used by Expense Entry related doc types

Additional Comments:

Adding a custom Document Type with client side behaviors is an advanced topic.  Contact your implementation specialist for assistance.


KBA-01483; Last updated: September 20, 2017 at 9:05 am