ข้ามไปที่เนื้อหาหลัก
การสนับสนุน
ลงชื่อเข้าใช้
ลงชื่อเข้าใช้ด้วย Microsoft
ลงชื่อเข้าใช้หรือสร้างบัญชี
สวัสดี
เลือกบัญชีอื่น
คุณมีหลายบัญชี
เลือกบัญชีที่คุณต้องการลงชื่อเข้าใช้

สรุป


บทความนี้อธิบายวิธีการสร้างตารางแบบใช้SQLโซลูชันของ Microsoft Business - โปรแกรมที่มีความคล่องตัวในที่ราบสูง


MORE INFORMATION

Use thefollowingsteps to create SQL tables that reside in an integrating third party program written in Dexterity. ขั้นตอนเหล่านี้ยัง coverhow to grant SQL permission to those tables.


หมายเหตุ วิธีนี้แทนที่วิธีการ amAutoGrant ที่อธิบายไว้ในบทที่ 41 ของ Dexterity Programmers Guide ซึ่งก็คือ Volume 1

1. สร้างกระบวนงานส่วนกลาง
ที่ชื่อว่า เริ่มต้น ถ้ากระบวนงานหนึ่งไม่มีอยู่ในโปรแกรมของบริษัทอื่นของคุณ สคริปต์นี้จะเรียกใช้เมื่อคุณเริ่ม Great Plains และโดยทั่วไปแล้วจะลงทะเบียนทริกเกอร์


2. ใน
สคริปต์การเริ่มต้น ให้สร้างทริกเกอร์กระบวนงานบนAdd_Successful_Login_Recordกระบวนงานโดยการใช้โค้ดต่อไปนี้

{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. ทริกเกอร์ที่ลงทะเบียนที่สร้างขึ้นในขั้นตอนที่ 2 จะโทรไปยังขั้นตอน
gp_create_tablesในทุกครั้งที่ผู้ใช้เข้าสู่ระบบ Microsoft Dynamics GP กระบวนการนี้จะเรียกใช้เมื่อบริษัท Great Plains เปิดขึ้นตั้งแต่แรกเมื่อผู้ใช้หรือบริษัทถูกสลับ


4. สร้างกระบวนงานส่วนกลางที่
gp_create_tablesชื่อ สคริปต์นี้จะสร้างตารางโปรแกรมของบริษัทอื่นในฐานข้อมูลSQL Serverที่ถูกต้อง นอกจากนี้ จะสร้างตารางกระบวนงานที่จัดเก็บไว้ (zDP procs) และให้SQLสิทธิ์ให้กับตารางและกระบวนงาน ใช้รหัสต่อไปนี้

{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. ตารางและตารางที่สร้างกระบวนงานที่เก็บไว้จะถูกสร้างขึ้นSQL ServerและSQLสิทธิ์ใหม่ทั้งหมดจะได้รับ สคริปต์นี้จะใช้ได้เฉพาะกับผู้ใช้SA หรือ DYNSA และหลังจากสร้างตารางแล้ว จะสามารถเรียกใช้สคริปต์นี้อีกครั้งได้

บทความนี้เป็น TechKnowledge Document ID:33429

TechKnowledge Content

ต้องการความช่วยเหลือเพิ่มเติมหรือไม่

ต้องการตัวเลือกเพิ่มเติมหรือไม่

สํารวจสิทธิประโยชน์ของการสมัครใช้งาน เรียกดูหลักสูตรการฝึกอบรม เรียนรู้วิธีการรักษาความปลอดภัยอุปกรณ์ของคุณ และอื่นๆ

ชุมชนช่วยให้คุณถามและตอบคําถาม ให้คําติชม และรับฟังจากผู้เชี่ยวชาญที่มีความรู้มากมาย

ข้อมูลนี้เป็นประโยชน์หรือไม่

คุณพึงพอใจกับคุณภาพภาษาเพียงใด
สิ่งที่ส่งผลต่อประสบการณ์ใช้งานของคุณ
เมื่อกดส่ง คำติชมของคุณจะถูกใช้เพื่อปรับปรุงผลิตภัณฑ์และบริการของ Microsoft ผู้ดูแลระบบ IT ของคุณจะสามารถรวบรวมข้อมูลนี้ได้ นโยบายความเป็นส่วนตัว

ขอบคุณสำหรับคำติชมของคุณ!

×