I forgot.. problem with running forms

dleroux
dleroux Member Posts: 87
I'm adding a button to the Sales Order Form (Form 42). WHen pressed, it should open a new custom form giving the details of a workflow process.

In theory, it should work in a similar manner to the infopane buttons that open customer histroy forms or contact lists. But, when I use FORM.RUN variant of the code, the effect seems to be that Form 42 closes and the new form never opens.

If I use Form.RUNMODAL, the Sales Order stays open, but I get an annoying message

"<Sales Order> cannot be closed because it is locked by <Workflow Detail Form>

Please finish <Workflow Detail Form> before closing"

And if I click OK, I get my new form in all it's glory.(I do not think a spurious error message will fly with the customers)

I suspect I am missing something fairly simple (like a form/button property?) but I'm drawing a blank(too long a break from Navision?). Could anyone give me a bonk with ye olde clew-by-four?

Thanks in advance,

BTW I get the same sort of results regardless of how I handle the lead up to trying to run the form (running directly in the onpush event, putting it in a function off the Sales Order Form, or putting it in a separate codeunit. Even defining a variable of type Form and adding the extra level of indirection does not change the behavior

Comments

  • Savatage
    Savatage Member Posts: 7,142
    so you've tried adding a Command Button
    Changing the properties
    PushAction: RunObject
    RunObject: Form "Your Form"
    RunFormLink: *If needed*
  • David_Singleton
    David_Singleton Member Posts: 5,479
    I think that somewhere in there you have a Currentform.close command which you need to remove.

    Though Harry's solution is probably better than the one you are trying.[/b]
    David Singleton