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

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.

Related

Change node author on user deletion

Is there a way to reassign all nodes associated with a user to another user when the first one is deleted instead of it going to anonymous?
To ask another way, I when I go to delete johnsmith, I am looking for the option to reassign all of johnsmith's content to janesmith.
I know this functionality exists within WordPress.
I do not know of any way to do this without coding.
In code I would look at
https://api.drupal.org/api/drupal/modules%21user%21user.api.php/function/hook_user_cancel_methods_alter/7.x
to define and add a new method when cancelling a user. And
https://api.drupal.org/api/drupal/modules%21user%21user.api.php/function/hook_user_cancel/7.x
to act on the new method.

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

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.

What does "CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY" mean in Marketo?

Why do I get "CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY" in the name property for some results when I make a call to the lists API?
This might be a permission issue, but you should elaborate on how your code looks like.
There could be some problem at FLS (Field Level Security) of Activity. Please make sure all fields of Activity, Task and Event (when used) are visible for the corresponding users and your used orgs. If there are any opportunity fields, they should be visible as well.

How can I set the data into a template dynamically?

I have a list of Task objects.
I have a template which contains a modal form to edit a task.
When a user clicks the link to a single Task I want to set the task to be edited to the Task that was clicked and then render the form.
I'm trying it with reactive variables and Tracker.depend. But I haven't quite gotten it working yet. The data on Template.taskUpdateForm doesn't get set properly.
Please see this commit to see what I'm working on.
https://github.com/laran/eisenhower/commit/e89890d49f5b772849d09fd1f719a6cdafa58125
When you click on a task to edit, just store it's _id or the whole task in a Session variable, and in the helper function for your modal use that same session variable. No need to worry about Tracker depend. This always works for me.
I was setting the selectedTask to the wrong thing. I just needed SelectedTask.set(this.task) instead of SelectedTask.set(this)

How do I display data from an external database in Drupal?

I am building a custom module that will allow my users to do a simple query against an MS SQL database. I've built the form using hook_form() and have gotten validation to work.
I'm planning on retrieving the data from hook_form_submit(), but once I've done that, how do I append it below the form? It does not appear that I have access to $output from hook_form_submit(). I'm at a loss as to what to do next.
Thanks
Dana
When you are rendering the form you should check for $form_state['values'] to see if the user has already submitted a form when you're rendering the form. Then you could paint the form results in the same step as painting the form.
The first time the user loads the form page the $form_state variable won't contain any submitted form info so you can render an empty results table.
There's a good illustration of the Drupal Form API workflow on Drupal.org here: Form API Internal Workflow Illustration
The problem in trying to output data in the hook_form() method is that the method gets invoked twice which clears the post values the second time through. Throw a dpm($form_state) in the hook_form() function and you'll see two sets of post data. One with values and one without.
So after dissecting the built in Search module, which pretty much operates exactly the way I want my form to work, I figured out how this is done. Well, at least one way you can do it.
What Search module does is take the values from $form_state in hook_form_submit() and pastes them into the URL, then it sets the $form_state['redirect'] to that new URL, effectively storing those variables in the URL and changing the POST to a GET.
Now, in the callback, they extract those values from the URL, do the search on them, THEN they call drupal_get_form(), append the results to the end and return it.
There's another solution HERE where they use SESSION to store the values until the second trip through. Weird, but it works.

Resources