The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
plugin table not accessible to user
Posted: 25 Nov 11 9:47 AM
|
fiogf49gjkf0d after inserting an opportunity i need to get a pluginid for the salesprocess.
in snippet where it runs i have tried:
hql " select p.PluginId from Plugin where p.Type='1'"...etc
nhibernate.iquery query = session.createQuery(hql)...etc
have also tried
sage platform.iqueryable repoitory enitiyfactory.getrepository<IPlugin>()
criteria.addetc....
both run ok for admin but when log in as user it fails?
though plugin table available to all users? |
|
|
|
Re: plugin table not accessible to user
Posted: 26 Nov 11 1:40 AM
|
fiogf49gjkf0d When you run SQL through slx it adds security to ensure the user has access to the plugin you are trying to lookup. Make sure the plugin (sales process) is released to everyone. |
|
|
|
Re: plugin table not accessible to user
Posted: 26 Nov 11 6:58 PM
|
fiogf49gjkf0d That query shouldn't work for ADMIN either - are you sure it actually ran? You aren't aliasing the PLUGIN table reference, and TYPE is an integer, so the "1" shouldn't be in quotes.
Try "SELECT P.PLUGINID FROM PLUGIN P WHERE P.TYPE = 1" instead...? |
|
|
|
Re: plugin table not accessible to user
Posted: 29 Nov 11 5:42 AM
|
fiogf49gjkf0d yes does work with or without 1 in quotes for admin
checked salesprocess release to everyone - unreleased it then re-released to make sure
still doesnot work though!!! |
|
|
|
Re: plugin table not accessible to user
Posted: 29 Nov 11 6:35 AM
|
fiogf49gjkf0d Can you post the full sql you are using? There can be multiple rows for salesprocesses depending on their release state, exclude the "Admin" row.
This is the SQL I use to get a plugin id for a given salesprocess:
SELECT PLUGINID FROM PLUGIN WHERE NAME = 'MySalesProc' AND USERID <> 'ADMIN'
|
|
|
|
Re: plugin table not accessible to user
Posted: 29 Nov 11 6:41 AM
|
fiogf49gjkf0d fixed ..decided to make connection as admin just to get plugid then user can do salesprocess etc
Sage.Platform.Data.IDataService service = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Data.IDataService>(); //log on as admin!! string connectionString ="Provider=SLXOLEDB.1 ersist Security Info=True;Initial Catalog=" + service.Database + ";Data Source=" + service.Server + ";User ID=admin assword=\"Danger\"; Extended Properties =\"PORT=1706;LOG=ON;CASEINSENSITIVEFIND=ON;AUTOINCBATCHSIZE=1;SVRCERT=12345;;ACTIVITYSECURITY=OFF;TIMEZONE=NONE\" "; //open connection System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection(); System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand(); try { cn.ConnectionString = connectionString; cn.Open(); cmd.Connection = cn; string strSQL = string.Format("Select pluginid from plugin where type=1 and name='{0}' and userid='ADMIN'", strText); cmd.CommandText = strSQL; System.Data.OleDb.OleDbDataReader dr = cmd.ExecuteReader(); if (dr.Read()) strPluginId = dr.GetValue(0).ToString();
dr.Close(); cmd.Dispose(); cn.Dispose(); } catch(Exception ex) { throw new Exception("Can not find pluginid for salesprocess"); }
...then goes onto normal salesprocess stuff creating each record..setting stage..etc |
|
|
| |
|
Re: plugin table not accessible to user
Posted: 29 Nov 11 6:52 AM
|
fiogf49gjkf0d when salesprocess runs it gets the admin version of the plugin, as a base version , and uses this info to create the salesprocess... |
|
|
|
Re: plugin table not accessible to user
Posted: 30 Nov 11 10:10 AM
|
fiogf49gjkf0d USERID is a CHAR(12) field.....which means there is NO value 'ADMIN' ever stored into the database......it's either LIKE 'ADMIN%' or = 'ADMIN ' or RTRIM(USERID) = 'ADMIN' |
|
|
|
Re: plugin table not accessible to user
Posted: 02 Dec 11 6:52 AM
|
fiogf49gjkf0d = 'ADMIN' will still work without a ltrim/rtrim etc.
Chez have you change the SQL yet to not look for the admin release of the plugin? The secrights join will stop that record getting to you for anyone other than admin.
If you are starting a salesprocess use my sql to get the pluginid then call:
Sage.Entity.Interfaces.ISalesProcesses sp = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.ISalesProcesses>();
sp.InitSalesProcess(pluginId,opportunity.Id.ToString());
|
|
|
|
Re: plugin table not accessible to user
Posted: 02 Dec 11 8:56 AM
|
fiogf49gjkf0d Thanks, didn't know the web worked this way for Char(12) properties....I've been bitten enough by this on the LAN side.....and of course been bitten by case sensiTivIty on the WEb sidE. |
|
|
|
Re: plugin table not accessible to user
Posted: 02 Dec 11 10:55 AM
|
fiogf49gjkf0d It doesn't mind that way directly in SQL also, never noticed this problem in the LAN either. Case sEnsItiviTy on the other hand... |
|
|
|