CHANGECOMPANY

ByHakanByHakan Member Posts: 24
edited 2011-10-26 in Entrepreneur Solution
Hi,

I have a two company in navision (KARLOS and KARGUM) ı must compare Tax registration No. for two company (İn Customer Table)

How ı can compare Tax registration No. for two company?

Thanks

Comments

  • mkeurmkeur Member Posts: 13
    Hi,
    Do you mean you have two companies in your database. And you want to compare the VAT Registration no's in table 18 (Customer)?
    The Customer no's in table 18 are the same and you want to check if the customers have the same VAT Registration no in the two companies?
    Or you want to check if the VAT Registration No exist in the other company customer table?
  • ByHakanByHakan Member Posts: 24
    I want to check if the tax registration no. field is the same for the same customers in the different companies at the same database?
  • matttraxmatttrax Member Posts: 2,309
    Same reply as I put on DynamicsUser: http://dynamicsuser.net/forums/p/46553/235398.aspx#235398

    So again, use the CHANGECOMPANY command. What code have you already tried? What errors / problems are you having?

    Think about what you want to do step by step or in pseudo-code first

    Get the tax registration number for this customer and store it somewhere for future use.
    Get the tax registration number for the same customer, but in a different company and store it somewhere for future use.
    Compare each of those tax registration numbers and take the appropriate action.

    Think about those individually, write the code for each individually, and you will have a solution.
  • mkeurmkeur Member Posts: 13
    Hi, I have added an example how you can do this check
    OBJECT Report 50001 Customer VAT Check
    {
      OBJECT-PROPERTIES
      {
        Date=26-10-11;
        Time=15:16:13;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
      }
      DATAITEMS
      {
        { PROPERTIES
          {
            DataItemTable=Table18;
            OnAfterGetRecord=BEGIN
                               GRCustomer.CHANGECOMPANY('the-name-of-the-other-company');
                               IF GRCustomer.GET("No.") THEN BEGIN
                                 IF "VAT Registration No." <> GRCustomer."VAT Registration No." THEN GBwrong := TRUE ELSE GBwrong:=FALSE;
                               END;
                             END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Header;
                SectionWidth=12000;
                SectionHeight=846;
              }
              CONTROLS
              {
                { 1000000001;Label  ;0    ;0    ;1650 ;846  ;ParentControl=1000000000;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 1000000003;Label  ;2100 ;0    ;4500 ;846  ;ParentControl=1000000002;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 1000000005;Label  ;6750 ;0    ;1500 ;846  ;ParentControl=1000000004;
                                                             VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 1000000006;Label  ;8550 ;0    ;1500 ;846  ;VertAlign=Bottom;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=12000;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 1000000000;TextBox;0    ;0    ;1650 ;423  ;SourceExpr="No." }
                { 1000000002;TextBox;2100 ;0    ;4500 ;423  ;SourceExpr=Name }
                { 1000000004;TextBox;6750 ;0    ;1500 ;423  ;SourceExpr="VAT Registration No." }
                { 1000000007;TextBox;8550 ;0    ;1500 ;423  ;SourceExpr=GRCustomer."VAT Registration No." }
                { 1000000008;TextBox;10200;0    ;1500 ;423  ;SourceExpr=GBwrong }
              }
               }
          }
           }
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=9020;
          Height=3410;
        }
        CONTROLS
        {
        }
      }
      REQUESTPAGE
      {
        PROPERTIES
        {
        }
        CONTROLS
        {
        }
      }
      CODE
      {
        VAR
          GRCustomer@1000000000 : Record 18;
          GBwrong@1000000001 : Boolean;
    
        BEGIN
        END.
      }
      RDLDATA
      {
      }
    }
    
    
    
Sign In or Register to comment.