2

I've seen this issue several times in other posts but haven't been able to solve it yet. Maybe you guys can shed some light here.

I'm trying to perform an Update for Component Interface "LOCATION" using the Java Object Adapter library (psjoa.jar) but I'm stuck with the following error when trying to save a new record:

"No rows exist for the specified keys. {LOCATION} (91,50), Failed to execute PSBusComp request , The highlighted field is required. You must enter a value for it before proceeding.{LOCATION.LOCATION_TBL(1).DESCR} (15,54), Error saving Component Interface. {LOCATION} (91,37), Failed to execute PSBusComp request"

If the record exists, no error arises BUT the location is not updated. I was able to create and update a Location through the web/online application but can't do the same from CI.

Most probably, this is caused by the Effective Date behavior of the table. The Application Designer shows that Location component has a LOCATION_TBL table at Scroll Level 0 and Scroll Level 1. Below are the arguments I'm passing to the "invokeMethod(sName, args)" operation of psjoa.jar:

// level 0
SETID: "SHARE",
LOCATION :"T00001", 

// level 1
LOCATION_TBL: {    
   SETID: "SHARE", 
   LOCATION :"T00001", 
   DESCR: "My Test", 
   DESCR_AC: "TEST", 
   EFFDT: |2016-03-16|, 
   EFF_STATUS: "A" 
}

I've read in a few places that Effective-dated components may require custom implementations using PeopleCode and/or SQL, for example.

I would like to know:

  1. Am I wrongly invoking the CI operation, passing the wrong arguments, not following the expected scroll structure ? If so, which should the the approach ?
  2. Do I have to customize the update/insert operations using PeopleCode ?
  3. (1) and (2) ?

Additional info:

  • PeopleTools 8.53.02
  • PeopleSoft HRMS 9.20.000
  • Attached is a screenshot of my Location CI.

enter image description here

CountD
  • 669
  • 2
  • 11
  • 34
  • What are the key fields of your `location_tbl`? `SETID`, `LOCATION` and `EFFDT`? I guess that already your `get` call fails if you try to update the table entry. Please add java code how you call the component interface. – Frank Ockenfuss Mar 18 '16 at 12:23

2 Answers2

2

Would need to see your Java code to be sure, but here's one possibility:

If you add a new level 0 to an effective dated record then it will automatically add a "dummy" level 1 effective dated record with the current date - exactly as it does on the web UI. If you then add another level 1 record then you will have 2 rows in the scroll but only a reference to the second. If you then set the fields on the second row and try to save it, you may get exactly the kind of errors (missing required fields on row 1) that you are seeing.

In other words, when adding a new level 0 the following may fail (apologies for the pseudo-code but don't have a configured Java/PS env to hand...):

ci.create()         // create new L0 record - also adds L1 record
l0 = ci.getRow(0)   // get the L0 record
l1 = l0.addRow()    // add new L1 record - you now have 2 - l1 points to row 2
l1.EFFDT = ...      // this sets fields on row 2
l1.EFF_STATUS = ...
l1.DESCR = 
ci.save()           // missing values on row 1 cause errors

Whereas a more-likely-to-succeed approach would be

ci.create()         // create new L0 record - also adds L1 record
l0 = ci.getRow(0)   // get the Lo record
l1 = l0.getRow(0)   // don't add a new row - just get the dummy one
l1.EFFDT = ...      // set the fields on row 1
l1.EFF_STATUS = ...
l1.DESCR = 
ci.save()           // cross your fingers...

You can generate exactly the message you are seeing here by:

  • Opening the CI in the CI tester (works in 2-tier - tools 8.54 - not tried 3-tier)
  • Creating a new SETID / LOCATION
  • Right click on LOCATION_TBL > InsertItem - index 1
  • Select the second row (LOCATION_TBL [2])
  • Set the description
  • Save the CI

You get exactly your message - the description on LOCATION_TBL [1] is blank.

Barney
  • 2,786
  • 2
  • 32
  • 34
  • Indeed, after creating a new record and performing an update I was missing the DESCR field in the 'dummy' row. Also, I wasn't aware of the additional functionalities of the CI Tester. I only used it to perform basic operations but I followed your guidelines and reproduced the same error message. Very useful advice. This issue helped me understand better the effective-dated components. – CountD Mar 21 '16 at 12:32
  • 1
    or you could do this: &MyCI.GetDummyRows = False; – Jared Mar 21 '16 at 14:56
  • 1
    @jared yep, the CI interface supports that flag, and it _should_ achieve the desired result, but I've found the psjoa interface to be slightly "flaky" to say the best. In general, I've had most success when I get my interface code to duplicate exactly what happens when you use the web ui. Cheers. – Barney Mar 21 '16 at 20:52
  • 1
    Component Interface is tricky, GetDummyRows and Interactive mode will change the behavior. I turn those on or off depending on what I'm trying to do with the underlying component. That is the only "flaky" behavior I have noticed. It's also important to note that particular web components are not accessible via the CI which could also attribute to the flaky behavior you are noticing. – Jared Mar 23 '16 at 15:11
1

Use the Component Interface Tester in App Designer. You must be logged in 3 tier. Using the tool you can simulate what your program is doing and potentially get feedback from the tester.

Jared
  • 310
  • 1
  • 9
  • 1
    Generally good advice, but not always 100% accurate. The CI tester does not use the psjoa library, and so sometimes errors which occur when using psjoa library do not appear when using the CI tester. – Barney Mar 19 '16 at 02:18
  • 1
    As you can see in the above Answer, the OP's answer would have been obvious by using the CI tester – Jared Mar 21 '16 at 14:55
  • 1
    In this case, yes (although looks like the OP had not used the insert function of the CI tester before). Like I said, _generally_ good advice. However, I've had plenty of times when components work via the CI tester but not via psjoa. Also, you make like to remove the bit about requiring 3 tier, as that is not true. Cheers. – Barney Mar 21 '16 at 21:00