Accedi con Microsoft
Accedi o crea un account.
Salve,
Seleziona un altro account.
Hai più account
Scegli l'account con cui vuoi accedere.

RIEPILOGO Questo articolo illustra come creare tabelle SQL per i programmi basati su


Microsoft Business Solutions - Great Plains Dexterity.


ALTRE INFORMAZIONI Usare i passaggi seguenti per creare SQL tabelle che si trovano in un programma di terze parti integrato

scritto in Dexterity. Questi passaggi illustrano anche come concedere SQL a tali tabelle.


Nota Questo metodo sostituisce il metodo amAutoGrant descritto nel capitolo 41 della Guida per programmatori dexterity, volume 1.

1. Creare una procedura globale denominata Avvio, se non ne esiste già una
nel programma di terze parti. Questo script viene eseguito all'avvio di Great Plains ed è in genere la posizione in cui vengono registrati i trigger.


2. Nello script Di avvio creare un trigger di routine nella Add_Successful_Login_Record
routine usando il codice seguente.

{Name: Startup}
local integer l_result;
l_result = Trigger_RegisterProcedure(script Add_Successful_Login_Record, TRIGGER_AFTER_ORIGINAL, script gp_create_tables);
if l_result <> SY_NOERR then
warning "The Add_Successful_Login_Record trigger is not registered.";
end if;



3. Il trigger registrato creato nel passaggio 2 chiamerà la procedura globale gp_create_tables ogni volta che l'utente
accede a Microsoft Dynamics GP. Questa procedura viene eseguita quando una società Great Plains viene aperta inizialmente o quando l'utente o la società viene cambiata.


4. Creare la routine globale denominata
gp_create_tables. Questo script creerà le tabelle per il programma di terze parti nel database SQL Server corretto. Verrà inoltre creato il storedprocedures generato dalla tabella (proc zDP) e verranno concesse SQL autorizzazioni per la tabella e le procedure. Usare il codice seguente.

{Name: gp_create_tables} 
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 GPSetup; {Purchasing series table}
close table GPSetup;
get first table GPSetup2; {System series table}
close table GPSetup2; {now set permissions, call once for the table and once for the stored procs}
{GPSetup is a purchasing series table so that will be in the company dbo}
l_result = GrantAccess(physicalname(table GPSetup),false,"DYNGRP",'Intercompany ID' of globals)
of form 'SQL Maintenance';
l_result = GrantAccess(physicalname(table GPSetup),true,"DYNGRP",'Intercompany ID' of globals)
of form 'SQL Maintenance';
{GPSetup2 is a system series table so that will be in the DYNAMICS database}
l_result = GrantAccess(physicalname(table GPSetup2),false,"DYNGRP","DYNAMICS") of form 'SQL Maintenance';
l_result = GrantAccess(physicalname(table GPSetup2),true,"DYNGRP","DYNAMICS") 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;


5. Le tabelle e le stored procedure generate dalla tabella verranno create in SQL Server e SQL verranno concesse le autorizzazioni. Questo script verrà eseguito solo per gli utenti di SSA o DYNSA e dopo la creazione delle tabelle è possibile eseguire di nuovo lo script.

Questo articolo è stato ID documento TechKnowledge:33429

Contenuto techknowledge

Serve aiuto?

Vuoi altre opzioni?

Esplorare i vantaggi dell'abbonamento e i corsi di formazione, scoprire come proteggere il dispositivo e molto altro ancora.

Le community aiutano a porre e a rispondere alle domande, a fornire feedback e ad ascoltare gli esperti con approfondite conoscenze.

Queste informazioni sono risultate utili?

Come valuti la qualità della lingua?
Cosa ha influito sulla tua esperienza?
Premendo Inviare, il tuo feedback verrà usato per migliorare i prodotti e i servizi Microsoft. L'amministratore IT potrà raccogliere questi dati. Informativa sulla privacy.

Grazie per il feedback!

×