changing how a table is accessed

 3 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
SusanB
New Member
Posts: 4
New Member

I am working on a Design Studio modification to a Work Flow inbasket. The Design Studio accesses the APINVOICE table and the APDISTRIB table. Currently, both DMEs are using the following fields to query the tables:company;vendor;invoice;suffix;cancel_seq. Since querying the APDISTRIB in this manner is inefficient, I would like to change this to retrieve the obj_id field from the APINVOICE table and use it to query the APDISTRIB table. My problem is I am new to Design Studio and am having difficulties with this. Can someone direct me on how to use a field from one DME as the criteria for the second DME?

David Williams
Veteran Member
Posts: 1127
Veteran Member
New Poster
New Poster
Congrats on posting!
The problem with using a value from your 1st DME is that you have multiple records so you normally don't update the 2nd DME until you click a row from the 1st DME, which will allow you to pass an index or select value to your 2nd DME.

For example:
function data1_OnRowClick()
{
var oDME = page.objects["data1"]
var rowRecordAry = oDME.getRowRecord()
var oField = rowRecordAry[1]
var fieldValue = oField.value
var dmeObj2 = page.objects["data2"]
dmeObj2.index = "HSUSET1&KEY=100=" + fieldValue
}
David Williams
SusanB
New Member
Posts: 4
New Member
Thank you for your previous response.  I may not have been clear about the fact that we are executing the first DME with the 5 index fields noted above populated.  So I would expect we're only bringing back one record at a time.  That said, I wouldn't think we'd need or want the user to have to click on anything in order to populate/execute the second DME.  Is there some other function data1_On.... that I should be using instead of _OnRowClick?
David Williams
Veteran Member
Posts: 1127
Veteran Member
New Poster
New Poster
Congrats on posting!
If there's only one record in your 1st DME then all you have to do is reference the value you want out of it:

var oDME = page.objects["dme0"]
var value = oDME.getValue("OBJ-ID",0)
David Williams