In generally, Shortcut Dimension Codes will be available in document pages such as Sales Order Subform, and Sales Invoice Subform, but not available in the pages like Customer Card, Vendor Card, and Item Card. So, in some situations your client requires to display the dimensions in those pages. So this blog will be useful for you.
At the first I will show the examples if we finish all of things
in this blog.
You will see the “Dimension FastTab”
that contains Shortcut Dimension Codes. All Shortcut Dimension Codes are related
with Dimensions FastTab in General Ledger Entry Setup.
1.
In table 18: Customer already has the function
to record dimension values (ValidateShortcutDimCode) but the scope of function
still be local you need to modify local property to be yes or copy the function
and create the new if you don’t want to modify the origin. In this case I will
change local property to be “No”.
2.
Design page 21: Customer Card and create global
variable like this.
Do not forget to assign Dimensions to be 8 because we have 8
Shortcut Dimension Code in General Ledger Entry Setup.
3.
In page designer I create a new group and input “ShortcutDimCode”
as array like this.
The example ShortcutDimCode[3]’s property.
TableRelation
For the CaptionClass it should be ‘1,2,3’ because of 1 is
Dimension Area, 2 is Code Caption of Shortcut Dimension, and 3 is Dimension 2. So
ShortcutDimCode[4]’s CaptionClass should be ‘1,2,4’. The CaptionClass will
control the field caption as Shortcut Dimension Code in General Ledger Entry
Setup. By the way, you can see how it working in CodeUnit 42: CaptionManagement.
4.
The last thing you need to do is adding the
function to record the value in page’s OnValidate trigger.
Now you finish all of this by compile and open Customer
Card.
You can test by input the value into the textboxes then
check by clicking at Dimension button. The values must be the same.
This is very useful and appreciate it but the dimension value does not remain in the page after exiting, how to get that done as well?
ReplyDelete