Dynamics NAV 2018:Extensions 2.0表扩展字段无法在页面显示报错求助
Hey there! You've already nailed the table extension part—great start! The missing piece here is extending the page that displays Sales Shipment Line records, so your new fields show up in the UI. Let's walk through this step by step.
Step 1: Create a Page Extension
You need to build a page extension targeting the page that renders Sales Shipment Lines. In Dynamics NAV 2018, this is typically the Sales Shipment Subform (Page ID 48) — the subpage that shows line items on the Sales Shipment document.
Here's the code you'll need (match the field names and IDs to your table extension):
pageextension 50001 SalesShipmentLineExt extends "Sales Shipment Subform" { layout { // Add your fields after an existing field (adjust the target field as needed) addafter("Location Code") { field(VehicleRegNo; Rec.VehicleRegNo) { ApplicationArea = All; // Ensures the field is visible across all areas Caption = 'Vehicle Registration No.'; // Friendly display name } field(ShipmentNo; Rec.ShipmentNo) { ApplicationArea = All; Caption = 'Shipment No.'; } } } }
Key Notes to Avoid Errors
- Pick the right page: Double-check you're extending the correct page. If you're not seeing fields, confirm the page name/ID — you can look up "Sales Shipment Line" related pages in the Object Designer.
- Match field names: Ensure the field names in the page extension (
VehicleRegNo,ShipmentNo) exactly match what you defined in your table extension. Typos here will cause compilation errors. - Application Area: Setting
ApplicationArea = Allis a quick way to ensure the field isn't hidden by application area filters during testing. You can refine this later if needed. - Publish the full extension: After writing the page extension, re-publish your entire extension package. Don't forget to refresh your NAV client to load the updated extension.
Troubleshooting Common Issues
If you're still getting errors or not seeing the fields:
- Check compile errors: The NAV Development Environment will flag exact issues (e.g., missing page ID, invalid field name). Fix those first.
- Use Personalization: After publishing, open a Sales Shipment document, right-click the line grid, and select Personalize. Look for your new fields in the "Available Fields" list — you can drag them onto the layout manually if the page extension's placement didn't take effect.
- Verify permissions: Ensure your user role has access to the new fields. You can temporarily assign the SUPER role for testing to rule out permission issues.
内容的提问来源于stack exchange,提问作者links77
相关产品推荐
相关产品推荐

