Quantcast
Channel: Sage 100
Viewing all articles
Browse latest Browse all 37126

Forum Post: BOI - New Sales Order

$
0
0
I am trying to convert a working VBScript that creates a new sales order into a PHP script.  I cannot find any documentation or examples using PHP with BOI but I wanted to see if anyone here knew what might be going on.  Everything in my script works perfectly, except for one very important line - and that's where I try to get the next available sales order number.  I've tried everything I can think of but it always returns an empty string.  The script looks like this: $oPVX = new COM("ProvideX.Script"); $oPVX- Init("\\\servername\sage\mas 200\Version45\MAS90\home"); $oSS = $oPVX- NewObject("SY_Session"); $user = 'user'; $pass = 'pass'; $r = $oSS- nSetUser($user,$pass); $company = 'ZZZ'; $r = $oSS- nSetCompany($company); $module = "S/O"; $date = "20140808"; $r = $oSS- nSetDate($module, $date); $r = $oSS- nSetModule($module); $r = $oSS- nSetProgram($oSS- nLookupTask("SO_SalesOrder_ui")); $o = $oPVX- NewObject("SO_SalesOrder_bus", $oSS); $orderNo = ""; $r = $o- nGetNextSalesOrderNo($orderNo); --- This is the line that is the problem $r = $o- nSetKeyValue('SalesOrderNo$', $orderNo); $r = $o- nSetKey(); $r = $o- nSetValue('ARDivisionNo$', '00'); $r = $o- nSetValue('CustomerNo$', '0000001'); $r = $o- oLines- nAddLine(); $r = $o- oLines- nSetValue('ItemCode$', '41000'); $r = $o- oLines- nSetValue('QuantityOrdered', 2); $r = $o- oLines- nWrite(); $r = $o- nWrite(); $r = $o- DropObject(); $o = null; The method returns a 1 like it is successful, but no value is placed into $orderNo.  If I set $orderNo = "1234567" it works perfectly.  No error is returned until I try to use the $orderNo variable in the next line, then I get a message: Error #12: File does not exist (or already exists) File: CU_Options Any ideas?

Viewing all articles
Browse latest Browse all 37126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>