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:
Additional info:
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:
You get exactly your message - the description on LOCATION_TBL [1] is blank.