' Sage 100 - First Customer - Print Selected Columns
IMPORT com.sbi
oscript = COM::CREATE(:SET, "ProvideX.Script")
COM::CBN(oScript, "Init", :CALL, "C:\\Sage\\Sage 100 Standard\\MAS90\\Home")
osession = COM::CBN(oscript, "NewObject", :SET, "SY_Session")
COM::CBN(osession, "nSetUser", :CALL, "UserID", "Password")
COM::CBN(osession, "nsetcompany", :CALL, "ABC")
COM::CBN(osession, "nSetDate", :CALL, "A/R", "20210520")
COM::CBN(osession, "nSetModule", :CALL, "A/R")
ocust = COM::CBN(oscript, "NewObject", :SET, "AR_Customer_svc", osession)
COM::CBN(ocust, "nMoveFirst", :CALL)
CustomerNo = COM::CBN(ocust, "sCustomerNo", :GET)
CustomerName = COM::CBN(ocust, "sCustomerName", :GET)
City = COM::CBN(ocust, "sCity", :GET)
State = COM::CBN(ocust, "sState", :GET)
TelephoneNo = COM::CBN(ocust, "sTelephoneNo", :GET)
COM::CBN(ocust, "DropObject", :CALL)
COM::CBN(osession, "DropObject", :CALL)
COM::RELEASE(oscript)
PRINT "Customer: ", CustomerNo, " ", CustomerName, " ", City, " ", State, " ", TelephoneNo, "\n"