Hi,
 
The error occured, because you have made modifications at:
#DEFINE.CurrentVersion(1)
    #LOCALMACRO.CurrentList
       mname
       yrname
     #ENDMACRO

If you want to change that, but somebody has run the class once, then you have to change the version number to other number.
If you try to delete table SysLastValue, then it's okay, but the version number will be unused.
The error message comes from this:
When axapta runs the packable class, it call unpack method first to get the last saved value for that class. After the running code is done, then method pack will be called to store to a container data type. That container is stored in sysLastValue table.
If particular userid has run the class, then the class has called pack method. After that if you change the type or the total element of #LOCALMACRO.CurrentList, then when that user try to run the class again, the code will try to unpack different data type or trying to store container with a different total element in container. Thus, the error message will say 'Bad container'.
 
I think it's a little bit confusing, but maybe you will understand after see the code of SysPackable class:
 
public container pack()
{
#if.never
    return [#CurrentVersion,#CurrentList];
#endif
}
 
public boolean unpack(container packedClass)
{
#if.never
    int version     = runbase::getVersion(packedClass);
    switch (version)
    {
        case #CurrentVersion:
            [version,#CurrentList] = packedClass;
            return true;
        default :
            return false;
    }
    return false;
#endif
}

Cheers,
Sonny Wibawa Adi

abinsam <[EMAIL PROTECTED]> wrote:
hi,
 
  Did you try to open the class in different systems ?
 
  We has a same kinda error some time back !.
 
  Yes deleting the syslastvalue some times help it ! did you try that ??
 
Aks
 
 
-----Original Message-----
From: Deshpande, Harry [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 19, 2004 9:52 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [development-axapta] Error messages while opening a class

hi
 
since the error refers to a container, there may be a problem with syslastvalue. Did u try deleting the record in syslastvalue or change version no of the report?
 
regards
 
harry
-----Original Message-----
From: panda arabinda [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 19, 2004 2:40 PM
To: [EMAIL PROTECTED]
Subject: [development-axapta] Error messages while opening a class

Dear Friends,

I have created the class PurchaseOrderStatusReport for
running a report which takes the input of month
and year .previously it was running fine and opening
but after few days when i open the class its not

opening and give the error

Message (23:53:42)
Bad container.
Object 'ReportRun' could not be created

But a5t the same time the other classes similar to
this type of class works fine.

There is no compilation error in this running fine
when i first created but i dont know what happen to

the system and why its not opening now the source code
for this is as follows.

////////////
public class PurchaseOrderStatusReport extends
RunBaseReport
{
MonthsOfYear  mname;
  Yr            yrname;

    DialogField     dfmonth;
    DialogField     dfyear;
   #DEFINE.CurrentVersion(1)
    #LOCALMACRO.CurrentList
       mname
       yrname
     #ENDMACRO
}
//////////////////////

Object Dialog()
{
 

   DialogRunbase dialog = super();

   dfmonth =
dialog.addFieldValue(typeid(MonthsOfYear),mname,"Month","Month");
   dfyear    =
dialog.addFieldValue(typeid(Yr),yrname,"Year","Year");

    return dialog;
}
/////////////
public boolean getFromDialog()
{
    boolean ret;

   ret = super();

    mname = dfmonth.value();
    yrname = dfyear.value();

    return ret;
}
////////////

public identifiername lastValueElementName()
{
return reportStr(EquipmentPurchaseOrderStatusReport);
}
///////////

MonthsOfYear parmMonthName(MonthsOfYear _mName =
mname)
{
    ;
    mname = _mName;
    return mname;

}
//////

Yr parmYear(Yr _yrName = yrname)
{
    ;
    yrname = _YrName;
    return yrname;

}
///////

static void main(Args args)
{
PurchaseOrderStatusReport purchaseOrderStatusReport;
;
purchaseOrderStatusReport = new
PurchaseOrderStatusReport();

    if(purchaseOrderStatusReport.prompt())
    {
        purchaseOrderStatusReport.run();
     }
}
///////////////

In this code there is no compilation error but on the
run time its not opening and shows the above

messages.I am not able to find out the reason of this
problem.
If anybody has any suggestion/solution then kindly
help me.

Thanks in Advance
Regards,
   Arabinda
.



__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools


Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.

Yahoo! Groups Links

Reply via email to