Why does the error occurs then I try to utilize pzRDExportWrapper in Pega 7.1.8? - pega

I have a task to export a repeat grid's content to Excel. I have read an
article, but I still can't realize how to properly use it. I tried to repeat article's steps to provide pzRDExportWrapper, but after I click "Save" button I get the error:
Method: Rule-Obj-Activity instance not found:
Sb-FW-CTrackFW-Work.pzRDExportWrapper. Details: Invalid value for
Activity name passed to ActivityAssembler.
Could anybody give me any suggestions? Thank you.

You invoke activity from another activity which applies to class Sb-FW-CTrackFW-Work. Rule Resolution use primary context Sb-FW-CTrackFW-Work class and try invoke activity pzRDExportWrapper from it and you get error (because rule resolution can't found invoked activity in this class).
Activity pzRDExportWrapper applies to Rule-Obj-Report-Definition class. Try invoke from it.
Try activity step as below:
Call Rule-Obj-Report-Definition.pzRDExportWrapper
Or use step page for this step which defined as applies to Rule-Obj-Report-Definition class(you can declare it on Pages&Classes tab)

Okay. I have resolved the issue (thank you njc). I have two sections on a lone web page.
A context of the first section is my custom data page Co-Name-FW-Data-Search. The Search page has some single value properties which are initialized by an user via an UI.
The second section is a repeat grid section, a report definition as a source. My Search page pointed out in a Pages and Classes tab. Also there is a Page, which is created by report definition and contains results. The report definition takes Search’s values as parameters.
So, I have created an activity and passed the Search page and a Cods-Pega-List MyResultList as parameters. There are some steps in the activity:
Check if Search is null. If true- skip step; else - transfer Search properties into Params props with Data Transform.
Set Param.exportmode = "excel"
Call pzRDExportWrapper with Step Page MyResultList.pyReportDefinition. Pass current parameter page.
P.S.: If it doesn’t work try to play with report definition’s settings.
P.P.S.: An only minus of pzExportWrapper is that it invokes report definition again.

Related

How to update a column in data page after we get the results from case execution?

I want to update a column by name A which is the output of the case.
Can we use activity for this?
What is the best way to achieve?
I used activity to perform this.
In activity I called a method "Obj-Open" with appropriate step page to get the details of the data page. We need to pass the appropriate key to fetch the particular record.
Then call the Property-Set method in the next step of the activity with appropriate step page. Here set the target and source properties accordingly.
In the next step of the activity call the Obj-Save method with appropriate step page.
Please let me know if there is any other better way to do it
Try using savable datapage in your Flow Action post processing. See my example in the attached screenshot.

how to implement source filter property page?

I have followed the instructions at http://msdn.microsoft.com/en-us/library/windows/desktop/dd375010%28v=vs.85%29.aspx to create a property page for my CSourceStream based stream.
When testing with amcap I can see that amcap now shows the menu item to show the capture pin properties (ISpecifyPropertyPages::GetPages is queried). The problem is that when amcap calls OleCreatePropertyFrame it returns with E_FAIL and I am not sure why, it does not seem to even get to the stage of quering my dll for the factory method to instantiate the CBasePropertyPage based property class.
The problem was my DllRegisterServer only registered my filter.
I can use AMovieDllRegisterServer2 to register all components in g_Templates but that function does not register source filters properly so for the moment I am just calling AMovieDllRegisterServer2 and then re-registering my filter with source filter specific code.

Set highlighted record on a list page through code on called object

On the CustListPage I have added functionality on the ribbon which opens a popup/dialog form from where you can see related Customers.
How do I, on selection of one of the related customers on my dialog, jump to that customer on the listpage?
What I’ve tried so far:
I’ve added a method (lets call it setActiveRecord) on the CustTableListPageInteraction class that should set the activeRecord on the listpage to the record I’m passing to this method. I’m passing the CustTableListPageInteraction class to the dialog form, using a parm method. Now on my dialog form I can see that I receive the CustTableListPageInteraction class. However, I’m unable to execute my method setActiveRecord on the CustTableListPageInteraction, because I get a “object not initialized”.
What is the best route to follow to update a ListPage from a called object? Because the listpage is driven by the class, I find it very difficult to pass parameters back.

How do I get an ID after saving an ExtBase Model?

After creating a model and adding it to a repository I want to have the new ID for different purposes (creating a mail, updating other fields outside the Extbase world)
$page = t3lib_div::makeInstance('Tx_MyExt_Domain_Model_Page');
$page->setTitle('Hello World');
$this->pageRepository->add($page);
At this point $page hasn't got an ID yet, uid is null.
$page->getUid(); // returns null
When does it get it? And how can I retrieve in on runtime?
In ExtBase, objects are "managed". This means every persistence transaction (add/remove/update) is simply noted in the underlying logic, but not yet executed until the appropriate time (like the end of processing a request). So, just because you add an object to a repository doesn't mean that it's actually added yet. That actually happens once $persistenceManager->persistAll() is called, which isn't something you need to do manually, ever. The point is, your $page object won't have a UID until it's saved and that's why $page->getUid() returns null. Look here for a great explanation.
I suspect that you are trying to do something outside of the ExtBase object/MVC lifecycle. At least, last time I got null when I tried to get the UID of an object, it was because I wasn't operating within the framework appropriately.
However, if you post some more code and give us a bigger picture of what you're trying to achieve, maybe we can help you get to a point where that object actually has a UID. For instance, if you're in a Controller object, tell us which Action method you're in, or if you're in a Repository object, tell us what you're trying to get from the repository and where/how you plan on using the query results.
EDIT
Just guessing here, but I'm assuming you're executing this code in some action of a controller. Since after the controller is executed a view is rendered, you can just pass the page object to the view:
$this->view->assign('page', $page);
And then in your view you can use the page object in a link:
<f:link.action action="show" arguments="{page:page}">
See this page object
</f:link.action>
And then in the show action of your controller you can show the page:
public function showAction(Tx_MyExt_Domain_Model_Page $page) {
// Do whatever you need to show the page in the `Show.html` template
}
I really am just guessing here. If you can give us a larger picture of what you're trying to do, what your action methods are supposed to do and things like that, we can answer your question a little more confidently.
(I'm also assuming that your page object isn't a replacement for the regular TYPO3 pages and that they are something totally different. It's much easier to deal with those TYPO3 pages through the backend interface than at the php level.)
You can call persistence manager explicitly in Your controller like this
#TYPO3 4.x
$persistenceManager = $this->objectManager->create('Tx_Extbase_Persistence_Manager');
$persistenceManager->persistAll();
#TYPO3 6.x
$persistenceManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager');
$persistenceManager->persistAll();

Cannot bind to list<T>.property or list<T>.item.property in details section of Telerik report

I have created a Telerik report and I am setting the datasource on runtime to an object with some properties and a List. I am using the properties in the page and report header sections and i want to use the list as the details. Now the problem is binding to the List's item properties in the details section. I have played around with the expression builder and it seems that i should access the properties like this :
[=Fields.myList.Item.myProperty]
when i run the program i get a nice big red rectangle with the following error :
An error has occured while processing TextBox 'textBox28':Common Language Runtime detected an invalid program.
I have tried to change different variants of expression which also gives me other errors
[=Fields.myList.myPropery]
An error has occured while processing TextBox 'textBox28': The expression contains object 'myProperty' that is not defined in the current context.
The closest i have gotton was with the object it self, which outputs the object.toString()
[=Fields.myList]
I found a working solution although not what i was looking for, I created my own class with properties and made a List. I then retrieved the data from the db did the changes i wanted to do in the class and set the datasource of the report to the list. This is working quite well.
I struggled with this error:
An error has occured while processing TextBox 'textBox28': The expression contains object 'myProperty' that is not defined in the current context.
The solution I came up with was to make my model object inherit from List. For example:
public class MyReportModel : List<MyEntityDto> {
}
The look of the report wizard makes it seem like this isn't necessary, but I found no other way around this error.
This is for Telerik Reporting Q3 2013.

Resources