Open UD Form and pass key1 with button

Hi, I have implemented this on Order to Customer Shipment Entry before on this Open Form and Pass Data with Button Click - Kinetic ERP - Epicor User Help Forum following the process here How To: Kinetic - Launch a Form using App Studio - Experts’ Corner - Epicor User Help Forum.

I am trying to replicate from Erp.UI.VendorEntry to Ice.UI.UD30Entry. but doesn’t seem to work.

This is what I have tried.

  1. Directly passing in the values returned from a function.
    Using action results to return the row i have just created in the function to return Key1 to open the UD30 details tab. The details tab opens but not populated. The record is created and I can see it on the landing page.

app-open parameters

Launch options
{

"type": "Erp.Lib.Framework.LaunchFormOptions",

"options": {

    "valueIn": "{actionResult.requestNum}"

}

}
This did not work

  1. Getting the value from a dataview

Similar approach but getting the value in from a dataview instead of actionResults. The row is still created in the function as before.

app-open

Launch Options
{

"options": {

    "valueIn": "{BankChangeRequest_v2View.UD30_Key1}"

}

}

both just open to blank

I have also tried passing in all the 5 Keys and still did not work.
I can get on the landingPage and down to the details alright without specifying the Page in the app-open parameters.

Any Ideas on this please?

@jbooker & @dcamlin & @hmwillett any help on this one. was expecting it to be same idea as this.

Open Form and Pass Data with Button Click - Kinetic ERP - Epicor User Help Forum

The receiving app must have events to handle the valueIn like so:

Tried That. Doesn’t seem to work also I can see just these options under the Window trigger

Probably missing something here. :person_facepalming:

onLoad should work.

condition: context && context.initialValueIn && context.initialValueIn.ValueIn

row-update: “%session.context.initialValueIn.ValueIn%"

Are you able to show the debug using the developer tools, console, click on screen and click ctrl and alt and 8, then click on app open, and see in the console that your arguments are correct? This can at least remove that as a potential cause

yes, is this correct for the row update or I need to use TransView

not sure of this shortcut but in console tried this epDebug.setDebugModeStatus(true)
not much to see, I did use a dialog widget to be sure there is a valueout

Look right to me. Does it work as expected.

On the UD30 screen see what the Key1 field actually bound to - it might be KeyFields.Key1. If so the event that fires upon change of that KeyFields.Key1 field or row is what calls the get by Id and loads the record to screen.

Trace what happens when you start on UD30 and manually input a value and TAB out.

Are you ONLY sending/needing Key1?

I just went through this exercise, testing with my UD101 table… for the records I have saved on this table, I use (4) of the (5) UD101 Keys.

Here is my set-up:

App-Open:

My testing showed that my UD Entry form was expecting an array, so I used square brackets. I passed all (5) of my keys in… notice my last entry below (for Key5), I’m just passing an empty value

ValueIn:

[
    "{TransView.UD101_Key1}",
    "{TransView.UD101_Key2}",
    "{TransView.UD101_Key3}",
    "{TransView.UD101_Key4}",
    ""
]

On the receiving form (UD101, for me)… There was a base event called “setIDFromValueIn”.

What’s odd about this event is that the row update ONLY accounts for Key1.

It is the ONLY row that is being updated. But if you’re UD record is using multiple Keys… you’re going to need to override this event.

The other hang-up is as soon as KeyFields.Key1 is updated… it tries to perform a GetByID… but again, most UD records would require Keys 2, 3, 4, and/or 5 being passed in order for the GetByID to be successful. Unless I’m missing something, this just seems like a bad event.

Anyway… I over-rode this event with my own:

Trigger: Event > Override > setIDFromValueIn

I used two row-updates… again, if I change Key1 FIRST… it triggers the GetByID event before my other keys are loaded with their values. Even if I did this all within one row-update… it fires the GetByID too soon.

I could possibly have gotten around this using (1) row-update and just making KeyFields.Key1 the last row to be updated… but, instead, I just used (2) row-updates.

The first sets the values of Keys 2 through 5:

As @markdamen mentioned above… the UD forms don’t use UD101.Key1 , 2,3,4,5 directly (for the most part)… they use KeyFields.Key1, KeyFields.Key2, etc.

When the form performs updates, etc… it takes the values of KeyFields.Key1, 2, 3, 4, 5 and writes them to UD101.Key1, 2, 3, 4, 5 before the update occurs.

So… we need to pass the valueIn values to KeyFields columns… not your UD Key columns:

KeyFields.Key2 value expression: "%session.context.initialValueIn.ValueIn[1]%"
KeyFields.Key3 value expression: "%session.context.initialValueIn.ValueIn[2]%"
KeyFields.Key4 value expression: "%session.context.initialValueIn.ValueIn[3]%"
KeyFields.Key5 value expression: "%session.context.initialValueIn.ValueIn[4]%"

On success… I call my second row-update, and set KeyFields.Key1:

KeyFields.Key1 value expression: "%session.context.initialValueIn.ValueIn[0]%"

This then triggers the GetByID and it uses the value of all (5) keys to successfully load the record.