Friday, October 31, 2014

Peoplesoft Integration Broker - Debugging Subscription PeopleCode

Generally, I have seen Handler tester being used to debug IB subscription code. In development environments, I write a simple AE in which I call the IB message transaction ID directly and do debug for each line (just like any other AE debug). In this way, you can get to know the code (if not developed by you) thoroughly. It is just my way of doing. You can always go with your own approach.

  1. Create an AE program
  2. Add a step and select peoplecode action
  3. Write the following code in Peoplecode action 

          import IB_EXAMPLE:IBSubscriptionTest (example);

         Local Message &ibMsg;

         Local IB_EXAMPLE:IBSubscriptionTest &ibSubT =      
                   create IB_EXAMPLE:IBSubscriptionTest();

         Local string &TransactionId = "Transaction ID from Operation Instance";

         &ibMsg = %IntBroker.GetMessage(&TransactionId, %IntBroker_BRK);

         &ibSubT.OnNotify(&ibMsg);

    4. Run the AE in debugger mode.

If some error occurred in user testing or production environment, I used to export data and insert the data in development and do debugging as explained above. It helps me.


Sunday, October 26, 2014

SQR: unique constraint (SYSADM.PS_MESSAGE_LOG) violated

This issue bound to happen for many reasons. In my case, we noticed it in a new environment which was a production copy and created recently. 

Issue

All SQR programs were failing with "unique constraint (SYSADM.PS_MESSAGE_LOG) violated" in the new environment. You get to know the unique constraint from the log file, but when looked at the message log there is a weird message got logged "PSUNX1 is an invalid server name".  This server is not defined in the system and we are not sure why getting this error. 

Let me first tell you the resolution for my case before going to how I got to resolution step. 

Resolution

I went over all the content references (components) listed under PeopleTools >Process Scheduler to see whether server name is mentioned in any of the component and also to check its value. I checked all the pages. I noticed "Schedule JobSet Definition" component had two schedules for two jobs and one schedule was referring to PSUNX1 server. I changed the server to PSUNX (valid server name) from PSUNX1 and all SQR started running to Success.

How I got to the resolution
  • I checked the message log, it says PSUNX1 is an invalid server name (this server is not defined in the new environment) as the first message and process request shows as initiated or processing but no longer running messages after that. But when Log file shows unique constraint (SYSADM.PS_MESSAGE_LOG) violated.
  • I checked the prcsapi.sqc and saw insert to MESSAGE_LOG table when process is completed (status came as success in the SQC). Since PROCESS_INSTACNE and MESSAGE_SEQ are the only keys, only field to doubt was MESSAGE_SEQ.
  • Status was success during the insert into MESSAGE_LOG so the MESSAGE_SEQ number was 1. Note: if it is still in processing status then it first checks for the maximum sequence for that PI and increases the MESSAGE_SEQ for the next insert. But in our scenario the sequence was 1 because it already completed required processing. However, already an insert occurred for the message "PUNX1 is an invalid server name" into the message log table. SQR process doesn't do this insert. It happens automatically (not sure what process inserts).  If I avoid this error (PUNXI) message then all SQRs will run to success. But couldn't find what was causing this insert and where it is getting inserted.
  • Checked process scheduler log file, didn't find anything useful. It just says process is cancelled. 
  • Checked with Admins, checked server tables and didn't find this PSUNX1 server name.
  • Checked whether any unwanted messages are present in MESSAGE_LOG and MESSAGE_PARM table but didn't find anything relevant. No hope so far. 
  • Process scheduler server reboot and cache clearing also didn't help. Purged all PIs from MESSAGE_LOG that are not present in PSPRCSRQST. No Hope. 
  • Ran PRCSYSPURGE Application Engine from Process Scheduler > System Process Request. Prcs Scheduler reboot and cleared cache and ran the SQR again, still ran into this issue. 
  • I checked this blog Users with Recurrences . Though the information given in the blog is very useful, my issue still seems to be different because no jobs/process was scheduled to run.
  • Admins couldn't help either, because everything just looks fine. This server PSUNX1 is nowhere to be found.
Finally I just started looking at all components under Process Scheduler to see any reference for that invalid server name.

Wednesday, August 27, 2014

Clear Search Fields on Peoplesoft Search Page

When you want to clear Search Field value use the following code. This is best fit during Return to Search.

Local Field &fldEmplRcd = GetField();

&fldEmplRcd.SearchClear();

Sunday, August 3, 2014

Peoplesoft Finance - EMPL_RCD field not showing up on the Search Page.

When you make EMPL_RCD field as a search field, it won't get displayed on the search page unless you enable "Multiple Jobs Allowed" option on the PeopleTools Options page.

This option is common (purpose) for both HCM and FIN, but for HCM this is always selected after 8.9 version and it should be selected by default even though there is no need for it. Same is not true for FIN, hence it is always unselected by default. So you need to enable this option and to see EMPL_RCD on the search page. This option is common for all FIN modules i.e. wherever EMPL_RCD is marked as search key, it'll be displayed once the option is selected.

You do not need to clear cache or reboot app/web servers. It is a dynamic setting and it should work without reboot or clearing cache. But if you still don't see EMPL_RCD field on the search page, try clicking the search page (content reference text on the breadcrumbs) three four times once you are on search page.  

Thursday, July 31, 2014

Message cannot be changed. Message referenced in runtime tables

When you want to change the message structure, you would realize that messages are referenced in run time table and hence we're not allowed to edit the structure. 

When you change the underlying record structure, the message structure gets changed automatically. And in all transactions going forward the newly added field will be included in the XML message. But if you want to exclude certain fields from the structure then make sure it is not referenced in any of the scenarios given below.  

This is extracted form Peoplebooks but I've tried few of them on my own. 

We cannot modify a message if it satisfies any of the below condition:

1. The service to which a message is contained in a restricted service. Go to Service      
   Configuration component (PT > IB > Configuration > Service Configuration > and select "Restricted Service" page and check for the service. You can directly open the service and check whether it is restricted or not. This option is mostly used in delivered services. 

2. The message is used internally by the system. For example, the delivered IB_GENERIC message is read-only and is used internally by the system.

3. The message is referenced in the runtime tables.

   To work around this, you must remove any entries in the runtime tables that reference the message.The run time tables are given below. Make sure data is cleared from these tables. Do not delete the transactions, instead go for archive. 

  select * from psapmsgpubcon where ib_operationname = :1 and versionname = :2;
  select * from psapmsgsubcon where ib_operationname = :1 and versionname = :2
  select * from psibloghdr where ib_operationname = :1  and versionname = :2

  select * from psapmsgpubhdr where extoperationname = :1

4. The message is used in a service operation where WSDL documents have been generated.

5. The message is used in a service operation that has validation enabled.


User Name not defined in the Database

Received "UserName not defined in database." error during a synchronous message testing between HCM & FIN.

There are multiple ways to resolve this issue.

First, make sure the user id exists in both systems and provide appropriate security to the Service Operation in both systems.

Second, Exclude the service from PSFT Authentication Token validation from PT > IB > Configuration > Service Configuration. Go to "Exclude PSFT Auth Token" page, search for the service, select "Exclude" checkbox in the grid, save. Result column will be display as success. Do this in both systems.

Third, change the remote node type to EXTERNAL from PIA and set a default user id and password. Do this in both systems.