Run dataport & filter on active record

DanDan Member Posts: 9
edited 2007-09-13 in Navision Financials
Hi,

I'm using a button with a RunObject command to export files from a purchase order to an excel sheet. I'm using following code "on push": PurchaseHeader.SETRANGE("No.",PurchaseHeader."No.");
How come this filter doesn't work? The dataport exports all the purchase headers to excel! What am I doing wrong?
Thanks! ](*,)

Comments

  • kinekine Member Posts: 12,562
    What is in PurchaseHeader??? You mean with your code this?
    PurchaseHeader.SETRANGE("No.","No.");  //take the No. from Rec...
    

    Or this?
    CurrForm.SETSELECTIONFILTER(PurchaseHeader); //set filter for selected items on form to variable Purchase Header
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • CzmielCzmiel Member Posts: 2
    Hi,
    Has anyone found a sollution?
    I have a simmilar problem. I added a CommandButton to Form with RunObject property set to MyDataport.
    MyDataport exports some data from table Table1.
    I want to limit the data Exported to data selected on the form.
  • kinekine Member Posts: 12,562
    Than you cannot use RunObject property but C/AL code in OnPush of the button.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • CzmielCzmiel Member Posts: 2
    Could you write, how can I set the filter for MyDataport in C/AL Code in the OnPush trigger?
Sign In or Register to comment.