Dynamic AX7 / D3FO: Adding display method
Hi Folks :)
Today we will be looking
at how we can add display method on forms.
Let’s say I would
like to add a new display method on CustTable form.
In Dynamics 365 we won’t
be able to add the new method or modify the existing method to the standard
table or to an extension table.
It can be achieved
by using the extension class.
Step 1: Create a new
class and name it as <Classname>_<Extension>.
public static class
CustTable_Extension
{
}
Step 2 : Now add the
display methods in the class which is required to be shown.
public static class
CustTable_Extension
{
[SysClientCacheDataMethodAttribute(true)]
//This attribute will cache your display method.
public
static display Name customerGroupName(CustTable _this)
{
return
CustGroup::find(_this.CustGroup).Name;
}
}
|
To use your display method on the form, create your
new field on the form extension and use the property as below:
To
cache your display method on the form set on the field the property “Cache Data
Method” = yes if you don’t want to use the Attribute above.
**Things to remember**
·
The
class must be postfixed with “_extension”.
·
The
class must be static.
·
The
extension methods must be static.
·
The
type of the first parameter determines which type is extended.
THERE'S A NEW AND BETTER WAY OF DOING THIS. CHECK NOW ON AXAPTAHUT:
ReplyDeletehttps://axaptahut.wordpress.com/2018/04/09/augmented-class-extensionof/#respond
ReplyDeleteMy name is Leah Brown, I'm a happy woman today? I told myself that any loan lender that could change my life and that of my family after having been scammed separately by these online loan lenders, I will refer to anyone who is looking for loan for them. It gave me and my family happiness, although at first I had a hard time trusting him because of my experiences with past loan lenders, I needed a loan of $300,000.00 to start my life everywhere as single mother with 2 children, I met this honest and God fearing online loan lender Gain Credit Loan who helped me with a $300,000.00 loan, working with a loan company Good reputation. If you are in need of a loan and you are 100% sure of paying the loan please contact (gaincreditloan1@gmail.com)
Thank you for sharing your thoughts and knowledge on this topic.
ReplyDeleteMS Dynamics AX Online Training
D365 AX Online Training
d365 ax technical online training
d365 ax technical training
Nice to see your content. Munafawala is Best Loan Company in Jaipur Offers Different Types of Bank Loans in firm in Jaipur, Rajasthan
ReplyDeleteBusiness Loan Agents in Jaipur
Business Loan Agency in Jaipur
mortgage loan agency in Jaipur