Hi all,
I have a process that runs some dynamic code (using B1UP) once equipment cards are added to the system from serialized inventory. This dynamic code will adjust the customer code to the 'End Customer' and not the customer who the delivery docket/invoice is made out to. A UDF called Installed Date is also set during this dynamic code (@STORE vairables are defined in an earlier function).
string query = "SELECT DISTINCT T4.[insID] FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry] LEFT JOIN SRI1 T2 ON T2.BaseEntry = T1.DocEntry AND T2.BaseType = 15 AND T2.BaseLinNum = T1.LineNum INNER JOIN OSRI T3 ON T3.SysSerial = T2.SysSerial AND T3.ItemCode = T2.ItemCode INNER JOIN OINS T4 ON T3.[intrserial] = T4.[internalSN] WHERE T0.[CardCode] = '@STORE123' AND T0.DocEntry = @STORE124";
SAPbobsCOM.CustomerEquipmentCards OINS = (SAPbobsCOM.CustomerEquipmentCards) company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCustomerEquipmentCards);
SAPbobsCOM.Recordset rs = (SAPbobsCOM.Recordset)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
rs.DoQuery(query);
while (rs.EoF == false)
{
int insID = (int) rs.Fields.Item("insID").Value;
if (OINS.GetByKey(insID))
{
OINS.CustomerCode = "@STORE122";
OINS.UserFields.Fields.Item("U_InstalledDate").Value = DateTime.Now;
int result = OINS.Update();
string message = company.GetLastErrorDescription();
}
rs.MoveNext();
}
System.Runtime.InteropServices.Marshal.ReleaseComObject(OINS);
System.Runtime.InteropServices.Marshal.ReleaseComObject(rs);
The problem is that whenever i try to open equipment cards created by this process (using a golden arrow or any form of quick access) I get the following error message.
Internal error (-1025) occured [Message 131-183]
The only way i can open the equipment card then is by using the find action on the equipment card document or by navigating through records.
When i change any information on the equipment card and update this error message goes away.
From my understanding this has something to do with linking behaviour, is there any changes i should make to my dynamic code which would rectify this problem?
Any help is appreciated.
Nick