Switching to New PO Release Upon Creation

I’m trying to mimic the behaviour of the “File → New → New Release” button in a purchase order. I’ve created a customization where clicking a “+” button creates a new release for the PO.
I can swap to the releases tab fine, but when it comes to switching to a specific release I can’t seem to figure it out.

My initial idea was to just set the value in the ComboPlus control or try setting it to active.
i.e

relNavControl.EpiCombo.Value = releases;
relNavControl.EpicCombo.ActiveRow = relRow;

But these didn’t work. I also tried finding the node in the treeview and activating it, but it can’t find the releases as a node. For example, when I traverse the tree and get to where releases should be, I can’t actually interact with the individual release nodes.

My final idea would be to trigger the ClickLastButton event manually, similar to a PerformClick(), but I’m not sure how to do this

If anybody has other ideas I’d appreciate any help.

When you call GetNewPORel and set the PORel data view to the response value … does it not default to the new release?

Better yet - are you calling the GetNewPORel event when you click the (+) button? Use the existing actions…

1 Like

Sorry, what do you mean by this? I thought GetNewPORel just returns a boolean. Maybe this is the step I’m missing then?

Also, GetNewPORel is getting called when I click +.

I see it looks like the service is handling the data view update - so you don’t have to do anything extra to handle it :+1:

Yeah, the data is all looking good after I call the BO methods. I just need it to swap to the correct tab and select the corresponding release when it’s created now just like the original “New Release” button.

Digging a little…
image

I wonder if you update the PORel.PORelNumNav field to 0 (new Lines and Releases are usually temporarily numbered 0 until save, right?)

No luck with that unfortunately.

Uhm, one of you is speaking Spanish and the other German.

I am so confused.

1 Like

I’m speaking Chinese, Kevin.

To clarify though, relNavControl.EpiCombo.Value = releases; is setting the navigation control for releases to the latest release. The ‘releases’ variable is based on the number of already existing rows in the control and incremented after GetNewPORel is called.
My thought was that manually setting the control to the latest release would switch the form to that release under the releases tab, although it didn’t.
Jonathan thought that maybe it’s because the release is temporarily 0 when creating a new release, so maybe that would swap it. Also no luck.

Hopefully this translated well :grinning:

2 Likes