Toggle navigation
Hutility Dev Tools
Home
About
Sage 300 View Doc
Sage 300 Macro Converter
Sage 300 Model Creator
Sage 300 Samples
CSV
Add or modify
Save sample Sage code
Name
Description
Views
Content
// TODO: To increase efficiency, comment out any unused DB links. using(HuAPConnection Connection = new HuAPConnection()) using(HuView ARIBC = Connection.GetView("AR0031")) using(HuView ARIBH = Connection.GetView("AR0032")) using(HuView ARIBD = Connection.GetView("AR0033")) using(HuView ARIBS = Connection.GetView("AR0034")) using(HuView ARIBHO = Connection.GetView("AR0402")) using(HuView ARIBDO = Connection.GetView("AR0401")) { ARIBC.Compose(ARIBH); ARIBH.Compose(ARIBC,ARIBD,ARIBS,ARIBHO,null); ARIBD.Compose(ARIBH,ARIBC,ARIBDO); ARIBS.Compose(ARIBH); ARIBHO.Compose(ARIBH); ARIBDO.Compose(ARIBD); ARIBC.Browse("((BTCHSTTS = 1) OR (BTCHSTTS = 7))"); using(HuView ARIVPT = Connection.GetView("AR0048")) { ARIBC.RecordCreate(1); ARIBC["PROCESSCMD"] = "1"; // Process Command ARIBC.Process(); ARIBC.Read(); ARIBH.RecordCreate(2); ARIBD.Cancel(); ARIBH["IDCUST"] = "1200"; // Customer Number ARIBH["PROCESSCMD"] = "4"; // Process Command ARIBH.Process(); ARIBH["INVCTYPE"] = "2"; // Invoice Type ARIBD.RecordClear(); ARIBD.RecordCreate(0); ARIBD["PROCESSCMD"] = "0"; // Process Command Code ARIBD.Process(); ARIBD["IDACCTREV"] = "5000"; // Revenue Account ARIBD.Insert(); ARIBD["CNTLINE"] = "-1"; // Line Number ARIBD.Read(); ARIBD["AMTEXTN"] = "40.000"; // Extended Amount w/ TIP ARIBD.Update(); ARIBD["CNTLINE"] = "-1"; // Line Number ARIBD.Read(); ARIBD.RecordCreate(0); ARIBD["PROCESSCMD"] = "0"; // Process Command Code ARIBD.Process(); ARIBD["IDACCTREV"] = "5000"; // Revenue Account ARIBD["AMTEXTN"] = "20.000"; // Extended Amount w/ TIP ARIBD.Insert(); ARIBD["CNTLINE"] = "-2"; // Line Number ARIBD.Read(); ARIBH["CUSTPO"] = "PONUM"; // PO Number ARIBH.Insert(); ARIBD.Read(); ARIBD.Read(); ARIBC.Read(); ARIBH.RecordCreate(2); ARIBD.Cancel(); ARIBH["CNTITEM"] = "2"; // Entry Number ARIBH.Browse(""); ARIBH.Fetch(); ARIBD.Read(); ARIBD.Read(); } }
Add/Update