Announcements
Hi Forum,
I've got a requirement in Business Central where, when an interaction is created - a prompt needs to appear to ask the user if they want to create a Task (to-do).
The event that I can see is:
Does anybody know how to subscribe to this event only if the page is closed with an "OK", and the interaction is created successfully. This trigger is being called with the "cancel" button as well.
Best regards,
Andy
Your are welcome. good to know it helps you.
Worked a treat, thank you for your help Nitin.
Please use below with updated one.
if (CloseAction = CloseAction::LookupOK) THEN
Message('YOUR ACTION GOES HERE');
if (CloseAction = CloseAction::LookupCancel) THEN
Message('YOUR ACTION GOES Cancel HERE');
Its just a slight variation of yours to test the two actions.
pageextension 50126 CreateIntExt extends "Create Interaction"
{
trigger OnQueryClosePage(CloseAction: Action): Boolean
begin
if (CloseAction = CloseAction::OK) THEN
Message('YOUR OK ACTION GOES HERE');
if (CloseAction = CloseAction::Cancel) THEN
Message('YOUR CLOSE ACTION GOES HERE');
end;
}
Show me your code. why this is not fire, it does not correspondence what the actual table is
Thanks Nitin,
Excellent suggestion and I've just tried this - but the CloseAction condition didn't fire. The only thing I can think of is that this page is called using funky temp tables.
Andy
Thanks Amit, I did consider using the table.insert. But my worries were that this only needs to be called from a user created interaction and that if I put the subscription requirement at this point, all the system created interactions would go through this code as well.
Andy
Hi,
Instead the event you can try Page Extension like below
pageextension 50100 "Create Intc" extends "Create Interaction"
{
trigger OnQueryClosePage(CloseAction: Action): Boolean
begin
if (CloseAction = CloseAction::OK) THEN
Message('YOUR ACTION GOES HERE');
if (CloseAction = CloseAction::Cancel) THEN
Message('YOUR ACTION GOES HERE');
end;
}
|
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156