web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Create edit methods in forms Extension

(0) ShareShare
ReportReport
Posted on by 130

Hi All,

I have create Project DICD3FO_VASPackage inheritance Application Suite model

- Add Forms extension LedgerJournalTransDaily.Extension to my Project

- Add DataSource "DICVASFields" to DataSource of Form Extension

- New tab in the Design pattern

- Add some fields of DICVASFields datasource to this TAB

- Input Data Method (DICVASFields_Extension::editAddress) and DataSource (DICVASFields) in to Field (Address) attribute

- Create class Name: DICVASFields_Extension

public static class DICVASFields_Extension
{
           [SysClientCacheDataMethodAttribute(true)]
           public static edit DICAddress editAddress(boolean _set,DICVASFields _this,DICAddress _address)
           {
                LedgerJournalTrans ledgerJournalTrans;
              return _this.setAddress(_set,_address,ledgerJournalTrans);
         }

        }

- Build & Compile everything OK.

- When run form: General journal have the Error Unable to cast object of type 'System.Boolean' to type 'Microsoft.Dynamics.Ax.Xpp.Common'.

Please view this pics in attach.

2185.Pic1.png4251.Pic2.png

 

Please help me find out the solutions

Thanks,

DonTran

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    For extension methods, the first argument is the object you're extending. So, your table should be the first argument to the method, i assume dicvasfields is your table...

    Instead of:

    public static edit DICAddress editAddress(boolean _set,DICVASFields _this,DICAddress _address)

    Try:

    public static edit DICAddress editAddress(DICVASFields _this, boolean _set, DICAddress _address)

  • dontran Profile Picture
    130 on at

    Thanks so much : Joris de Gruyter, Everything is OK.,

  • dontran Profile Picture
    130 on at

    Ok Sukrut Parab,, thank for your support.

  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Please use "Did this answer your question? > Yes" to mark verified answers. It will make clear that the question has been answered and how.

  • Verified answer
    dontran Profile Picture
    130 on at

    Thanks Martin,

  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    You don't have to thank me. Just please mark the answers.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans