DEV Community

Fazlı Akça
Fazlı Akça

Posted on

Dinamik Popup GridField Update

function CalcQtyPrmSum()
{

GetControl('BwhItemDCollection').GetRowValues(GetControl('BwhItemDCollection').GetFocusedRowIndex(),'Id',GetValues);

function GetValues(Id) {
/*console.log(Id);*/

ClientExecSQL('UPDATE INVD_BWH_ITEM_D 
SET QTY_PRM = ( SELECT 
                COALESCE(SUM(QTY_PRM*PLUS_MINUS),0) AS QTY_PRM
                FROM INVT_ITEM_D
                WHERE BRANCH_ID = (SELECT BRANCH_ID FROM INVD_BWH_ITEM_D WHERE BWH_ITEM_D_ID = @Id::integer)
                AND   WHOUSE_ID = (SELECT WHOUSE_ID FROM INVD_BWH_ITEM_D WHERE BWH_ITEM_D_ID = @Id::integer)
                AND   ITEM_ID   = (SELECT ITEM_ID FROM INVD_BWH_ITEM_D WHERE BWH_ITEM_D_ID = @Id::integer)
                AND   ITEM_ATTRIBUTE1_ID = (SELECT ITEM_ATTRIBUTE1_ID FROM INVD_BWH_ITEM_D WHERE BWH_ITEM_D_ID = @Id::integer)
                AND   FREE_PRM_M_ID = (SELECT FREE_PRM_M_ID FROM INVD_BWH_ITEM_D WHERE BWH_ITEM_D_ID = @Id::integer)    
              )
WHERE BWH_ITEM_D_ID = @Id::integer',
function (p) {
alert('İşlem Tamam'); 
GetControl('BwhItemDCollection').PerformCallback('Refresh'); 
},
Id,Id,Id,Id,Id,Id,Id
)
}
}
Enter fullscreen mode Exit fullscreen mode

Image description

Top comments (0)