Deleting from table using dbr.report

(4 posts) (2 voices)

Tags:

No tags yet.

  1. I've now added a 'delete' feature to my report..

    SELECT 'dbr.javascript',
    "
    function confirmdel(obj)
    {
    return confirm('Delete Rate \\''+$(obj).parent().children().eq(0).text()+'\\'?');
    }";

    SELECT 'dbr.report', 'sp_DBR_Delete_rebate', 'callbefore=confirmdel';
    select 'dbr.text', concat('Editing ',inCustomer,'.');
    SELECT 'dbr.text', 'Click on required rate to adjust it.';
    select 'dbr.report', 'sp_DBR_UpdateRebateRates', 2, 'popup', 'ID=1', 'Category<=2', 'Rebate_Rate<=3';

    select RR_Index as 'Index No', WEEE_Cat as 'Category', (Rate / 100) as 'Rate (£ per Tonne)'
    from RebateRate
    where (inCustomer = CustomerCode)
    order by WEEE_Cat;

    However, its not passing the ID that relates to that particular line to my delete procedure. The icon next to the rows appears fine but when you click on the icon to delete that row, it prompts you to enter the ID rather than pass it..The delete procedure works fine provided it gets the correct index ID..
    Help again!

  2. myDBR Team, Key Master

    You do not seem to pass any ID to the sp_DBR_Delete_rebate-report.

    The delete report line should look something like this:

    SELECT 'dbr.report', 'sp_DBR_Delete_rebate', 'ID=1', 'callbefore=confirmdel';

    --
    myDBR Team

  3. I havew amended the code so the ID is passed..

    select 'dbr.javascript',
    "
    function confirmdel(obj)
    {
    return confirm('Delete Rebate Rate \\''+$(obj).parent().children().eq(0).text()+'\\'?');
    }";

    select 'dbr.report', 'sp_DBR_Delete_rebate', 'ID=1', 'callbefore=confirmdel';

    select 'dbr.text', concat('Editing ',inCustomer,'.');
    SELECT 'dbr.text', 'Click on required rate to adjust it.';
    select 'dbr.report', 'sp_DBR_UpdateRebateRates', 2, 'popup', 'ID=1', 'Category<=2', 'Rebate_Rate<=3';

    select RR_Index as 'Index No', WEEE_Cat as 'Category', (Rate / 100) as 'Rate (£ per Tonne)'
    from RebateRate
    where (inCustomer = CustomerCode)
    order by WEEE_Cat;

    The however, when I run it now sets the index to be 1 less than it should be... I.E I want to delete index 110 but it displays 109 - which doesn't exist & then goes into an infinite loop..

  4. myDBR Team, Key Master

    There is no reason why this should happen, so you might want to check the report for errors. Also, you can check the generated link as the first parameter should be the same for both linked report.

    Btw, try to keep dbr.report-commands close to the result set as the command will be applied to next result set i.e move the sp_DBR_Delete_rebate link next to sp_DBR_UpdateRebateRates link.

    --
    myDBR Team


Reply

You must log in to post.