Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 Autogenerated stored proicedures : Dexterity

Author  Topic 

chidamber
Starting Member

1 Post

Posted - 2005-08-18 : 04:48:47
This following procedure in dexterity is succesfully able to creat all the tables specified and their stored procedures. It also grants permissions to the tables and the autogenerated stored procedures. But the only problem is that it is not able to create one autogenerated stored procedure named .ZDp-IG003SD that is used to perform delete operations on the table IG_Contact_History_MSTR. Here, when the user performs the delete operation on table RM Customer MSTR using customer mainmtenence form in Great Plains, this will also result in the deletion of the same record in IG_Contact_History_MSTR table whos physical name is IG003. So, since ZDp-IG003SD is not being created by dexterity( By the following code. BUt all other insert procedures for this table are created) the result of delete operation is not affecting this table.
Please let me know what has to be done. Where could i look for possible error correction. Should i need to know the source code for Great Plains to identify this.??


local boolean result,l_result,OUT_Access;
{if logged in as sa, let them create the tables}
if 'SQLSaUser' of globals then
OUT_Access = true;
else
{This else statement will work only on 8.0. If logged in as a user other than sa,
but they have table access permissions, let them create the tables}
if syUserInRole('User ID' of globals, ROLE_SYSADMIN) or (syUserIsDBO ('User ID' of globals, 'Intercompany ID' of globals)
and syUserIsDBO ('User ID' of globals, SQL_SYSTEM_DBNAME)) then
OUT_Access = true;
end if;
end if;

if 'SQL Server' of globals > 0 and OUT_Access then
{enable table creation mode}
result = Table_SetCreateMode(true);
{Do not display any table errors to the user.}
result = Table_DisableErrorChecks(true);
{accessing the table creates it, list all your tables here, make sure to close the tables when done}
get first table IG_Contact_History_MSTR;
close table IG_Contact_History_MSTR;
get first table IG_Leads_MSTR;
close table IG_Leads_MSTR; {now set permissions, call once for the table and once for the stored procs}

l_result = GrantAccess(physicalname(table IG_Contact_History_MSTR),false,"DYNGRP",'Intercompany ID' of globals)
of form 'SQL Maintenance';
l_result = GrantAccess(physicalname(table IG_Contact_History_MSTR),true,"DYNGRP",'Intercompany ID' of globals)
of form 'SQL Maintenance';

l_result = GrantAccess(physicalname(table IG_Leads_MSTR),false,"DYNGRP",'Intercompany ID' of globals) of form 'SQL Maintenance';
l_result = GrantAccess(physicalname(table IG_Leads_MSTR),true,"DYNGRP",'Intercompany ID' of globals) of form 'SQL Maintenance';
{Turn off automatic table creation.}
result = Table_SetCreateMode(false);
{Turn table error reporting back on.}
result = Table_DisableErrorChecks(false);
end if;

   

- Advertisement -