Factbox refreshing issue

Hi ,

i have created a form based Factbox and attached it with Purchase requisition List page.

Based on the selection of list page, fact box generating data and displaying as records in fact box form.

Now some time data is coming correct but after 3 or 4 selection fact box showing previous selection data. I check the data in table same time. Table hold the updated data but not showing in form.

It could be a problem with your design. Tell us more details about how you have built the fact box and what data are you showing?

I just Created a temp table. This table getting data based on the selection of PR on list page. Same data i am showing in to a form and using same form as a Fact Box in PurchRequestionTableListPage form.

Data is getting refreshed but some time it’s not refreshing.

If i am refreshing (f5) List page data is coming correct. Let me know if we can refresh List page on selection time

You can use PartList class to get the parts related to a form
Have a look at \Forms\PayrollEarningStatement, the parts are being refreshed dynamically there.

that’s a form which is direct taking reference for list … How we will achieve it i class?

What you mean by that? what are you doing in the class?

We have to do it in Listpage Intrection class as we are not able to create any method on list page form directly.

You may try the same in page interaction class, in selection changed method.

Example - I used purchTableListPage

FormDataSource purchTable_ds;
FormRun formRun;
PartList partList;
int partListCount;
FormRun factBox;

purchTable_ds = purchTable.dataSource();
formRun = purchTable_ds.formRun();

partList = new PartList(formRun);

for (partListCount = 1; partListCount <= partList.partCount(); partListCount++)
{
factBox = partList.getPartById(partListCount);

if (factBox &&
factBox.name() == identifierStr(PurchTotalsSummaryPart) &&
factBox.design().visible())
{
factBox.dataSource().research(true);
}
}

Hi Kranthi,

Thanks for your efforts .

But still it’s not taking FormRun and FormDataSource in Intrection class. Throwing Not initilized error.

FormDataSource object not initialized.

i Initialized the Data Source at Starting as

FormRun formRun = formrun as FormRun ;

Can you show the code that you have written in the selection changed method?

I created a new method in intrection class and and called it in Selection changed.

–Code Start

FormDataSource PurchReqTable_ds ; // = PurchReqtable_ds as FormDataSource;
FormRun formRun ; // = formRun as formRun ;
PartList partList;
int partListCount;
FormRun factBox ;
PurchReqTable PurchReqTable;

PurchReqTable_ds = PurchReqTable.dataSource();
formRun = PurchReqTable_ds.formRun();

partList = new PartList(formRun);

for (partListCount = 1; partListCount <= partList.partCount(); partListCount++)
{
factBox = partList.getPartById(partListCount);

if (factBox && factBox.name() == identifierStr(PurchTotalsSummaryPart) && factBox.design().visible())
{
factBox.dataSource().research(true);
}

–End
Error -

FormDataSource object not initialized.

Stack trace

(C)\Classes\PurchReqTableListPageInteraction\ISY_Refresh - line 12
(C)\Classes\PurchReqTableListPageInteraction\selectionChanged - line 39
(C)\Classes\FormDataSource\selectionChanged


I Also tried to get the called form in selection class through “element.args().caller()” but it’s not taking element.

We could refresh the form manually if we got the caller form reference .

You never set the value of your PurchReqTable variable, therefore you can’t expect to get a form datasource from it. You can use this.listPage().activeRecord(queryDataSourceStr(…)) to get the active record.

By the way, list pages can be used in both the in the rich client and Enterprise Portal. I don’t think that there is any FormDataSource/FormRun in the latter case.

You don’t need this. You have already have a variable in \Classes\PurchReqTableListPageInteraction\selectionChanged

PurchReqTable activeRecord;

Thanks Kranthi,

As per the code we have to define the Part name also which i didn’t notice earlier… Thanks for your help.

Hi Martin,

Thanks for the suggestion. i just gave the Part name in above code …