Assign Var to textbox

oakeyoakey Member Posts: 6
Hey All,

I have written a custom report that runs through the Sales Inv Headers and LInes, and report on a customer field of requested qty vs qty.

Basically this report shows what a customer wanted, and what we supplied in regards to QTY.

Report Layout:

-Customer
-Sales Invoice Header
-Sales Invoice Line

When the report is run, you supply a date range for the Sales Inv Header for Posting Date.

The Customer Header section of the report has all the heading information, but will not show the Posting Date filter that has been applied when the report was run.

I used a text box and set its source to be

"Sales Inv. Header".GETFILTER("Posting Date")

but it will not get it. The only way i can get the date supplied is if i put the following code into the Sales Inv Header part of the report.


Sales Invoice Header - OnAfterGetRecord()
Number := Number + 1;
IF Number = 1 THEN
BEGIN
Filters := "Sales Invoice Header".GETFILTER("Posting Date");
MESSAGE(Filters);
END;

The message box pops up with the correct date filter supplied, however due to the customer header section of the report already being generated it wont show it on the report.

Is there a way to assign a value to a Text box in code ? or a value to a label in code ???

Comments

  • vikram7_dabasvikram7_dabas Member Posts: 611
    u have written the code in that u have taken 1 Varialbe Filters.Is in it?Put it in the Textbox source expression
    Vikram Dabas
    Navision Technical Consultant
  • oakeyoakey Member Posts: 6
    Yes sorry i should have clarified.

    Filters is a Text Global Variable.
    Number is an Integer Global variable.

    I use number just so that is only executed the code once.

    I have a textbox with its src exp. as "Filters".

    Due to the Customer heading being run first however the data never makes it there.

    Is there a way that i can set the value of the text box in code such as

    //TXTBOX name = txtbox

    txtbox := Filters;

    OR

    txtbox := "Sales Invoice Header".GETFILTER("Posting Date");

    ???
  • idiotidiot Member Posts: 651
    I would use

    Filters is a Text Global Variable.

    I have a textbox with its src exp. as "Filters".

    Filters := FORMAT("Sales Invoice Header".GETFILTER("Posting Date"));

    Hope this helps
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
Sign In or Register to comment.