Page Object as a Parameter

aylaayla Member Posts: 3
edited 2014-12-03 in NAV Three Tier
Hi,

There is a Page DataType in the parameter list option of a function. If I want to pass the current page out to a codeunit function to use the current values of that page, how do a do that?

For example if you are in the Customer Page CurrPage wont work in:

Page:
CodeunitName.FunctionName(Rec, CurrPage);

CodeunitName:
FunctionName(VAR Customer: Record Customer; VAR CustomerCard : Page "Customer Card")

The Page variable must below to 21 and not to 2147483643

Any ideas?

Many Thanks

Comments

  • TonyDuarteTonyDuarte Member Posts: 92
    If you are trying to use the function
    FunctionName(VAR Customer: Record Customer; VAR CustomerCard : Page "Customer Card")
    

    As the parameters ask, it need to be a Record from Customer Table plus The page Customer Card...

    The error:
    The Page variable must below to 21 and not to 2147483643
    
    Means that you should pass a var page of Customer Card.

    Is there in that codeunit something else that might use what you need but accepts other page id?
  • aylaayla Member Posts: 3
    Thanks, indeed. I want the entire object available, but it isn't from what I can see, only very specific properties. The object being available for selection in the codeunit parameter implies that the whole object should be available, similar to the Record one, but it isn't. So I would expect to be able e.g. CurrPage.Field.Editable = True / False from within the codeunit for any field or property and have to place the code within the Page itself.

    Keeping virtually all bespoke code out of the standard objects and in bespoke object ranges is a preferred development standard. The Form object and still the Page object appear to be primitive in allowing this to happen to the full potential I think.
Sign In or Register to comment.