Intuit Financial Community: Generating T2 forms in SDK - Intuit Financial Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Generating T2 forms in SDK

#1 User is offline   MEUK Corporation Icon

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 17-December 09

Posted 17 December 2009 - 09:24 PM

I am having some trouble creating a T2 form using the SDK. I am writing in C# using Visual Studio 2008 and trying to create files for import into ProFile 2009.1.0.

A file created this way is successfully imported:

T2008FXModule FXModule = new T2008FXModule();
T2008FXFile FXFileObj = new T2008FXFile();
T2008FXClient FXClient = (T2008FXClient)FXFileObj.Client;
FXClient.set_Field("FXInfo.S[1]", "Fred");
FXFileObj.SaveFile(filename);

But a file created this way causes an "Invalid file" error when imported:

T2008T2Module T2Module = new T2008T2Module();
T2008T2File T2FileObj = new T2008T2File();
T2008T2Client T2Client = (T2008T2Client)T2FileObj.Client;
T2Client.set_Field("T2Info.S[1]", "MyCompany");
T2FileObj.SaveFile(filename);

At first I thought it was because my copy of ProFile supported FX forms but not T2 forms, but I can create such forms manually within ProFile without any problem. Interestingly, none of the sample Excel files that ship with the SDK import into T2 forms, only FX and T1. Thank you for your help.
0

#2 User is offline   Dave@Intuit Icon

  • Senior Member
  • PipPipPip
  • Group: Intuit Staff
  • Posts: 107
  • Joined: 06-February 07
  • Gender:Male
  • Location:Mississauga

Posted 19 December 2009 - 04:19 PM

There must be something else in your code that's not posted here that is causing the problem. Using C#, I'm able to create valid ProFile files for both FX and T2 using the following code:

T2008FXFile FXFileObj = new T2008FXFile();
T2008FXClient FXClient = (T2008FXClient)FXFileObj.Client;
FXClient.set_Field("FXInfo.S[1]", "Fred");
String filename = (string)FXFileObj.SuggestFileName();
FXFileObj.SaveFile("C:\\" + filename);


T2008T2File T2FileObj = new T2008T2File();
T2008T2Client T2Client = (T2008T2Client)T2FileObj.Client;
T2Client.set_Field("T2Info.S[1]", "MyCompany");
String filename = "C:\\" + (string)T2FileObj.SuggestFileName();
T2FileObj.SaveFile(filename);


Note that I didn't create a module object, since it's doesn't appear to get used anyway. One suggestion might be to look at the T2Module compared with your corporation year-ends. For T1, T3, and FX profile uses a new module for each tax year - but T2 covers a range of tax years, and ProFile automatically selects the correct module based on the year-end.
0

#3 User is offline   MEUK Corporation Icon

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 17-December 09

Posted 22 December 2009 - 04:12 PM

OK, that fixed it (thanks, Dave!

For posterity, here is what I did. It is not necessary to instantiate the Module class, but that wasn't what did the trick. It was using the file object's SuggestFileName method to set the file name, instead of defining one myself. I was using what the samples in the SDK used, which was "*.08X". However, SuggestFileName produced a file with the extension "*.GT2".

I am not a user of ProFile, just a programmer, so perhaps I would have known this if I was. But anyway, that was the problem and now it works.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users