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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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
}