Dear friend,
do we have an event to Notify us the form is LostFocused? What is that?
Thanks advance.
MASSOUD
Hi Massoud,
I don’t know the exact answer, but I realize that this has to do with the windows changing inside Axapta (e.g. the focus is lost by a form (window) only when the user focuses on another window (form). I have seen an application that handles windows inside Axapta. Maybe you can find your answer by looking over its code http://www.belugin.info/sidax/
thanks friend,
unfortunatly it doesn’t help me. Another idea?
massoud
Frriends,
If you want disable Docu you should write this line in form.init() method:
infolog.docuHandlingActive(false);
and of course in form.close() method you should write these lines:
infolog.docuHandlingActive(true);
infolog.formNoteButton(true,true);
and when you want enable it during form is running, for example in a mousedown() method:
public int mouseDown(int x, int y, int button, boolean ctrl, boolean shift)
{
int ret;
Args args = new Args();
FormRun notes;
ret = super(x, y, button, ctrl, shift);
if ( condition …)
{
infolog.docuHandlingActive(true);
args.name(formstr(DocuView));
args.caller(this).name(formstr(YourForm));
args.record(Your Record));
notes = classFactory.formRunClass(args);
notes.init();
notes.run();
notes.wait();
element.redraw(); //redraw the grid if the user deletes the note
infolog.formNoteButton(false, false);
infolog.docuHandlingActive(false);
}
return ret;
}
It works great, but if user run another form when that form is running, we don’t have Docu icon. that’s why I am looking for a Form.lostFocused() method to solve this problem, but I can not find any LostFocused method.
Any idea?
Why you say not helping? Can you provide some more details to describe your situation?
I have checked and the application I suggested and it seems the best answer to your lostfocus problem. There is no LostFocus method for forms in Axapta, per my knowledge.
Hi Massoud,
I am getting lost when you say lost focus. Say if you are trying to close a form by pressing Esc key then you can catch it with task method. But I guess this is not what you are looking for.
Perhaps if you can tell us exactly what you are trying to achieve, we might be able to help you.
Regards,
Hi Massoud, As you probably noticed I merged your thread titled “Document handling” and “LostFocused” since these threads were related to each other.
If you want to disable document handling for a particular form/table perhaps you might want to look at “Activate document tables form” available under Basic → Setup → Document management. This way Axapta will switch off and on document handling based on the tables that you select.
If you decide to go down this route, make sure you select “Use active document tables” field under Parameters.
In case if you want to stick with your modification route, please check here to find out how by default this is handled in Axapta.
Hope this helps,
dear Harish,
Thanks for your reply,
As I have been asked, user shouldn’t have Docu Icon in some forms, not tables. so I Disabled/Enabled Docu in different sitution. Problem raised when that form is running and user runs another form(eg Goto Main Table), in that case Docu ICON is disabled for entire axapta. That’s why I should find a mechanism same as From.LostFocused event, to enable Docu.
Thanks a lot
Dear Ciprian ,
Thanks for your reply. I checked that form(Sidax form), it’s a great idea, but problem is I couldn’t find a mechanism that shows “When current form is beeing lost focused?”. If there is let me know. form example in Sidax form, Visibility of a previous form is checked in Current form. my problem is different. maybe there is an answer I couldn’t find it. can you show me where is the idea in Sidax form.
Thanks
MASSOUD
\Classes\Info\formNotify: void formNotify(FormRun formRun,FormNotify event) { switch (event) { case FormNotify::Activate: this.activate(formRun); if (docu) docu.reSearch(formRun); break; case FormNotify::DeActivate: break;