Where to find data in database of sxc - 2sxc

I created an app with the sxc module.
Now I have like 500 empty rows which I want to delete.
I searched for them in the database to delete them all but I cannot seem to find them and I think it is a waste of time to delete them all 1 by 1.
It's data in "Manage content / data" table.
Let me know please.
I have another question:
If I edit an item. The title of the module gets changed with the first items 'name' field. How to avoid that? Is it an bug?
Thanks in advance.

Basically JKings answer is correct - this kind of bulk-operation can easily be done using export/import, because on re-import you can tell 2sxc to delete all items not found in the import. This ensures that 2sxc can take care of data integrity etc. Instructions https://2sxc.org/en/Learn/Content-Export-and-Import
So the correct steps are:
export the list
open in notepad, xml editor (or use excel, as shown in the link)
Remove all those you don't want
Re-import, but choose the option to "Remove all entities not found in import"
You're set :)

Related

Is it possible to see the contents of the tables, used by appBuilder?

I'm working with appBuilder/procedure editor, release 11.6.
Recently, I had this question about a file, which could not be opened by the appBuilder. The answer as:
Debug the appBuilder and check the contents of the _TRG table tupple the appBuilder is working with.
And indeed the content of that particular _TRG tupple solved my answer.
My reaction now is:
If the content of a _TRG can explain why a particular problem arises, I would like to see the content of all _TRG tupples in order to avoid that problem happening in future.
In order to do this, I tried the "Data Administration" tool, "Dump data and definitions" (obviously after having chosen every possible database and after having checked the "Hidden tables" checkbox).
I also tried following piece of code in the procedure editor, but that didn't work too as the _TRG table seems nowhere to be known:
OUTPUT TO C:\Temp_Folder\_Trg.log.
FOR EACH _TRG:
PUT UNFORMATTED _tEvent "|" _tCode.
END.
However, the _TRG tables seems not to be known.
Does anybody know what I can do in order to access this table and how to obtain all its contents?
By the way, the _TRG table contains a _tEvent column, mentioning the name of the erroneous procedure and it contains a _tCode column, containing the erroneous (too large) code, but there seems not to be a column, containing the *.w file, containing that procedure. In which table will I find this information and what's the link with the _TRG table?
What led you to believe that _trg is a database table? When you open a source file do you select something from a database or are you using a file explorer?
If you look at what you are viewing in the debugger:
You can see that this is a temp-table, which is one of a whole set of temp-tables which is populated upon opening a file.

Get Requsition ID based on PO

In FSCM I am looking to modify the Search view on Add/Update PO page (Main Menu--> Purchasing--> Purchase Orders--> Add/Update POs) to display the Requisition ID associated with the PO in the search results page. The only table I have found that has both PO_ID and REQ_ID is PS_PO_LINE_DISTRIB however unless I use a SELECT DISTINCT clause I will get multiple PO_ID rows when there are more than 1 line on a PO.
Within Purchase Order Inquiry you can see the related Requisition ID's related to a PO by clicking on Document Status link inside the Purchase Order inquiry details page.
I started looking at the PeopleCode within the the Purchase Order Inquiry to see how they are linking the PO to a Requisition and it appears to use work tables with related PeopleCode function libraries, but I wasn't able to figure our how they get linked. I am hoping someone else may know the answer to this. Thank you.
I'm on an old version of PeopleSoft (SCM 8.80, Tools 8.51), so your mileage may vary. I'm assuming you're familiar with App Designer. If not, comment below and I'll add some details about what I'm clicking on.
Find the name of the Add/Update PO component.
Open the PURCHASE_ORDER component in App Designer. Now let's find the name of the search record. Note that there is a different record for the Add Search Record, so if you want to change that too, do all of this for that record as well.
Open the PO_SRCH record, and add the REQ_ID field to it. Make sure you mark the field as a key. You should consider saving your modified PO_SRCH under a new name in case you want to be able to revert to vanilla PeopleSoft. If you do, change the Search Record in the component to your new record name.
We can see that PO_SRCH is a view. So let's modify the view to pull in REQ_ID from PO_LINE_DISTRIB. As you mentioned above, there doesn't appear to be another table with both PO_ID and REQ_ID, so you'll have to do a SELECT DISTINCT.
We should do a LEFT OUTER JOIN instead of a standard join because if you do a standard join and you enter a purchase order with no lines and save it, then you'll never be able to retrieve that purchase order in this window. Since REQ_ID is a key field, we can't have a null, so we have to do the CASE.
One odd thing that I ran into here was building the view now gave me an error about selecting fewer columns in the SQL than I had in my record definition. I solved it by modifying the view for SQL Server. I've never had to do that before and I don't know why I had to do it for this specific record. But anyway, I entered the same SQL under the record's "Microsoft SQL Server" definition.
In the properties of PO_SRCH, we can see that it has a related language record. If you're only using one language, you can probably get away without changing this, but I'll do it for completeness. Open PO_SRCHLN. Now add REQ_ID to it (mark it as a key field like you did above), and save it as PO_SRCHLN2 (I'm saving it under a new name so I don't break anything else that may be using PO_SRCHLN).
Edit the SQL the same was as you did above. Note: I didn't have to also change the Microsoft SQL Server definition like I did above. I have no idea why.
Now build PO_SRCHLN2.
Go back to PO_SRCH and change its related language record to PO_SRCHLN2.
Now build PO_SRCH.
Hopefully you didn't get any errors and your search page has the requisition ID in it now. My system doesn't use requisitions so they're all blank in the example below, but the new field is there.

How to get all rows from Page list and convert them to CSV utilizing pxConvertResultsToCSV

I have a Repeat grid layout, as a source is Report definition. The grid displays twenty row per page. So, if there are thirty-three rows, there are four pages.
I have got a task to export all grid's data to CSV. I have found out the pxConvertResultsToCSV activity. It requires to pass PageList with the properties to convert. I use pgRepPgSubSectionMySectionListB.pxResults to do this. But I have realized, that the property pxResults contains only first twenty elements of pgRepPgSubSectionMySectionListB. But I must export to CSV all the rows. How can I reach this? Thank you.
First run your report by calling pxRetrieveReportData activity of class Rule-Obj-Report-Definition in you acticity
Syntex:- call Rule-Obj-Report-Definition.pxRetrieveReportData
It will ask for parameters:-
pyReportName :- your report definition name
pyReportClass:- class of the report definition
pyPageName :- any page name for example ReportListExport. This page must be defined in Pages & Classes of class Code-Pega-List
After successful execution of this step, you will get ReportListExport.pxResults in Clipboard.
Now use this pxResults for export.
There is one more activity to export your Report in excel.
Call pzViewExportToExcel activity after running your report. And keep ReportListExport.pyReportDefinition as step page of this step.
This is preferred one.
This question is a bit old now so I'm sure the OP has probably solved the problem and moved on at this point. But for future viewers there is an easier way to solve this.
Pega includes a gadget called the "Record Editor" which can be used to display a report definition as an editable data table. It shows the provided report definition in a simple table as normal but users can also edit the rows, delete the rows and add new ones. It also includes import and export actions at the top so users can drop the entire resultset being shown in the table to CSV and then re-import changes back in after editing. You can find more information on this gadget and how to use it in this community article
If you simply want to provide an option at the top of a table sourced from a report definition that allows users to export the results as CSV without using the record editor gadget there is an API for that as well. The activity "pxDownloadDataRecordsAsCSV" in class "PegaAccel-Task-DataTableEditor" does this. It accepts the class and name of a report definition as parameters, runs that report and serves up the contents as a CSV file.
The second part here isn't too different from AJ's solution it's just an already existing parameterized activity you can use instead of writing one yourself.

VB ASP.NET check if data is in table if yes, update, else insert

I have looked through the entire internet (well that's what it feels like) to find this out.
Tables - Authors and Titles
add new title must be linked to an author, so I need to check that the author exists, if so, update the titles table with the user data from the textboxes. If the author does not exist, I need to insert the author first & last name into the author table, then the title info into the title table.
this is in VB, using ASP.NET, and my database is a file, I'm not using SQL server, just Visual Studio 2008.
Many thanks in advance for any guidance
Dim insertParameters As New ListDictionary()
insertParameters.Add("ISBN", ISBNTextBox.Text)
insertParameters.Add("Title", titleTextBox.Text)
insertParameters.Add("EditionNumber", editionNumberTextBox.Text)
insertParameters.Add("Copyright", copyrightTextBox.Text)
insertParameters.Add("FirstName", firstTB.Text)
insertParameters.Add("Surname", secondTB.Text)
LinqDataSource1.Insert(insertParameters)
It sounds to me like you should take a step back to get the big picture. Here is a link to a video to get you started on LinqToSQL http://www.youtube.com/watch?v=zy4Y34brSC8&feature=related. The reason I say that is it appears as though you might be missing the fundamentals and trying to put the cart before the horse so to speak. And here is a link to the MS documentation which I believe should really help you in the long run http://msdn.microsoft.com/en-us/library/bb386976%28v=VS.90%29.aspx

Drupal 6 & Views 2 - DISTINCT field

I'm using the Feeds module to import lots of Feed Item nodes. Due to a malformed feed file, I'm getting lots of duplicates. I'm using a View to display these nodes, and need to be able to add a DISTINCT filter on the "Node: Post Date" field, so I only get 1 result for each post-date.
I will also look into tackling the problem at the source so to speak (I don't want to have all those duplicates in the first place), but this is an interesting issue in itself - I can't find a way to add a DISTINCT filter on a field other than the Node ID (which has it's own option in the View's Basic Settings box).
I found a great article on a good way to alter the SQL queries that are generated from views before they get executed: http://echodittolabs.org/blog/2010/06/group-views. I used this to basically suffix a GROUP BY clause to the end of the query (in a really nice, clean and versatile way).
As an aside, I also found a way to tackle the issue of importing lots of duplicate feed items, the details of which are here: http://drupal.org/node/661314#comment-3667228. It adopts quite an extreme approach (deleting all items before each update), but this is the only solution for some nasty malformed feeds.
I was holding out for some undiscovered feature of Views that let you do this, but I don't think there is one - maybe in the next version ;)
There are two option to solve this:\
apply this patch
OR
hook_views_query_alter => just paste
$query->distinct = 1;
$query->no_distinct = 'views_groupby';
I guess you have two options: either put some logic in the view template file to skip the duplicate items or implement hook_views_query_alter() to change the query used by the view, adding the DISTINCT clause.
We found this issue in drupal 6.x view - had 7 of 150 items duplicated one or twice. No idea why. Issue only appeared for anonymous users. Luckily, views 6.x.2.16 provides a 'distinct' setting under the basic settings, I set it to Yes and got rid of the duplicates.

Resources