Friday, May 16, 2014

Refresh the calling form

/// <summary>
/// Refresh the caller form by calling the research(true) which does not work. 
/// research(True) alone will jump the cursor to the begining (either first or last) record.
/// </summary>
/// <remarks>
/// Taken from form InventTableInventoryDimensionGroups.closeOk()
/// </remarks>
public void refreshCaller()
{
    Common          common;
    FormDataSource  callingFormDataSource;      
   
    common = element.args().record();
    if (common)
    {
        callingFormDataSource = common.dataSource();
        if (callingFormDataSource)
        {
            // Referenced datasources must be reread before calling research as data has been modified behind the scenes
            // without calling research will fail to position selection correctly
            callingFormDataSource.reread();      
            callingFormDataSource.rereadReferenceDataSources();           
            callingFormDataSource.research(true);
        }
    }
}

No comments:

Post a Comment