dbr.mail - how to suppress output

(3 posts) (2 voices)

Tags:

  1. eugfri, Member

    Hi,

    I have report with editable field and in the report I invoke via dbr.editable I have to use dbr.mail along with performing the actual update. The problem I have is that somehow dbr.mail interferes with what I need to do and produces some output I need to suppress. I have tried it before and after the update statement but result is the same. I also tried my dbr.mail in separate procedure and I know it works just fine.
    Just wondering what am I doing wrong, if it is indeed dbr.mail output that I need to suppress and if there is a way to do it.

    Here is how the code looks like:
    in the main proc:

    SELECT 'dbr.editable', '[RMAStatus]', 'sp_DBR_RMA_edit_status', 'inLogin=[inLogin]', 'inID=ID', 'type=select', "select=select 'OPEN' union select 'COMPLETED' union select 'REJECTED'";

    in sp_DBR_RMA_edit_status proc:

    ............ SELECT 'dbr.mail'; SELECT email, name, vSubject AS subject, vBody AS body FROM mydbr.mydbr_userlogin WHERE user IN (SELECT user from mydbr.mydbr_groupsusers WHERE group_id=(SELECT group_id FROM mydbr.mydbr_groups WHERE NAME=vRole));

    UPDATE ssn.RMASerials SET RMASerialStatus=inStatus, TimeModified=NOW(), LastUpdateUser=inLogin WHERE ID=inID;

    I know that my vRole, vSubject and vBody variables have correct values.
    UPDATE statement also works just fine, however, after update in the editable field instead of new value I see "dbr.mail" and email also is not being sent.

  2. myDBR Team, Key Master

    Hi,
    the dbr.editable procedure is not a full–fledgedplay report and cannot therefore include dbr.mail functionality.

    If you want to trigger the mail sending from the update, you can use a callback function which will trigger the mail sending for example via dbr.report's html5-data attribute.

    select 'dbr.javascript', "function send_mail(a, b)
    {
    embed_element('div[]',$(this).attr('data-callback'));
    }"; SELECT 'dbr.editable', '[RMAStatus]', 'sp_DBR_RMA_edit_status', 'inID=ID', 'type=select',
    "select=select 'OPEN' union select 'COMPLETED' union select 'REJECTED'",
    "options={'callback':send_mail}"; select 'dbr.report', 'sp_DBR_RMA_send_mail', '[RMAStatus]', 'inID=ID', 'html5-data-callback';

    --
    myDBR Team

  3. eugfri, Member

    This works, thank you very much!
    I wish more things like this would be documented and included in online demo, I am sure more people would take advantage of this.


Reply

You must log in to post.