I have encountered another problem while using the SDK - if this isn't the right place for these queries, someone let me know.
I have programmatically created a T2 file with a T661 form. Now I need to add a S60 form for each of the R&D projects (so one or more S60 forms). However, I seem to be unable to add them to the same T2 file (or to their own T2 file, for that matter). Here is the code (in C#):
T2008T2File T2FileObj = new T2008T2File();
T2008T2Client T2Client = (T2008T2Client)T2FileObj.Client;
T2Client.set_Field("T661.B[4]", 1); // line 160
T2Client.set_Field("T661[5]", 0); // 300
T2Client.set_Field("T661[6]", 22750); // 305
T2Client.set_Field("T2S60.S[0,0]", "My RD project"); // 200
T2Client.set_Field("T2S60[0,0]", new DateTime(2007,11,01)); // 202
string filename = @"C:\Temp\" + T2FileObj.SuggestFileName();
if (File.Exists(filename)) File.Delete(filename);
T2FileObj.SaveFile(filename);
Thank you for your assistance with this issue.
Page 1 of 1
Creating S60 forms using SDK
#2
Posted 23 December 2009 - 01:21 PM
MEUK Corporation, on Dec 22 2009, 11:01 AM, said:
I have encountered another problem while using the SDK - if this isn't the right place for these queries, someone let me know.
I have programmatically created a T2 file with a T661 form. Now I need to add a S60 form for each of the R&D projects (so one or more S60 forms). However, I seem to be unable to add them to the same T2 file (or to their own T2 file, for that matter). Here is the code (in C#):
T2008T2File T2FileObj = new T2008T2File();
T2008T2Client T2Client = (T2008T2Client)T2FileObj.Client;
T2Client.set_Field("T661.B[4]", 1); // line 160
T2Client.set_Field("T661[5]", 0); // 300
T2Client.set_Field("T661[6]", 22750); // 305
T2Client.set_Field("T2S60.S[0,0]", "My RD project"); // 200
T2Client.set_Field("T2S60[0,0]", new DateTime(2007,11,01)); // 202
string filename = @"C:\Temp\" + T2FileObj.SuggestFileName();
if (File.Exists(filename)) File.Delete(filename);
T2FileObj.SaveFile(filename);
Thank you for your assistance with this issue.
I have programmatically created a T2 file with a T661 form. Now I need to add a S60 form for each of the R&D projects (so one or more S60 forms). However, I seem to be unable to add them to the same T2 file (or to their own T2 file, for that matter). Here is the code (in C#):
T2008T2File T2FileObj = new T2008T2File();
T2008T2Client T2Client = (T2008T2Client)T2FileObj.Client;
T2Client.set_Field("T661.B[4]", 1); // line 160
T2Client.set_Field("T661[5]", 0); // 300
T2Client.set_Field("T661[6]", 22750); // 305
T2Client.set_Field("T2S60.S[0,0]", "My RD project"); // 200
T2Client.set_Field("T2S60[0,0]", new DateTime(2007,11,01)); // 202
string filename = @"C:\Temp\" + T2FileObj.SuggestFileName();
if (File.Exists(filename)) File.Delete(filename);
T2FileObj.SaveFile(filename);
Thank you for your assistance with this issue.
When a field code is represented as [0,0] it means it's a part of a group, in this case it's a group forms (there can be multiple S60s in a T2 file.
Try using:
T2Client.set_FormCount("S60", 1);
to augment the form count and create an S60 before trying to write to it.
Hope that helps!
Page 1 of 1


Please remember this is a user-to-user community that relies on member participation. We encourage you to ask questions AND share your own thoughts, experience and advice.

MultiQuote