Setup:
- C# Framework: .NET Framework 4.8
- SDK: ACCPAC.Advantage
Code Context:
OpenView just initializes a session to the DB, there would be no issues behind this - it works just fine with everything.
Important: No errors appear what so ever.
I have tried each line here, but none seem to work.
On Hold Code:
View OEORD1header = OpenView("OE0520"); OEORD1header.Compose(new View[] { OEORD1detail1, null, OEORD1detail3, OEORD1detail2, OEORD1detail4, OEORD1detail5 }); OEORD1header.Cancel(); OEORD1header.Init(); OEORD1header.Fields.FieldByName("ONHOLD").SetValue(1, true); OEORD1header.Fields.FieldByName("ONHOLD").SetValue(1, false); OEORD1header.Fields.FieldByName("ONHOLD").SetValue(true, true); OEORD1header.Fields.FieldByName("ONHOLD").SetValue(true, false); OEORD1header.Fields.FieldByName("HOLDREASON").SetValue("Your reason for on hold", false);
On Hold Context:
Trying to set the checkbox "On Hold" to true
Order Detail Discount Code:
View OEORD1detail1 = OpenView("OE0500"); OEORD1detail1.Compose(new View[] { OEORD1header, OEORD1detail8, OEORD1detail12, OEORD1detail9, OEORD1detail6, OEORD1detail7 }); foreach (SageOrderItem orderItem in order.Items) { OEORD1detail1.RecordClear(); OEORD1detail1.Fields.FieldByName("PRIPERCENT").SetValue(discountTotal, false); OEORD1detail1.Insert(); OEORD1detail1.Insert(); }
Discount Context:
I am trying to have a discount value per line item, not a total order discount.