Call to SPOpenFile does not seem to check csUserID passed in

Discussions related to integration with SoftPro Standard or SoftPro Enterprise editions.
Post Reply
at2k21
Posts: 17
Joined: Wed Aug 16, 2017 5:33 pm

Call to SPOpenFile does not seem to check csUserID passed in

Post by at2k21 »

When making calls to SPOpenFile it always succeeds as long as csFileID is valid regardless of the value of csUserID. What is the purpose of the csUserID parameter? Is it really needed?

In calls to SPGetPromptFilesDirectory chUserID parameter is checked and only seems to work for the value "Default". Where can I look to get a list of valid values for this parameter?
Gil McNeill
Posts: 16
Joined: Mon Oct 06, 2008 9:29 am

Re: Call to SPOpenFile does not seem to check csUserID passed in

Post by Gil McNeill »

For SPOpenFile...the user ID is used in the data file locking mechanism. So...if your app using the API has an order open, and a ProForm user tries to open the same order, they will receive a message indicating the the order is already open...and who has it open.

It may be helpful to add (via SPAdmin) a user ID that you use for API calls. For example...add a user called "APIUser". In the above scenario, the ProForm user would be able to tell that the order is open by the API application. The warning they would receive would say something like "The file can only be opened read only because it is currently opened by APIUser"

As far as SPGetPromptFilesDirectory...the user ID is used to get the prompts directory for that user. This is part of the SPAdmin setting for that user. Normally the prompts directory is the same for all users, but sometimes this is used to give a user a set of custom prompts.

Again...you may want to set up the APIUser in SPAdmin and set it up however it makes sense...and then pass in this user ID for all API calls.
Gil McNeill
SoftPro Software Engineer
Post Reply