Options

Is it possible to assign RecordRef to Record datatype?

itspeteritspeter Member Posts: 105
recref.open(18);
rec=recref; //need to know how can it be pass
FORM.RUNMODAL(0,rec);

1.) How to pass recordref to record?
2.) How do I initialize rec? (To which table?)

I'm planning to develop a dynamic lookup forms as common function.


Thanks.


Regards,

Peter Ng :wink:
Regards,
Peter Ng

Comments

  • Options
    pduckpduck Member Posts: 147
    SETTABLE (RecordRef)
    Neue Firmennotiz schreiben 
    
    Use this function to make a record variable use the same table instance as a recordref variable.
    
    RecordRef.SETTABLE(rec)
    RecordRef
    
    Data type: recordref
    
    rec
    
    Data type: record
    
    See also RecordRef.GETTEBLE.
    
  • Options
    itspeteritspeter Member Posts: 105
    I have done that, my main problem is what to define my rec?

    rec have to initialize to a table (subtype), but i need to assign it into a dynamic table, i won't know later what table it will pass.
    rec
    Data Type: record
    Subtype: ???????
    

    Navision don't allow me not to define subtype. :?:
    Regards,
    Peter Ng
  • Options
    pdjpdj Member Posts: 643
    I guess what you really wish to do is this:
    recref.open(18);
    FORM.RUNMODAL(0,recref);
    
    However; this is not possible. :-(

    Well, if you really insist, then I guess it is possible by making a common lookup form based on a Code and a Text field based on a new buffertable. Then it should be possible to have a generic lookup form that shows the first code and first text field of the recref. (Using the same method as showing temp tables). But for a lot of tables this wouldn't make any sence...

    What are you trying to accomplish? We might suggest other solutions if we knew more about the problem. :-)
    Regards
    Peter
  • Options
    itspeteritspeter Member Posts: 105
    You mentioned my WISH :D . The reason behind is, I just don't want to declare so many records.

    I want to develop a common lookup function which is easy to use everywhere, by just passing table id.

    Right now, I declare record for each of the tables to lookup in the function, and using select case to identify the parsed table id, then run the lookup form. But, it is too tedious to maintain.

    If this function can be done, it will be very useful for other area which require dynamic lookup, which I'll be looking forward to add them in my Dynamic Crosstab report and Dynamic Listing Generator. =P~
    Regards,
    Peter Ng
Sign In or Register to comment.