Tip on fixing issues with classes quickly (w/o having to quit Sage Pro)

This is a programmer's tip:
If you are trying to work on a screen in Sage Pro, it is painful to
- Find an issue in the screen- Quit Pro
- then modify the class- then login to Pro
- then load the screen

Here is a way out of the above:
First part of the trick:
- Load VFP in the Pro root folder. Create a program called ClearClass.prg
- In this program give 2 lines to clear the appropriate form class and FS
Examples:
If you are working with sopost
CLEAR CLASS Sopost
CLEAR CLASS cmpSopostFS
If you are working with sycust
CLEAR CLASS SycustMgr
CLEAR CLASS Sycust
CLEAR CLASS cmpSycustFS
If you have created a sub class, use Clear Class with those classes
- Give DO PRO
- Create a custom menu option, by
- Go to SM/System Installation
- Click Edit and goto "Custom" tab
- For menu Text give "CLEAR CLASS"
- For command line give "DO ClearClass.prg"
- If using VFP, click File/Login and login again (for the custom menu to get refreshed)
- If using SQL, Quit Pro and login again (for the custom menu to get refreshed)

Second part of the trick
- Is to load 2 instances of VFP
- In the previous instance you have Pro running.
- Load another instance of VFP and open your class in the class browser.
- Each time you find an issue in the screen you are working with, exit the screen in Pro (but do not quit Pro)
- Click on custom menu "Clear Class"
- In second instance, open the class, do your changes and click "Clean up class library" (to keep the class library file small and running fast)

Now you have the solution to avoid having to quit Pro to make changes to the class you are working with.

How to sum up values in data driller

The data driller does not provide for a Group By clause (it provides
for columns, where and order by)

But you can trick it to provide for a group By:
To do this, use the "Where" clause. Give a dummy where and then add
GROUP BY

Example for armast to group by sales person

In the Where clause give : custno = custno GROUP BY salesmn

Your SQL select would be

SELECT <fields you have chosen> ;
FROM <armast> ;
WHERE custno = custno GROUP BY salesmn ;
....
The custno = custno is to satisfy a valid where clause and then the group by.

P.S.: I haven't tried this myself recently, so you might have to tweak
it more than what I have mentioned here.

Store and bin maintenance improvements in Sage Pro ERP 7.4

In Sage Pro 7.4, there are three enhancements (that I can think of) to store/bin:

1. Ability to assign default store/bin per item location: One for receiving and one for shipping.

2. In IC Change setup information, there is an option to prevent use of empty store/bin when receiving (does not clean up past data but in future when entering a PO receipt or Item receipt or Work order completion, you cannot save with a blank store bin)

3. Privilege to allow creating store/bin on the fly. With this, you can prevent specific users from trying to create store/bins that are not there in the system.

ODBC issue with VFP 9

You cannot use ODBC with Visual FoxPro 9.0. Instead you have to use ADO (OLEDB). Unlike ODBC which gives a result set normally as a cursor, ADO gives the result set as an object (Dataset in .Net).

I tried this from within VFP (assuming a database named prodata and tables named syccomp, arcust99 in that database) and it worked.
Here is what I did:

oConn = CREATEOBJECT("ADODB.Connection")
oConn.ConnectionString = "provider=vfpoledb.1;;
data source=.\prodata.dbc"
oConn.Open
? oconn.Execute("Select * from syccomp")
lo =oconn.Execute("Select * from syccomp")
? lo.Fields[1].value
ln = 1

lo =oconn.Execute("Select * from arcust99", @ln)
? ln
? lo.Fields[1].value
? lo.Fields[0].value

You can use "DIM" to create the object in VB and use the Execute to get to the VFP data.

Do not use .F. or .T. as part of your item ID in Sage Pro ERP

If you have a .F. or a .T. as part of your item ID (like 10.F.Sheet), Sage Pro will allow you to save the item, but when you enter a SO and save the line using that item, it will give an error that no location is found. This will happen even if you have a valid location for that item.

This is caused because Sage Pro parses the value and change it to a 0 or a 1 and hence the item ID search does not work fine.

Tip to quickly add a menu to Sage Pro ERP 7.4

In Sage Pro ERP 7.4, the old menu system has been dropped for a new data driven menu.
Question now is how to add a new menu. To do this, you can use the tasklist and add it to the Master scheme. This will add it to the menu also. Problem is that Sage Pro, by default does not let you edit the Master scheme.

To allow for editing this add a Windows environment variable called "PROALLOWTASKLIST" and set it to "ON". Then load Sage Pro and you can right click on the Master scheme to add a new menu.

Intellisense for GO_SQL

How to get Intellisense for go_Sql in Pro

In the command prompt (after installing the pro tools) give
DO tools\sqltest

Then give
? go_sql. and you will get intellisense

For programs, give this

#IF 0
LOCAL go_Sql AS sbtmgrsql of sbtsql.vcx
LOCAL lo_t AS sbtcmpsql of sbtsql.vcx
#ENDIF

Now give
go_sql. to get intellisense for go_sql
lo_t. to get intellisense for lo_t and then change it to the table object.

You can also give LOCAL variables like
LOCAL lo_Arcust AS sbtcmpsql of sbtsql.vcx

lo_arcust = ThisFormSet.so_PI.m_GetRef("data.arcust")
lo_arcust. to get intellisense

In VFP 9, you can also give this in the WITH construct, like

WITH lo_Arcust AS sbtcmpsql OF sbtsql.vcx
ENDWITH