How to use: RecordRef & FieldRef ?

bksbks Member Posts: 115
Hi,

Is it possible to convert following lines of code using RecordRef & FieldRef....?
...
         IF Cust.FINDFIRST THEN REPEAT
           CustG.SETRANGE("No.",Cust."No.");
           CustG.SETFILTER("E-Mail",'<>%1','');
           CustG.SETRANGE("Date Filter","Start Date","End Date");
           IF CustG.FINDFIRST THEN BEGIN
             REPORT.RUNMODAL("Object No.",FALSE,FALSE,CustG);
         ...

Any help would be appreciated! [-o<

Comments

  • kinekine Member Posts: 12,562
    No, it is not possible, because you cannot use recordref when running form or report... there is no dynamic way how to run any form or report with any table as parameter... sorry...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • garakgarak Member Posts: 3,263
    with some changes and use the hyperlink it's possible. But not so easy.
    first you must know which form / report you will call second you must set filter in Recref.
    Do you make it right, it works too!
  • bksbks Member Posts: 115
    Is it possible to convert RecordRef to Record (something like Record := RecordRef)????
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    bks wrote:
    Is it possible to convert RecordRef to Record (something like Record := RecordRef)????
    Yes.

    RecordRef.SETTABLE(Rec) -> Rec := RecordRef
    RecordRef.GETTABLE(Rec) -> RecordRef := Rec

    Or maybe vice versa... :)

    Regards,
    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • kinekine Member Posts: 12,562
    Yes, but it is not working correctly, if I remember correctly... (not passing filters or something like that...)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • XypherXypher Member Posts: 297
    How about using...

    Record.SETVIEW(RecordRef.GETVIEW);

    ?
  • kinekine Member Posts: 12,562
    Yes, this is the workaround.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.