on 04-28-2006 2:57 PM
hi,
since i update SBO 2005 SP00 to Patch Level 10 i get the following error trying to add user fields in a user defined table:
Datei nicht gefunden (ODBC -2004)
Does anybody know whats going wrong ?
Hi Markus same here.
We can't use our Products with PL10 because of this.
I sadly don't have a solution but here is the code:
(and that code always worked on PL9)
public void addField(string fieldName, string description, SAPbobsCOM.BoFieldTypes type, int editSize, SAPbobsCOM.BoYesNoEnum mandatory, string defaultValue, string linkedTable,Hashtable validValues)
{
SwissAddonFramework.Messaging.Debug.WLine("Add Field: TableName("+tableName+") FieldName("+fieldName+") Description ("+description+") Type("+type.ToString()+") EditSize("+editSize+") linkedTable("+linkedTable+")");
SAPbobsCOM.Recordset rs = (SAPbobsCOM.Recordset)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
rs.DoQuery("SELECT ALIASID FROM CUFD WHERE TABLEID = '@" + tableName + " ' AND ALIASID = '" + fieldName + "'");
string aliasID = (string)((SAPbobsCOM.Field)rs.Fields.Item("ALIASID")).Value;
System.Runtime.InteropServices.Marshal.ReleaseComObject(rs);
rs = null;
System.GC.WaitForPendingFinalizers();
System.GC.Collect();
//Falls das Feld bereits existiert wird dieses nicht versucht hinzuzufügen
if(aliasID != "") SwissAddonFramework.Messaging.Debug.WLine("Field not added - Field already exists!");
else
{
SAPbobsCOM.UserFieldsMD userField = (SAPbobsCOM.UserFieldsMD)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields);
userField.TableName = tableName;
userField.Name = fieldName;
userField.Description = description;
userField.Type = type;
userField.EditSize = editSize;
userField.Mandatory = mandatory;
userField.DefaultValue = defaultValue;
if (validValues != null) {
foreach(string key in validValues.Keys) {
userField.ValidValues.Value=key;
userField.ValidValues.Description=(string)validValues[key];
userField.ValidValues.Add();
}
}
if(linkedTable != null) userField.LinkedTable = linkedTable;
if(userField.Add() != 0) throw new System.Exception(company.GetLastErrorCode() + ": UserField " + fieldName + " on Table " + tableName + " is not possible to create or already exists: " + company.GetLastErrorDescription());
SwissAddonFramework.Messaging.Debug.WLine("Field added: TableName("+tableName+") FieldName("+fieldName+") Description ("+description+") Type("+type.ToString()+") EditSize("+editSize+") linkedTable("+linkedTable+")");
System.Runtime.InteropServices.Marshal.ReleaseComObject(userField);
userField = null;
System.GC.WaitForPendingFinalizers();
System.GC.Collect();
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.