C# syntax to instantiate sales order history
I need to get the first character of the delivery address.
It doesn't seem to be available from the salesorder object, so I figure I need to read the full history object, then get the postcode from that.
My code here is erroring when trying to assign the salesHist object
error is "non invocable member JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder.SalesOrderHistorys cannot be used like a method. "
What am I doing wrong?
It doesn't seem to be available from the salesorder object, so I figure I need to read the full history object, then get the postcode from that.
My code here is erroring when trying to assign the salesHist object
- Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm salesOrderForm = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm)JiwaForm;
salesOrderForm.SalesOrder.SalesOrderLineAdding += GetThePostcode;
}
public void GetThePostcode(object sender, System.EventArgs e, JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLine item)
{
JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder salesOrder = (JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder) sender;
JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderHistory salesHist = salesOrder.SalesOrderHistorys(salesOrder.CurrentHistoryNo);
string StateCode = salesHist.PostCode.Substring(0,1);
}
error is "non invocable member JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder.SalesOrderHistorys cannot be used like a method. "
What am I doing wrong?