Clear the range

HI

I am passing the PurchId from Purch Table to Report in MenuButton clicked mthod

in Report I am getting in this way:

public void init()

{

try

{

if(element.args().parm())

{

this.query().dataSourceTable(tablenum(VendPurchOrderJour)).addRange(fieldnum(VendPurchOrderJour,PurchId)).value(element.args().parm());

_PurchIdBase = element.args().parm();

this.query().userUpdate(false);

this.query().interactive(false);

super();

}

}

catch(exception::Error)

{

info(“Errosr in init”);

}

}

getting properly.

In the RunBase window the range is not changing. Means 1st wt I have selected the PO that PO Num only taking all ways. how resolve this.

can any body help me…

Thanks in advance…

Use initFromCaller method. See InventJournalTrans report for reference…

In my scenario how can I do this?

Hi,

try this it would work…

public void init()
{
PurchTable purchTable;
;
try
{
if (element.args().dataset() == tablenum(PurchTable))
{
purchTable = element.args().record();
}
if(purchTable)
{
this.query().dataSourceTable(tablenum(VendPurchOrderJour)).addRange(fieldnum(VendPurchOrderJour,PurchId)).value(purchTable.PurchId);
_PurchIdBase = purchTable.PurchId;
this.query().userUpdate(false);
this.query().interactive(false);
super();
}
}
catch(exception::Error)
{
info(“Errosr in init”);
}
}

Naresh Kolli

Hi,

I am getting output, but the problem is if i select one PO.

getting proper po lines.

if I close the report and select one more PO . report range previous range is not changing it the previous range PO items only getting in the report…

PurchTable = element.args().record() will always get the latest selected Purchase Order. Try debugging your code. I guess you missing something.

Even I am not getting …

Are you getting the PurchId value in the init method?

Yes I am getting .

Then there could be a problem in sending it as value to the range.

Try by placing your code after super();

If even that doesn’t work try this code init method.

QueryBuildDataSource qbds;

;

qbds = element.query().dataSourceTable(tablenum(VendPurchOrderJour));

sysquery::findOrCreateRange(qbds,fieldnum(VendPurchOrderJour,PurchId)).value(YourPurchId);