0

What I am trying to do is add an item to an order. and I want it to pass the OrderID from the previous screen to the new screen (which I have achieved and you can see below) however the user still has to press the + arrow on the details picker and select it. I want to remove this and just do it automatically... any tips:

Error

4

2 回答 2

0

You'll need to use the beforeShown option of the ShowAddEditEquipment method. It looks like you're already launching the screen manually via a method in your Browse screen.

myapp.showAddEditEquipment(OrderID);

Or something like that. You'll want to change it to:

myapp.showAddEditEquipment(null, {
    beforeShown: function (addEditScreen) {
        addEditScreen.Order = screen.Order;
    }
});

This is a bit vague, if you could post some of your code, I could modify this to match your code more exactly.

于 2014-09-30T22:15:20.987 回答
0

Alternatively, you could query the database in the screen created method for the order that is passed in when the screen is shown.

myapp.AddEditEquipment.created = function (screen) {
    //Whatever other initializing you have to do
    myapp.activeDataWorkspace.ApplicationData.Equipment_SingleOrDefault(screen.OrderIDPass)
        .execute().then(function (result) {
            screen.OrderRequest = result;
        });
}
于 2014-10-02T16:29:05.973 回答