How to run 2 different forms from Posted Sales Invoice?

Aravindh_NavisionAravindh_Navision Member Posts: 258
Hi Friends,

In Posted Sales Invoice form, I kept one menu button. From menu item, if I click means, on 1 condition, I need to run FormA (it is bounded to TableA) and in other condition I need to run FormB (it is bounded to TableB).

FormA or FormB should be filtered to the invoice number in Posted Sales Invoice. FormA and FormB contains a field named Invoice No.

Can anyone help me in achieving it?

Thanks and Regards,
Aravindh

Comments

  • SogSog Member Posts: 1,023
    so what you are saying is
    if conditonA then
    begin
    set a filter on a record
    apply the view of the record to formA
    run formA (modally)
    end
    if condition b then
    begin
    set a filter on a record
    apply the view of the record to formB
    run form B
    end
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Sog wrote:
    so what you are saying is
    if conditonA then
    begin
    set a filter on a record
    apply the view of the record to formA
    run formA (modally)
    end
    if condition b then
    begin
    set a filter on a record
    apply the view of the record to formB
    run form B
    end

    That doesn't work, I tried it and got an error message "The variable 'ConditionA' does not exist"
    :mrgreen::mrgreen::mrgreen::mrgreen:
    David Singleton
  • ssinglassingla Member Posts: 2,973
    Sog wrote:
    so what you are saying is
    if conditonA then
    begin
    set a filter on a record
    apply the view of the record to formA
    run formA (modally)
    end
    if condition b then
    begin
    set a filter on a record
    apply the view of the record to formB
    run form B
    end

    That doesn't work, I tried it and got an error message "The variable 'ConditionA' does not exist"
    :mrgreen::mrgreen::mrgreen::mrgreen:

    Why will it not run? I was surprised to read that it will not work and tried. It worked. The code is (hardcoded but for example i think its fine):
    IF "Location Code"='DELHI' THEN BEGIN
      Location.SETRANGE(Location.Code,"Location Code");
      FORM.RUNMODAL(FORM::"Location Card",Location);
    END ELSE BEGIN
      Customer.SETRANGE(Customer."No.","Sell-to Customer No.");
      FORM.RUNMODAL(FORM::"Customer Card",Customer);
    END;
    
    CA Sandeep Singla
    http://ssdynamics.co.in
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Sandeep, I think you missed the point. :mrgreen:
    David Singleton
  • ssinglassingla Member Posts: 2,973
    Sandeep, I think you missed the point. :mrgreen:
    No I didn't (though on a 3rd attempt). I just want you to expressely say so...

    I will not elaborate, it has been discussed many a times on the forum.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • SogSog Member Posts: 1,023
    Indeed it has been discussed many times (many a times I think is a Indian expression :) )
    That's why I didn't want to respond, because the point was obvious. and yet here I am typing these letters.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
Sign In or Register to comment.