mibuso.com

Microsoft Business Solutions online community
It is currently Thu May 23, 2013 10:49 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: CHANGECOMPANY
PostPosted: Wed Oct 26, 2011 12:39 pm 
Offline

Joined: Sat Jul 16, 2011 10:06 am
Posts: 16
Country: Turkey (tr)
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


Top
 Profile E-mail  
 
 Post subject: Re: CHANGECOMPANY
PostPosted: Wed Oct 26, 2011 1:16 pm 
Offline

Joined: Thu Aug 18, 2011 2:31 pm
Posts: 6
Country: Netherlands (nl)
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?


Top
 Profile E-mail  
 
 Post subject: Re: CHANGECOMPANY
PostPosted: Wed Oct 26, 2011 2:13 pm 
Offline

Joined: Sat Jul 16, 2011 10:06 am
Posts: 16
Country: Turkey (tr)
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?


Top
 Profile E-mail  
 
 Post subject: Re: CHANGECOMPANY
PostPosted: Wed Oct 26, 2011 3:15 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Fri Feb 03, 2006 10:15 pm
Posts: 2272
Location: Houston, TX
Country: United States (us)
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.

_________________
Matt Traxinger - ArcherPoint
Microsoft Dynamics NAV 2009 Programming Cookbook
Do you have an idea to improve NAV? Submit it at I Love NAV


Top
 Profile  
 
 Post subject: Re: CHANGECOMPANY
PostPosted: Wed Oct 26, 2011 3:22 pm 
Offline

Joined: Thu Aug 18, 2011 2:31 pm
Posts: 6
Country: Netherlands (nl)
Hi, I have added an example how you can do this check
Code: Select all
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
  {
  }
}




Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: