الأربعاء، 13 أغسطس 2014

Using CURSOR in SQL

Declare @AppId as varchar(50)
Declare @InvoiceNo as varchar(50)
declare @DueDate as datetime

DECLARE AppCURS CURSOR FOR

select cit_applicationno,new_InvoiceNo,cit_DueDate from ZmZm_MSCRM.dbo.cit_application where statuscode=912660015

OPEN AppCURS
fetch next from AppCURS into @AppId,@InvoiceNo,@DueDate
WHILE @@FETCH_STATUS = 0
BEGIN  
update AX2012R2_DB.dbo.PURCHTABLE 
set 
CRMINVIOCENUM=@InvoiceNo,
ACCOUNTINGDATE=@DueDate,
ISINVOICERECEIVED=1
where VENDORREF=@AppId

fetch next from AppCURS into @AppId,@InvoiceNo,@DueDate
END   

CLOSE AppCURS   
DEALLOCATE AppCURS

الاثنين، 11 أغسطس 2014

SQL Timeout solutions in Dynamics CRM 2011

Mostly this kind of problems could come from Plugins, if there are any plugins executed on that action.

Increase the default timeout

Registry on CRM applicationserver(s)
  1. Open CRM Web Server(where CRM is installed)
  2. Open regedit (start – > write ( regedit) ) and press ok
  3. Go to HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSCRM
  4. Add DWORD name OLEDBTimeout with value 86400 ( 24 hours) select decimal
  5. Add DWORD name ExtendedTimeout with value 1000000. The maximum value can be 2,147,483,647 and the default value is 30 seconds
These changes in register should fix the SQL timeout.

الأربعاء، 28 مايو 2014

Error message when you try to start a server that is running the AOS service in Microsoft Dynamics AX 2012 "Windows could not start the Dynamics Server$01 on Local Computer"

-In SQL in the newly restored database go to Security > Users.  Right-click on Users and choose new user.  Add the user account that runs the AOS service.  For me, this is my domain account.  
-In the middle of this user form, under Owned Schemas mark db_owner
-Still in the same form where you added the user, under Database role membership mark db_datareader, db_datawriter, and db_owner.
-In SQL in the newly restored database go to Programmability > Stored Procedures and right-click on CreateServerSessions and choose Properties.
-Click Permissions and click the Search button.  Find the account you just added to the database as a user, for me this is my domain account.
-In the bottom of this form under the Grant column mark all of the choices.
-In SQL in the newly restored database go to Programmability > Stored Procedures and right-click on CreateUserSessions and choose Properties.
-Click Permissions and click the Search button.  Find the account you just added to the database as a user, for me this is my domain account.
-In the bottom of this form under the Grant column mark all of the choices.



الاثنين، 26 مايو 2014

The deployment web site was not found for port: ScribeAxWebService - The port 'ScribeAxWebService' could not be deployed

The port 'ScribeAxWebService' could not be deployed.\nError:  Access to the path '\\TEASTING\MicrosoftDynamicsAXAif60\ScribeAxWebService' is denied.

The deployment web site was not found for port: ScribeAxWebService
The port 'ScribeAxWebService' could not be deployed.\nError: The deployment web site was not found for port: ScribeAxWebService



////****************** solution

Make sure IIS is running.

URL under addresses should look like https://localhost/MicrosoftDynamicsAXAif60/[your port name]/xppservice.svc

Virtual directory share path under web sites must match: C:\Program Files\Microsoft Dynamics AX\60\AifWebServices

URL under web sites must match https://localhost/MicrosoftDynamicsAXAif60