New Items: Use normal table data
martinsalo
Hello Forum,
if you make right click on a Offer Form, you have the menu Item "Eingangs- und Abschlußbemerkung", translated into english: Header and Footer. If you look at the System Informations of this fields, it says they are getting their data from table OINV column Footer and column Header. But thats not true! If you put data their, they are the same for every offer. In reality the footer and header are written to OQUT.Header and OQUT.Footer.
So my first question:
The systeminformation are filled by handmade data? In most cases the are correct... in some cases someone was sleeping while working?
I want to place the footer and header fiels on the offer form. I was using the New Items menu. I created two textboxes and set OQUT as table and Header and Footer as Column. But instead of showing me the actual footer and header, they are showing me the row number of the offer. I can look into the demo database and I see whats in the DB. I get the the same behavior if I want to show CardCode and CardName, they are only showing the row number and not the customer number and name.
My second question:
In the menu "New Items", how can show database fields that are already in SAP B1? What have I write to table and column?
Thanks
Martin
Anders Olsson
int docEntry = int.Parse(pVal.BusinessObjectKeyString);
SAPbobsCOM.Documents doc = (SAPbobsCOM.Documents) SwissAddonFramework.B1Connector.GetB1Connector().Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations);
doc.GetByKey(docEntry);
doc.OpeningRemarks = "Header data goes here...";
doc.ClosingRemarks = "Footer data goes here...";
doc.Update();
Regards,
Anders
martinsalo
Thanks Anders for the help, I will try it :)
martinsalo
Some remarks: I created the rule, delivered it to the customer and all works fine. But you know the customers....
If you start the dialog from the main menu, the rule works. But If you put the invoice ID or the base data ID into the search field on the right upper search fiel on the B1 desktop, an error occurs: The unbound user defined field I created to display the header cannot be found. If dialogs are started in this way another startup routine seems to be in place.
The solution is to use the FormLoadComplete event and test the rules in the future with this strange way.
martinsalo
If I save the value two times in a row I get this error message:
Daten wurden durch einen anderen Benutzer oder eine andere Operation modifiziert; öffnen Sie das Fenster erneut, um fortzufahren 'Angebot' (OQUT) (ODBC -2039) [Meldung 131-183]
Translated into english: Data was written by another user oder operation, reopen the window to proceed.
Currently I'm using this workaround:
CurrentForm.Mode = SwissAddonFramework.UI.Components.ModeComponent.FormModes.OK;
CurrentForm.Freeze(true);
MenuItem.GetFromUID("1289").Activate(); // Datensatz davor laden
MenuItem.GetFromUID("1288").Activate(); // Datensatz danach laden -> Ausgangsdatensatz
CurrentForm.Freeze(false);
But now the save process takes longer and it doesnt look fine.
The rule for saving into the DB:
try {
Form CurrentForm = pVal.Form;
// Den Angebotsdatensatz holen:
int docEntry = int.Parse(pVal.BusinessObjectKeyString);
SAPbobsCOM.Documents doc = (SAPbobsCOM.Documents)
SwissAddonFramework.B1Connector.GetB1Connector().Company.GetBusinessObject(
SAPbobsCOM.BoObjectTypes.oQuotations);
doc.GetByKey(docEntry);
// Die neue Kopfzeile hineinschreiben und DB-Update.
ExtendedTextEdit txtHeader = ExtendedTextEdit.GetFromUID(CurrentForm, "NI_00012");
doc.OpeningRemarks = txtHeader.Value;
doc.Update();
// Neu Laden erzwingen um einen Bug zu beseitigen wenn zweimal hintereinander gespeichert wird:
CurrentForm.Mode = SwissAddonFramework.UI.Components.ModeComponent.FormModes.OK;
CurrentForm.Freeze(true);
MenuItem.GetFromUID("1289").Activate(); // Datensatz davor laden
MenuItem.GetFromUID("1288").Activate(); // Datensatz danach laden -> Ausgangsdatensatz
CurrentForm.Freeze(false);
} catch (Exception e) {
customize.Messaging.StatusBar.WriteError(e.ToString());
}
Please sign in to leave a comment.
Comments
0 comments