Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

SysExtension propertyValueMap null

Posted on by 135

Hi, 

Im trying a simple excercise with SysExtension. I use the base enum WeekDays and i get the error "object not initialized." I debug and i find out that "porpertyValueMap" return a null value. But i dont know why. I have this code:

CLASS VSSClassDayAttribute--------------------------------------------------------------------------------------------

class VSSClassDayAttribute extends SysAttribute
{
WeekDays days;
}

//////////////////////////

public WeekDays parmWeekDays(WeekDays _days = days)
{
days = _days;

return days;
}

////////////////////////

public void new(WeekDays _days)
{
super();

this.parmWeekDays(_days);
}

CLASS VSSClassDayBase----------------------------------------------------------------------------------------------------------

class VSSClassDayBase
{
}

////////////////////////////

protected void new()
{
}

////////////////////////////

public void run()
{
info("@SYS32707");
}

//////////////////////////

public static VSSClassDayBase construct(WeekDays _days)
{
VSSClassDayAttribute atribute = new VSSClassDayAttribute(_days);
VSSClassDayBase base;

base = SysExtensionAppClassFactory::getClassFromSysAttribute(classStr(VSSClassDayBase), atribute);

return base;
}

CLASS CHILD --------------------------------------------------------------------------------------------------------------------------------

[VSSClassDayAttribute(WeekDays::Monday)]
class VSSClassLunes extends VSSClassDayBase
{
}

/////////////////////////////////////////////////////

public void run()
{
super();
info("@SYS5217");
}

I think it is correct, i dont know where is the error. Any suggestions?

Thanks.

 


*This post is locked for comments

  • MartaDiazVila Profile Picture
    MartaDiazVila 135 on at
    RE: SysExtension propertyValueMap null

    Hi ievgen Miroshnikov,

    Thanks for the answer. I try delete cache from Tools -> Caches ( Dictionary, Data, Elements and server) and i deleted the objects .auc.

    Still not working. Maybe Cache is not the problem.

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: SysExtension porperyValueMap null

    Hi MartaDiazVila,

    It uses cache to cache possible values and flushing cache may help here if cache is incorrect. It could be done from Tool -> Caches  menu or running SysFlushAOD class.

  • MartaDiazVila Profile Picture
    MartaDiazVila 135 on at
    RE: SysExtension porperyValueMap null

    This is the job i use to run:

    static void VSSjob(Args _args)

    {

       VSSClassDayBase dayBase = VSSClassDayBase::construct(WeekDays::Monday);

       dayBase.run();

    }

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans