Passing a Record as Variant

EgnazEgnaz Member Posts: 111
edited 2015-02-13 in NAV Three Tier
Hi all,

I just found out that the "Power of Variants" (http://www.waldo.be/2013/04/25/the-power-of-variants/) isn't working in NAV2015. I tested it on CU3 and CU4 but it seems not to work anymore.

Someone got the same experience?

Simple Example:
OBJECT Codeunit 50000 Get RecRef from Variant
{
  OBJECT-PROPERTIES
  {
    Date=13.02.15;
    Time=14:57:28;
    Modified=Yes;
    Version List=;
  }
  PROPERTIES
  {
    OnRun=VAR
            Item@1109200000 : Record 27;
          BEGIN
            CLEAR(Item);
            Item.FINDFIRST;
            RunPageFromVariant(Item);
          END;

  }
  CODE
  {

    PROCEDURE RunPageFromVariant@1109200000(VAR Rec@1109200000 : Variant);
    VAR
      RecRef@1109200001 : RecordRef;
    BEGIN
      RecRef.GETTABLE(Rec);
    END;

    BEGIN
    END.
  }
}

Comments

  • JuhaJuha Member Posts: 39
    It can't compile in nav2015 when your parameter is passed by reference.
    In nav2013 it could compile but a record was actually passed by value.

    /Juha
Sign In or Register to comment.