web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :

Form refresh issue when adding view to form ds with inner or outer join

Lauras U Profile Picture Lauras U 957

Situation explanation

Form refresh issue when adding view to form ds with inner or outer join -> form loses selected record when one of it's root DS childs are linked via inner/outer join.

Created simplified cust table simple list form which have 3 DS

  • CustTable (root)
  • CustGroup (a table outer joined to CustTable and addlink in init method)
  • CustGroupFinTagSourceView (a view outer joined to CustTable and addlink in init method)

Table works without any issues, but view loses selected record when clicking form refresh


Situation from form VS perspective

GIF Demo

Short demo
1. Refresh works as expected - does not lose selected record position when joined view DS is disabled, but table DS is not
2. Joined view ds enabled breaks this
3. task workaround enabled fixes, but maybe there is more elegant way achieving this?


Task method workaround


    public int task(int _p1)
    {
        #Task
        int             ret;
        CustAccount     custAccountBeforeRefresh;
        boolean         gridLosesRecordOnRefreshWorkaroundNeeded;
    
        // workaroundForRefreshEnabled =>
        gridLosesRecordOnRefreshWorkaroundNeeded = _p1 == #taskRefresh && workaroundForRefreshEnabled;
    
        if (gridLosesRecordOnRefreshWorkaroundNeeded)
        {
            custAccountBeforeRefresh = CustTable.AccountNum;
        }
        // workaroundForRefreshEnabled <=
    
        ret = super(_p1);
    
        // workaroundForRefreshEnabled =>
        if (gridLosesRecordOnRefreshWorkaroundNeeded)
        {
            CustTable_DS.positionToRecord(CustTable::find(custAccountBeforeRefresh));
        }
        // workaroundForRefreshEnabled <=
    
        return ret;
    }


Follow up question for better solution in forum

Comments