Vendor List drilldown on Balance field

TrippyZTrippyZ Member Posts: 87
If I drilldown on the balance field on the Vendor card it takes me to the Vendor Ledger Entries form. Good.

If I modify the Vendor List form to the show Balance field, when I drilldown it takes me to the Detailed Vendor Ledger Entries form. This is not good.

I have looked into the various drilldown properties available but I can't pin down exactly what needs to be done to drill me to the correct place.

Can anyone give me the solution?
Professional Navision Developer

Answers

  • Revolution1210Revolution1210 Member Posts: 161
    edited 2008-06-20
    Since the introduction of detailed entries, the Balance (LCY) field is a FlowField based on Detailed Vendor Ledg. Entry

    When you drill down on the field on the Vendor form however, it shows Vendor Ledger Entries... #-o ..this is a coded drill down which you can see in the OnDrillDown() trigger behind the field.

    You will need this code if you want to put the balance field on the vendor list and drill to the vendor ledger entries.

    Hope this helps :D
    Ian

    www.NextEqualZero.com
    A technical eye on Dynamics NAV
  • SavatageSavatage Member Posts: 7,142
    you would have to change the CalcFormula property of that field in the table to show the VLE's or create a new flowfield that shows what you want , so not to disturb the orig field
  • Revolution1210Revolution1210 Member Posts: 161
    Savatage wrote:
    you would have to change the CalcFormula property of that field in the table to show the VLE's or create a new flowfield that shows what you want , so not to disturb the orig field

    Why not just do what MS do and code the drill down?

    This is how they get round the fact that the Balance (LCY) FlowField no longer looks directly at the vendor ledger entries.


    ...also, you can't for example add a new FlowField which sums the Amount (LCY) on Vendor Ledger Entry because Amount (LCY) on the Vendor Ledger Entry is a FlowField which sums Amount (LCY) on the Detailed Vendor Ledg. Entry
    Ian

    www.NextEqualZero.com
    A technical eye on Dynamics NAV
  • TrippyZTrippyZ Member Posts: 87
    When I copy the OnDrillDown off the Vendor Form and paste it into the same place on the Vendor List form it will not compile. I get DtldVendLedgEntry and VendLedgEntry not defined.

    So I went back to the Vendor form to check where they were originally defined and I can't find them under View Globals. So I looked in the Vendor Table and they are not there either.

    I am now having one of those dejavu moments whereby I thought I understood Nav pretty well but suddenly am scuppered. Apparently the Navision Professional Developer status doesn't count for much.

    Anybody know where the references for the OnDrillDown code variables are defined?


    Regards

    TrippyZ
    ========================



    Balance (LCY) - OnDrillDown()
    DtldVendLedgEntry.SETRANGE("Vendor No.","No.");
    COPYFILTER("Global Dimension 1 Filter",DtldVendLedgEntry."Initial Entry Global Dim. 1");
    COPYFILTER("Global Dimension 2 Filter",DtldVendLedgEntry."Initial Entry Global Dim. 2");
    COPYFILTER("Currency Filter",DtldVendLedgEntry."Currency Code");
    VendLedgEntry.DrillDownOnEntries(DtldVendLedgEntry);
    Professional Navision Developer
  • SavatageSavatage Member Posts: 7,142
    I'm not looking at it but I can guess that if you define
    DtldVendLedgEntry as Type Record "Detaied Vendor ledger Entry"
    VendLedgEntry as type Record "Vendor ledger Entry"

    You should be sucessful
  • TrippyZTrippyZ Member Posts: 87
    Savatage wrote:
    I'm not looking at it but I can guess that if you define
    DtldVendLedgEntry as Type Record "Detaied Vendor ledger Entry"
    VendLedgEntry as type Record "Vendor ledger Entry"

    You should be sucessful

    Thanks, but I would like to know where the original codes gets its reference, I certainly can't find it.
    Professional Navision Developer
  • SavatageSavatage Member Posts: 7,142
    If you export the vendor card to a text file you can see:
    { 92  ;TextBox      ;13970;4290 ;2750 ;440  ;ParentControl=1;
    InPage=0;
    SourceExpr="Balance ($)";
    OnDrillDown=VAR
       VendLedgEntry@1001 : Record 25;
       DtldVendLedgEntry@1002 : Record 380;
    BEGIN
      DtldVendLedgEntry.SETFILTER("Vendor No.","No.");
      COPYFILTER("Global Dimension 1 Filter",DtldVendLedgEntry."Initial Entry Global Dim. 1");
      COPYFILTER("Global Dimension 2 Filter",DtldVendLedgEntry."Initial Entry Global Dim. 2");
      COPYFILTER("Currency Filter",DtldVendLedgEntry."Currency Code");
      VendLedgEntry.DrillDownOnEntries(DtldVendLedgEntry);
    END;
    

    So if you click in/on the OnDrillDown trigger->View->Locals->Click the Variable tab
  • awarnawarn Member Posts: 261
    They are local vairables , local to the function 'OnDrillDown'.

    Put the cursor in that function on one of the lines and go View -> Locals. Then you can copy them out.

    -a
  • TrippyZTrippyZ Member Posts: 87
    Didn't know about the locals within a trigger!

    I have now modified the form and it is working fine.

    Thanks a lot.

    Regards

    TrippyZ
    Professional Navision Developer
Sign In or Register to comment.