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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / The qualifier 'sal...
Finance forum

The qualifier 'salesTable' is not valid in this context. Use a variable of this type instead

(0) ShareShare
ReportReport
Posted on by 1,461

I have to add custom to class SalesTableType, method updateBackStatus().

I have created an extensionOf class for SalesTableType.

To customize updateBackStatus I want to use the chain of commands. 

SalesTableType class is defined as follow with variable 'salesTable' defined in such a way that it is available to all methods in that class:

************

abstract class SalesTableType extends InventType implements SalesPurchIModifiedDefaulter
{
    SalesTable              salesTable;
    SalesLine               salesLineCaller;

    ....

************

So why is 'salesTable' not available in my extension? I thought when one creates an extension, then all variables in the class it extended is available to me? In SalesTableType.updateBackStatus() it uses it without assigning a value to it or define a variable again for it. By the time updateBackStatus is run, it has an record in salesTable. It immediately starts off with "if (salesTable.mcrIsCallCenter())". So why when I want to overwrite this specific method with chain of command, can I not just use salesTable 

I have the same question (0)
  • Retha Profile Picture
    1,461 on at

    I thought a build of the project fixed it but when I did a full build on my model to fix errors from other projects after a "Get latest from TFS", this error came back.

    So why is salesTable buffer not available in the extension?

  • Verified answer
    Retha Profile Picture
    1,461 on at

    I changed my code in the end to have a 2nd buffer and where it complains that salestable isn't valid in the context, I used the 2nd buffer. As you can see below in my code it didn't have a problem populating the 2nd buffer using the salestable.salesID so that I can use the 2nd buffer further down to get past the error.

    void  updateBackStatus()

       {

           boolean     vmcrOrderStopped;

           SalesTable  salesTableExt;

           salesTableExt = SalesTable::find(salesTable.SalesId, false);

           vmcrOrderStopped = salesTableExt.MCROrderStopped;

           next updateBackStatus();

           if (salesTable.mcrIsCallCenter())

           {

               if(!vmcrOrderStopped

                   && RetailMCRChannelTable::mcrEnableOrderCompletion(salesTable)

                   && salesTable.TMC_PaymentStatus == TMC_SalesPaymStatus::PayOnPickup)

               {

                   ttsbegin;

                   salesTableExt = SalesTable::find(salesTable.SalesId, true);

                   salesTableExt.mcrOrderStopped = vmcrOrderStopped;

                   salesTableExt.doUpdate();

                   ttscommit;

               }

           }

       }

  • Kar_Gilson Profile Picture
    410 on at

    I have the same issue :( A second buffer is filled ok, but did you manage to find out why please?

  • Retha Profile Picture
    1,461 on at

    No unfortunately not.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans