Options

Switching Records in active form

Pat_HoustounPat_Houstoun Member Posts: 5
edited 2000-09-23 in Navision Financials
It seems to me that this task should be a simple one, but I cannot find a way to do it.
The case: I am in a form (for the sake of argument, the Purchase Order form) viewing a record (for the sake of argument, Type="order", No.=3). Within the code, I have determined that I want to be looking at No.=27 instead. What I want to do, in code, is make Purchase Header No. 27 the active record in this form, without a lookup of any kind, and without opening another instance of the form. How does one replace the active record in a form?
Any help would be appreciated...Thanks in advance...

Pat Houstoun, NCSD
President, Management Software Solutions, Inc.
Pat Houstoun, NCSD
President, Management Software Solutions, Inc.

Comments

  • Options
    SteveSteve Member Posts: 81
    Hello Pat,
    I think you are looking for the following code which will switch the active record in a form.

    PurchHeader.SETRANGE("No.",??the NEW NO. ??);
    If PurchHeader.FIND('-') THEN
    Rec := PurchHeader;

    You may have to handle the xRec, but I did not test that.

    Steve Florko
    NCPS,NCSD,NCDS,WSSD,WSWD
    Application Development
    Steve
  • Options
    Pat_HoustounPat_Houstoun Member Posts: 5
    I have tried virtually everything else; I thought I had tried that in several variations as well. In fact, I assume I started there.
    I did put a modify and a commit before your code. Works perfectly. Many thanks.
    By the way, please call me when you get a minute...

    Pat Houstoun, NCSD
    President, Management Software Solutions, Inc.
    Pat Houstoun, NCSD
    President, Management Software Solutions, Inc.
  • Options
    mfabianmfabian Member Posts: 187
    I can understand your problem. Even though the solution is extremely simple it took me quite a time until it worked:

    simply program:


    Get (type::order,'27');
    Currform.update


    Marcus Fabian
    m.fabian@thenet.ch
    +41 79 439 78 72

    [This message has been edited by fabian (edited 23-09-2000).]
    With best regards from Switzerland

    Marcus Fabian
Sign In or Register to comment.