Calling a Custom Form

KeithMMooreKeithMMoore Member Posts: 59
When opening a base form [eg Customer] I am reading a related table which identifies whether there is a custom table/form for that particular type of Customer. If so I have a Command button that becomes visible and when Pushed I want to call the particular custom form.

If I create 'tmpRec' of type Record but do not assign a specific Subtype, the form will not compile. I was hoping that some simple code like the following might work. RecRef.SETTABLE does not seem to be very valuable if you cannot have a dynamically assigned Record variable. I was insuring that all custom forms would link on the Customer No.

IF CustomTableNo <> 0 THEN BEGIN
RecRef.OPEN(CustomTableNo);
RecRef.SETTABLE(tmpRec);
TmpRec.SETRANGE("Customer No.","No.");
FORM.RUN(CustomFormNo,tmpRec);
END;


Any thoughts appreciated - thanks

PS - The reason for wanting to do this dynamically is that we have several clients that would benefit from the custom form idea

Comments

  • gerdhuebnergerdhuebner Member Posts: 155
    ...RecRef.SETTABLE does not seem to be very valuable if you cannot have a dynamically assigned Record variable...
    Indeed, I remember, I tried something similar one time, but it did not work with RecordRef for whatever reason. At the end the only possible solution for me was to open the form with the HYPERLINK command and build the string dynamically:
    HYPERLINK('navision://client/run?target=Form ' + FORMAT(formID) + ...)
    
  • KeithMMooreKeithMMoore Member Posts: 59
    Thanks.. that solution worked fine.
Sign In or Register to comment.