Tweene
Tweene

Reputation: 297

How to use active() method x++

Ok I did it. It works fine. Thanks for help. Here is my code. Now I only need to call my command button in a differend form to disable it and create a info there. Anyone could look about it ? In my code I got reference errors.

[ExtensionOf(formdatasourcestr(ProdTableListPage, ProdTable))]
final class ProdParmReportFinishedActiveWG_Extension
{

 public int active()
{
    int ret;
    next Active();

    {
        ProdTable tableBuffer = this.cursor();
        ProdTable prodtable;


        if(tableBuffer.ProdId == tableBuffer.CollectRefProdId
             && tableBuffer.ProdStatus != ProdStatus::ReportedFinished)
            {
               select firstonly RecId,ProdId from ProdTable where
            ProdTable.CollectRefProdId == tableBuffer.ProdId
             && ProdTable.Prodstatus != ProdStatus::ReportedFinished
                && tableBuffer.RecId != prodtable.RecId;
            {
                    Global::info(strFmt("%1 , %2",
            prodtable.prodid, prodtable.recid));

                    // FormButtonControl mybutton = this.FormRun().design().controlname(formControlStr(ProdParmReportFinished, Ok)) as FormButtonControl;
                    //  mybutton.enabled(false);
            }

        }
        else
        {

            Global::info(strFmt("%1 , %2, %3, %4",
            tableBuffer.prodid, tableBuffer.CollectRefProdId, tableBuffer.InventRefType, tableBuffer.ProdStatus));
        }

    }
    return ret;
}

}

Upvotes: 2

Views: 12632

Answers (1)

rjv
rjv

Reputation: 1090

"I want to use this code everytime user changes his actual row but instead it runs just once and apply to all my rows."

Use the selectionChanged() method instead of active().

In fact most use cases where you think you should use active(), you're probably looking for selectionChanged() (or the OnSelectionChanged event for handlers) instead.

Upvotes: 2

Related Questions