Menu

The data flow of the plugin

Help
anders
2014-01-06
2014-01-21
  • anders

    anders - 2014-01-06

    Hi kai,
    can you explain the data flow of the plugin,i am confused about the control of plugin.
    I want create a feature can new a group or a memo automatic in my plugin, with not operation about create group in the "editform". The group is create automatic using my data;


    my code:
    @Override
    protected void onSaveOrModify(final AssigntaskDO obj)
    {
    super.onSaveOrModify(obj);
    obj.setOwner(PFUserContext.getUser()); // Set always the logged-in user as owner.
    final MemoDO memo = memoDao.newInstance();
    memo.setOwner(PFUserContext.getUser());
    memo.setSubject("Hello memo");
    memo.setMemo("momo is OK!");
    System.out.println("abc");
    }


    In the log "abc" is printed and the "obj" is insert into database,but in the database the memo is not inserted.
    So,i need your help ,give some advise and explain the data control of the plugin.

     
  • Kai Reinhard

    Kai Reinhard - 2014-01-21

    Hi, please try this:
    @SpringBean(name="memoDao")
    private MemoDao memoDao;

    onSaveOrModify(...) {
    ...
    MemoDO memo = new MemoDO().setSubject("Test memo");
    memoDao.save(memo); // Inserts the new memo into database.
    ...
    }
    Sorry for being late with this answer (I missed the corresponding e-mail).
    Regards
    Kai

    }

     

Log in to post a comment.

MongoDB Logo MongoDB