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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

insert data in to inheritance table gives error

(0) ShareShare
ReportReport
Posted on by 110

Hi 

I am facing error inserting data in a table of retail _RetailPeriodicDiscount in dynamics AX 2012 R3 by x++ code table has inherited property how can i insert data in inherited table my code is below

and my Facing the following error.

Database insert operation is not allowed on an abstract table.

static void CreateDiscountScheem_3(Args _args)
{
RetailPeriodicDiscount _RetailPeriodicDiscount;
NumberSeqFormHandler numberSeqOfferId;
LedgerDimensionDefaultAccountController discountDimAccController;
///----- Field-------
RetailOfferIdEx3 OfferId;
Name DiscountScheemName;
//RetailDisabledEnabled ScheeemStatus;
int ScheeemStatus;

CurrencyCode Currency;
RetailDiscountConcurrency _ConcurrencyMode;
Status _ActiveInActive;
RetailDiscountPercentValue _DiscountPercentValue;
ValidFromDate _ValidFrom;
ValidToDate _ValidTo;
RefRecId _PriceDiscGroup;
RetailMemo _Description;
RetailDiscountOfferTypeBase _PeriodicDiscountType;

NumberSeq num;
str test;
//////////////////////////
ScheeemStatus=1;
_DiscountPercentValue=20;

// NumberSeq NumberSeq;
ttsBegin;
num = NumberSeq::newGetNum(RetailParameters::numRefOfferId());
test=num.num();
_RetailPeriodicDiscount.OfferId =test;
_RetailPeriodicDiscount.Name=DiscountScheemName;
_RetailPeriodicDiscount.Status=1;//ScheeemStatus;
_RetailPeriodicDiscount.CurrencyCode='PKR';
_RetailPeriodicDiscount.ConcurrencyMode= (RetailDiscountConcurrency::Exclusive);
_RetailPeriodicDiscount.DiscountPercentValue=_DiscountPercentValue;
_RetailPeriodicDiscount.DiscountLedgerDimension=5637144584;
_RetailPeriodicDiscount.ValidFrom =23\07\2019;
_RetailPeriodicDiscount.ValidTo=31\07\2019;
_RetailPeriodicDiscount.DateValidationType =RetailDateValidationTypeBase::Standard;
_RetailPeriodicDiscount.PeriodicDiscountType=RetailDiscountOfferTypeBase::DiscountOffer;
_RetailPeriodicDiscount.insert();

// info(test);
// num = NumberSeq::newGetNumFromCode(numberSequenceTable::findByNaturalKey('Reta_16').NumberSequence);
// NumberSeq =NumberSeq::newGetNumFromCode(NumberSequenceTable::findByNaturalKey('Reta_16').NumberSequence);
//NumberSeq::newGetNum(RetailParameters::numRefOfferId());

//Info(NumberSeq::newGetNum(FCMParameters::numRefWorkOrderNum()).num());
// _RetailPeriodicDiscount.
ttsCommit;

}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,178 Most Valuable Professional on at

    The message says that the table is abstract, therefore you can't insert data directly into it. You use a non-abstract child table instead.

  • MAKDAX2012_Ahmed Profile Picture
    110 on at

    actually i want to insert record for integration purpose for auto apply sales discount so i want to use this table, Can you please elaborate this with an example  

  • Martin Dráb Profile Picture
    239,178 Most Valuable Professional on at

    You can't do that if the table is abstract, therefore you must change your design (i.e. the fact that you want to use a wrong table).

  • MAKDAX2012_Ahmed Profile Picture
    110 on at

    pastedimage1563964267381v1.png

    Please guide me how can i use the table for insertion as i show you the hierarchy of table

  • Martin Dráb Profile Picture
    239,178 Most Valuable Professional on at

    You already have code for insertion data to a table, you just have to use a non-abstract one.

    I can't tell which of the four child tables you should use - it all depends on your business requirements.

  • Ehtasham Rahman Profile Picture
    672 on at

    Hi!

    May I know what is the need of pushing data into these tables using code? I think you can define the periodic discount scheems from front-end.

  • MAKDAX2012_Ahmed Profile Picture
    110 on at

    yes exactly

  • MAKDAX2012_Ahmed Profile Picture
    110 on at

    I have two system ORM and DAX business user apply discount scheme on ORMS that will flow in to DAX i am doing integration  that's why i am doing it by code

  • Suggested answer
    Ehtasham Rahman Profile Picture
    672 on at

    Your mentioned table (i.e. RetailPeriodicDiscount) is also part of N-Job (i.e. 1020). It means data is floating from AX to POS.

    Anyhow, you need to enter the data into concrete child of the abstract table.

    On the table right click -> Add-ins -> Type hierarchy browser, these are the children of the inheritance where you need to insert values.

    pastedimage1563971212217v1.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans