Need Help In Company Filterring!!

BeckaBecka Member Posts: 178
hi all

So.. I have a problem.. The situation is: I have an SQL database workin' with NAV, with different companies in it. So, i need to filter the database, with the different company names, and calculate balance for each company... So, i need a help.. How to make this from C/AL??


Thanks to all
MCSD
Attain Navision

Comments

  • KonradKonrad Member Posts: 30
    Check help for CHANGECOMPANY.
  • WaldoWaldo Member Posts: 3,412
    Indeed, you can do this with CHANGECOMPANY, but also by creating a view in SQL Server and creating a linked table in NAV... .

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • BeckaBecka Member Posts: 178
    okay.. i'll make an example: so.. I'm workin' in Cronus company database, and i want to calculate a balance in "Other company", from Cronus company database.. what i gotta do for that???
    MCSD
    Attain Navision
  • WaldoWaldo Member Posts: 3,412
    Something like:
    recCustomer.CHANGECOMPANY('Other Company');
    recCustomer.GET('Your Customer No.');
    recCustomer.CALCFIELDS("Balance");
    MESSAGE('Here is your balance: %1', recCustomer.Balance);
    

    didn't test this though :wink:

    Try to read the help of CHANGECOMPANY.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • BeckaBecka Member Posts: 178
    But is that the way i need?? Can i calculate by this way the balance of Cronus Company, from "myCompany" that i'm workin' in.
    MCSD
    Attain Navision
  • WaldoWaldo Member Posts: 3,412
    It is one way to do it.
    Just try it out :|

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • DenSterDenSter Member Posts: 8,305
    Becka wrote:
    But is that the way i need?? Can i calculate by this way the balance of Cronus Company, from "myCompany" that i'm workin' in.
    Yes you can calculate it like that. Why don't you give it a try and see if that is what you want?
  • BeckaBecka Member Posts: 178
    And can you tell me 'bout other ways? how to solve this problem...
    MCSD
    Attain Navision
  • WaldoWaldo Member Posts: 3,412
    As I said, creating views in SQL Server, and link them with tables in NAV. But this solution slightly more difficult to post ... and I only recommend it when it's absolutely necessary ... .

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • BeckaBecka Member Posts: 178
    okay.. i'll try this one.. thanks
    MCSD
    Attain Navision
  • DenSterDenSter Member Posts: 8,305
    Make sure you have a second client session into the other company to check the values of your data.
Sign In or Register to comment.