locked
Unable to get latest or Refresh Screen in Lightswith HTML Client 2012 RRS feed

  • Question

  • I have used screen.EntityName.load() method to get the latest data from the server but it doesn't work.

    Data is updated but label still show old values.

    E.g. if I change the status of the field and fire a query to get the record then query return result correctly but the label values of status field still show old value.
    Saturday, December 21, 2013 2:47 PM

Answers

All replies

  • Let me explain the problem in details..

    I have table named Contacts in  which is store Contact information. Contact have category i.e. Retailer or distributor and status field which showed whether contact is Approved (AP) or Pending (PN).

    When someone edit any information of the contact then i set the status of the contact to Pending (PN) using following code:

    partial void Contacts_Updating(Contact entity){
           entity.status = "PN";
    }

    Then I have crated Manager approvals screen. In which i added two filters category and status. When In same session first edit the Approved contact and open the ManagerApproval screen and filter the data there. It filter data correctly and show contact in pending status but the status label shows Approved(AP). Following is the snapshot:

    Sunday, December 22, 2013 7:42 AM
  • This may help:

    New API For Refreshing Data in LightSwitch in Visual Studio 2013

    myapp.Main.Order_ItemTap_execute = function (screen) {
        myapp.showAddEditOrder(null, {
            beforeShown: function (addEditOrderScreen) {
                // Set the Order on the AddEditOrder screen
                // to the selected Order on the Main screen
                addEditOrderScreen.Order = screen.Orders.selectedItem;
            },
            afterClosed: function (addEditScreen, navigationAction) {
                // If the user commits the change,
                // update the selected order on the Main screen
                if (navigationAction === msls.NavigateBackAction.commit) {
                    // *****************************************
                    // The .refresh() method refreshes the Order
                    screen.Orders.selectedItem.details.refresh();
                }
            }
        });
    };


    Unleash the Power - Get the LightSwitch HTML Client book

    http://LightSwitchHelpWebsite.com

    Sunday, December 22, 2013 3:08 PM