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)

Compile Error: 178: Does not contain a definition and no extension method

(0) ShareShare
ReportReport
Posted on by

Hey, I am working at the Web Control PurchReqTableInfo.

In the PurchReqTableInfo.ascx.cs and in the code I am trying to read a custom field:

long dimensionAttributeValueSetId = this.PurchReqTable.SYCDefaultDimension;

I am new in EP so I am not sure if I have to extend something for custom fields. Hopefully someone can help me.

Greetings - Alex

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    Could you please post the whole error message? The title doesn't include the name of the property.

  • Community Member Profile Picture
    on at

    Hey Martin - sure:

    \PurchReqTableInfo.ascx.cs(766): error CS1061: 'Microsoft.Dynamics.Portal.Application.Proxy.PurchReqTable' does not contain a definition for 'SYCDefaultDimension' and no extension method 'SYCDefaultDimension' accepting a first argument of type 'Microsoft.Dynam

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    Is the name correct?

    What if you rebuild the project containing the proxy of PurchReqTable?

  • Community Member Profile Picture
    on at

    The name is correct - Just have an AX-Project with the web controls and the PurchReqTable - I already did a compile.

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    Look at PurchReqTable from VS (not from AX client). Do you see the field?

  • Community Member Profile Picture
    on at

    Yes, the field is there in VS.

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    So you're saying that field is visible in  Application Explorer but if you rebuild the project containing your proxy class, the proxy still doesn't contain the field, right? What if you drop the proxy and create it again?

  • Community Member Profile Picture
    on at

    How exactly should I do that? I just work with AX - I guess you are talking about a VS-Project?

    What exactly do you mean by Proxy? Is this the table?

    Should I follow this guide?:

    http://patrikluca.blogspot.de/2011/01/enterprise-portal-generate-proxies.html

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    Okay... please start from the beginning and tell us what you're doing.

    How did you write the C# code in your question (long dimensionAttributeValueSetId = this.PurchReqTable.SYCDefaultDimension) if you don't do anything in Visual Studio?

    I take it that you never updated the proxy, so that's the key problem. But I would first like to know what you're doing,

    By the way, you can learn some basics from Enterprise Portal Development Cookbook.

  • Community Member Profile Picture
    on at

    I know you can edit the Web Controls in the Visual Studio but I created an AX-Project and added the Web Control PurchReqTableInfo to it. There I edited the Object within AX (the ugly Editor). After that I deployed the Project to EP.

    If I take a look at C:\inetpub\wwwroot\wss\Virjavascript:void(0);tualDirectories\80\App_Code\Proxies, I can find the Proxy for the PurchReqTable.

    If I take a look into the PurchReqTable.cs I can find some Code for SYCDefaultDimension:

    /// <summary>
            /// Dimension
            /// </summary>
            [ColumnAttribute()]
            [SuppressMessage("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods")]
            public virtual long SYCDefaultDimension {
                get {
                    return ((long)(this.get_Field("SYCDefaultDimension")));
                }
                set {
                    this.set_Field("SYCDefaultDimension", value);
                    this.OnPropertyChanged("SYCDefaultDimension");
                    if ((SYCDefaultDimensionChanged != null)) {
                        this.SYCDefaultDimensionChanged(this, new System.ComponentModel.PropertyChangedEventArgs("SYCDefaultDimension"));
                    }
                }
            }
    
    public event System.ComponentModel.PropertyChangedEventHandler SYCDefaultDimensionChanged;
    
    

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