Monday, 26 March 2018

How to create loyalty setup Dynamics AX 2012



Loyalty Card Setup dynamics AX 2012, You can set up simple or complex loyalty programs that apply across your legal entities in any retail channel.



Setup a loyalty program “Loyalty campaign” having 3 loyalty tier. We will be configuring in such a way that the Customer will have to earn the loyalty points to be eligible for each of the loyalty.
When the customer is added to the loyalty program , he is usually given a basic loyalty card or we can say the first tier loyalty card in the loyalty program. In our example we will configure 3 loyalty tiers as follows-

1. Silver-Customer has 0 loyalty points at the time of issue.
2. Gold – Customer has to earn 30 loyalty points to get the Gold loyalty Card
3. Platinum – Customer has to earn 50 loyalty points to get the Gold loyalty Card

Primary Component

1.    Setup Date Interval
2.    Loyalty Reward Points
3.    Setup Loyalty Program
4.    Create Loyalty Scheme
5.    Loyalty Card
6.    Tender Type (Loyalty Card)
7.    Process Loyalty Schemes
8.    Process Offline Loyalty Transactions
9.    Update Loyalty Card Tires
10.  1050 N JOB (Loyalty Information)

Optional Component

1.    Price Group
Price groups are used to create and manage prices and discounts for retail products. Set up the price groups that include the discounts that apply to your loyalty programs.
Price groups are assigned to your loyalty programs and loyalty program tiers.

2.    Discounts
Set up the discounts that you offer to your loyalty customers. For example, 5 percent off all apparel products.
Discounts must be added to price groups in order to be included in a loyalty program. Price groups are assigned to loyalty programs and loyalty tiers.

Steps

 Setup Date Interval: Click Retail > Setup > Loyalty > Date intervals

Field
Purpose
Set start date and Set end date
Used these fields to set the start and end of the date range. To use the system date as the start and end date, leave these fields blank. Otherwise, you can set a static fixed date or a period as the start and end date.
Adjust start date and Adjust end date
Use these fields to adjust the date range based on the settings in the Set start date and Set end date fields.
For example, if you want to track the number of products that a customer has purchased in the prior year to qualify them for a loyalty tier, in the Units field, select Years. Then, in the Number of units field, enter -1 to adjust the start date to the previous year.
To set a one year date range to apply to the length of time that a customer can remain in a loyalty tier, in the Adjust end date section, in the Units field, select Years. Then, in the Number of units field, enter 1 to adjust the start date to the following year.
Secondary interval
Use these fields to set up a date interval within a date interval. For example if you want to track the number of items purchased at the start of every quarter, you could set up a date interval that started at the beginning of the fiscal year. In the Interval type field, select Quarter, and then, in the Start/end field, select Start.
Date calculation
These fields show the results of the date calculations, including any date adjustments that you entered.

Pic 1





Pic2

Loyalty Reward Points :- Retail > Setup > Loyalty > Loyalty reward points

Reward points to define the types of reward that you offer to your customers. Rewards points can be redeemable or non-redeemable. Customers can exchange redeemable reward points for discounts or products. Non-redeemable reward points can be used for tracking purposes or to advance a customer to the next loyalty tier.
Use an amount-based reward if you want the customer to earn reward points that can be redeemed for products or discounts. Amount-based rewards are rounded based on the reward currency.
Use a quantity-based reward if you want to reward the customer after they purchase a certain quantity of a product. For example, you can set the number of espresso drinks that a customer must purchase to earn a free espresso drink. Quantity-based rewards are rounded to an integer by truncating the decimals.

Field
Description
Currency
Enter the currency that the amount-based reward is tracked in.
Redeemable
Select this check box if the reward is redeemable. For example, clear this check box for rewards that are set up for tracking purposes or to enable customers to advance to the next loyalty tier. If the check box is selected for these types of rewards, the customer can redeem the reward points, and might never reach the next tier level.
Redeem ranking
Enter the priority in which the rewards should be redeemed. This field applies only if the Redeemable check box is selected and if multiple types of reward points can be redeemed at one time.
Expiration time value
If the reward expires within a certain period of time, enter the number of days, months, or years in which the reward expires.
Expiration time unit
If the reward expires within a certain period of time, enter the time period in which the reward expires.

Pic3

Setup Loyalty Program :-

Click Retail > Setup > Loyalty > Loyalty programs
Set up loyalty programs to identify the various loyalty opportunities that you offer. Each loyalty program can have multiple loyalty tiers or no loyalty tiers assigned to them. If you define loyalty tiers for the loyalty program, you also must set up the qualifying rules that apply to each loyalty tier. Use price groups to assign special discounts to the loyalty program and each loyalty tier.



Pic4



Pic 5


1.     Click Retail > Setup > Loyalty > Loyalty programs.
2.     In the Loyalty programs form, click New to create a new loyalty program. Then, enter a name and description.
3.     Select the Combine related loyalty cards check box if you want to combine the rewards on all cards that are linked to the same customer when evaluating reward points to earn loyalty tiers. If rewards qualify the customer for a tier, all cards that are linked to the same customer are granted the tier.
4.     On the Program tiers FastTab, click Add line to add a new program tier. Program tiers are optional, but if you set up program tiers, you must also set up program tier rules.
5.     In the Level field, enter a numerical value for the level.
6.     Enter a name and description for the level. Click Translations to enter the level description in other languages.
7.     In the Date interval field, select the date interval that indicates the length of time that a customer can stay in a tier after they have qualified for the tier. For example, if the date interval that is selected for gold level tier is a one year period, any customer who qualifies for the gold level tier can receive the rewards that are assigned to the gold level tier for one year. If the customer requalifies for the gold level tier while they are in that tier, the date that their tier status expires is extended by another year, starting at the date when they requalify.
8.     On the Tier rules FastTab, click New to add the reward points or qualifying rules that apply to each tier.
9.     In the Reward point field, select the reward point that applies to the selected loyalty tier.
10.  In the Minimum issued points field, enter the minimum number of loyalty points the customer must earn to qualify for the loyalty tier. If all customers can qualify for the loyalty tier simply by participating in the program, enter 0 (zero) in this field.
11.  In the Evaluation date interval field, select the date interval that represents the time period in which the reward must be earned to qualify the customer for the tier.
12.  Assign price groups to the loyalty program. To assign price groups and discounts that apply to the entire loyalty program, at the top of the form, click Price groups. To assign price groups to a specific loyalty tier, on the Program tiers FastTab, select a loyalty tier and then click Price groups.
13.  To view all transactions for loyalty cards that are assigned to this loyalty program


Create Loyalty Scheme

Retail > Common > Loyalty > Loyalty cards. In the Loyalty cards list, double-click a loyalty card.

Loyalty schemes specify the earning rules and redemption rules that apply to a selected loyalty program. You assign retail channels to a loyalty scheme to identify which loyalty program, earning rules, and redemption rules apply to a retail store.
A loyalty scheme is assigned to a loyalty program and to retail channels. You can assign many loyalty schemes to the same loyalty program, and you can assign many loyalty schemes to many retail channels.

Field
Description
Program tier
Select the loyalty program tier that the redemption rule applies to.
For example, customers who are part of a Gold level tier might be able to redeem their rewards points for any product, while standard loyalty customers might be restricted to redeeming their rewards for products in a certain category. By specifying the gold tier in the Program tier field and entering the appropriate rule criteria, customers who are in the gold level tier in the loyalty program can redeem their rewards points for additional products.
If you don’t select a program tier, the redemption rule applies to all customers who are participating in the loyalty program.
Reward point ID
Select the reward that the redemption rule applies to. Rewards points are the rewards that customers can redeem. Only select redeemable reward points in this field.
For more information about how to set up reward points.
Reward points
Enter the number of rewards points that the customer must spend to receive the reward.
Redemption type
Select whether the reward points can be redeemed for currency or for a product quantity. For example, if the customer can receive a free espresso drink with the purchase of 9 espresso drinks, you can set up a redemption rule with a redemption type of Payment by quantity for products that are assigned to a coffee category.
Category
Select the product category that the redemption rule applies to. All products that are assigned to the selected category are included in the redemption rule. If you don’t select a product category the redemption rule applies to all product categories.
Product
Select the product that the redemption rule applies to. If you don’t select a product, the redemption rule applies to all products.
Product variant
Select the product variant that the redemption rule applies to. If you don’t select a product variant, the redemption rule applies to all product variants.
Amount or quantity
Enter the amount or product quantity that can be redeemed by using the specified rewards points
Start date
Enter the date on which the redemption rule becomes valid. This is an optional field that can be used if the rule is applicable for only a specific period of time.
End date
Enter the last date on which the redemption rule is valid. This is an optional field that can be used if the rule is applicable for only a specific period of time.
Field
Description






Pic 6



Loyalty Card

Retail > Common > Loyalty > Loyalty cards. In the Loyalty cards list, double-click a loyalty card, or, on the Action Pane, click Loyalty card to create a new loyalty card

Card number
Enter the loyalty card number. If number sequences are set up for loyalty cards, this number can be automatically generated.
For more information about how to set up number sequences.
Card type
Select one of the following options to specify how the loyalty card can be used:
  • As card tender – The card can earn or redeem points. Reward points that are used for payment must be earned by this card.
  • As contact tender – The card can earn or redeem points. The reward points that the customer uses for payment can be earned by any card that that customer is assigned to.
  • No tender – The card is a secondary card that can earn reward points but can’t redeem them.
  • Blocked – The card is blocked and can’t earn or redeem reward points.
Customer name
Select a customer to assign to the loyalty card. You don’t have to assign a customer to the card if the card is issued anonymously. If the loyalty card is issued as contact tender, a customer name is required.
Replacement card number
The number of the new loyalty card if a loyalty card was lost and a replacement card was issued.

Pic7





Pic 8


Tender Type (Loyalty Card)

to set up payment methods for loyalty schemes. You must set up a payment method before a loyalty card can be used at a register and loyalty points can be redeemed as part of a loyalty scheme. After you add the payment method to a store or select it as a line rule on a loyalty scheme, customers can redeem their loyalty points.
To set up payment methods for loyalty schemes, follow these steps:

1.     Click Retail > Setup > Payment methods > Payment methods.
2.     In the Payment methods form, click New to create a new payment method. Then enter the ID of the payment method, such as Loyalty, and the name.
3.     In the Default function column, select Card. This setting specifies that the point of sale (POS) system processes loyalty transactions as card transaction types.
4.     After you define loyalty cards as a payment method, you must set up the number sequences for the loyalty card numbers. For information about how to set up number sequences for loyalty cards

Process Loyalty Schemes

Click Retail > Periodic > LoyaltyProcess loyalty schemes
Run this process to associate loyalty schemes with the retail channels that the loyalty scheme is assigned to.
This process can be scheduled to run as a batch process.


Process offline loyalty transactions :-

Click Retail > Periodic > LoyaltyProcess offline loyalty transactions
Run this process to update loyalty cards to include transactions that were processed offline. 
This process is applicable only if the Earn offline check box is selected in the Retail shared parameters form
to enable earning rewards offline.

Update loyalty card tiers 

Click Retail > Periodic > LoyaltyUpdate loyalty card tiers
Run this process to evaluate the customer’s earning activity against the tier rules for a loyalty program and
update the customer’s tier status. 
This process is needed only if you change the tier rules in loyalty programs and you want the updated rules to
be retroactively applied to loyalty cards that have already been issued. This process can be run as a batch 
process or for individual cards


1050 (loyalty information) :- 
Click Retail > Periodic > Data distribution > Distribution schedule.
Run this process to send the loyalty configuration data from Microsoft Dynamics AX to the retail stores.

Friday, 23 February 2018

Error:- Taking too much time and getting error Execution Timeout Expired during the sync data (run jobs Dynamics Ax Retail)

Error:- Taking too much time and geting error Execution Timeout Expired during the sync data (run jobs Dynamics Ax Retail)
------------------------------------------------------------------------------------------------------------------------
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out   --- End of inner exception stack trace ---   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)   at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)   at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()   at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()   at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()   at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()   --- End of inner exception stack trace ---   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)   at Microsoft.Dynamics.AX.ManagedInterop.ClrBridgeImpl.InvokeClrInstanceMethod(ClrBridgeImpl* , ObjectWrapper* objectWrapper, Char* pszMethodName, Int32 argsLength, ObjectWrapper** arguments, Boolean* argsAreByRef, Boolean* isException)
--------------------------------------------------------------------------------------------------------------------


Solution Step Checks:-
--------------------------------------------------------------------------------------------------------------------
1. Check for Missing Index in Async Server Mesage database.

2. Delete old download sessions.

3. Always run the process in batch. Recursively (Decreasing the row of records to update).

4. Retail > Setup > Parameters > Retail Scheduler Parameters > Monitoring > Retention Period in Days

This parameter conditions the days for retaining monitoring data.
----------------------------------------------------------------------------------------------------------------------

SQL SERVER Qurery:-
----------------------------------------------------------------------------------------------------------------------
USE AsyncServerHQ
DELETE FROM DOWNLOADSESSION WHERE JOBID LIKE '%1%'
DELETE  FROM DOWNLOADSESSIONDATASTORE WHERE MESSAGE LIKE '%FAIL%'
DELETE  FROM DOWNLOADSESSIONDATASTORE WHERE MESSAGE LIKE '%APP%'
TRUNCATE TABLE DOWNLOADSESSIONDATASTORELOG
TRUNCATE TABLE UPLOADSESSION
TRUNCATE TABLE UPLOADSESSIONLOG

Use MicrosoftDynamicsAX
TRUNCATE TABLE [dbo].[RETAILCDXDOWNLOADSESSION]
TRUNCATE TABLE [dbo].[RETAILCDXDOWNLOADSESSIONDATASTORE]
TRUNCATE TABLE [dbo].[RETAILCDXDOWNLOADSESSIONDATASTORELOG]
TRUNCATE TABLE [dbo].[RETAILCDXUPLOADSESSION]
TRUNCATE TABLE [dbo].[RETAILCDXUPLOADSESSIONLOG]
---------------------------------------------------------------------------------------------------------------------

AX AOT
---------------------------------------------------------------------------------------------------------------------
If Problem does not solved by then ==> Modify Class > RetailCDXMonDataSync, Method > Run, add property > cmd.set_CommandTimeout([NewTimeout]); in object (cmd = new System.Data.SqlClient.SqlCommand) (30 seconds is default value in System.Data.SqlClient)

---------------------------------------------------------------------------------------------------------------------

SQL SERVER
----------------------------------------------------------------------------------------------------------------------
Unless you specify otherwise using the SqlCommand.CommandTimeout property, the .Net SqlClient Data Provider will wait no more than 30 seconds before cancelling the query and raising a timeout error.  You can set the CommandTimeout property to specify a longer value (in seconds) if a long-running query is normal and expected.

Long-running queries can be a symptom of the need for query and index tuning or blocking.  Examine the query plan in SQL Server Management Studio by pressing CTRL-L with the query in a query window to make sure indexes are used efficiently, additional indexes are needed or query tuning is needed.  A quick way to identify blocking is by running sp_who2 while the query is running to see if BlkBy contains a SPID of a blocking session.

--------------------------------------------------------------------------------------------------------------------------
If Items not Showing in POS and no Error in Sync Services (CDX)
--------------------------------------------------------------------------------------------------------------------------
Run below Query into Store Database

Alter Table ECORESPRODUCTTRANSLATION Column Name nvarchar(99) Not Null


--------------------------------------------------------------------------------------------------------------------------
If Item Price not Showing in POS and no Error in Sync Services (CDX)
--------------------------------------------------------------------------------------------------------------------------

Check Mark on below

1. Retail >Retail Parameter >Discount Tab >Check Mark on Use Default Pricing Engine for line item calculation

2. Sales and Marketing >Setup> Pricing/Discount >Active Price / Discount

Thursday, 7 September 2017

SQL SERVER REPAIR DATABASE FROM SUSPECT MODE

SQL SERVER REPAIR DATABASE FROM SUSPECT MODE

SQL Server database go into suspect mode. During that moment, you cannot work on the database as database go into suspect mode because primary file group get damaged and database fails to recover during the start of SQL Server.


SQL Server Suspect Database Reasons


  • Log files or data files have got damaged
  • Due to lack of disk space, suspect mode like issues crops up in SQL Server database
  • Due to improper shutdown of database Server, you mostly find SQL database in suspect mode
  • Inability of SQL to complete rollback operation or roll forward operation
  • How to Repair SQL Server Suspect Database


Trouble Shooting Steps:

1. Change the status of your database.
2. Set the database in 'Emergency' mode such as:

Query: ALTER DATABASE <DatabaseName> SET EMERGENCY


3. Check for any of the inconsistency by using Query: DBCC checkdb('DatabaseName')
4. Bring the database to MULTI USER mode

 Query:-ALTER DATABASE [DatabseName] SET MULTI_USER

5. If any error message even after using DBCC CHECKDB command, then quickly bring the database in SINGLE USER MODE by running the query mentioned below:

Query :-ALTER DATABASE <DatabaseName> SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

Friday, 26 May 2017

Failed to create a session;confirm that the user has the proper privileges to log on to Microsoft Dynamics


Solution 1: Delete Partitions & Check User Info Table


UPDATE USERINFO
SET SID='S-1-5-21-916693446-2822637979-541647007-1001', NETWORKALIAS='administrator', NETWORKDOMAIN='contoso', NAME='Vijay'
WHERE ID = 'Admin'
— This will replace the AX Admin user to your user – you can modify this query to replace other
— users as well, or you can later add new users from the AX GUI.
If  setup a new environment for you and imported the demo data using the “Test Data Transfer Tool” you can run into this error upon sync.  
The reason you get this error is that there are 3 partitions:   Ext, Initial and PS and user Info was only given to the initial partition,you need to do to resolve this issue is:

a. First in SQL review the userinfo table and checkout how many times you see the Admin ID in the table:  select * from userinfo where id = ‘admin’


b. I’m guessing you only see the admin record one time and this would be the problem.  When you have multiple partitions you should see the record in there for as many partitions as you have.  So, in our instance there should be 3 admin records in the userinfo table.


c. In SQL I usually run this command:  delete PARTITIONS where PARTITIONKEY in (‘ext’, ‘ps’)


d. Next open the AX client and navigate to:  System Administration > Setup > Partitions.


e. You should only see one partition called “Initial”.  We need to recreate the two we delete via our SQL script.  So create two new partitions called:  Ext and PS as seen below.


Partitions


f. Go review the userinfo table in SQL you should see that two new records have been automatically added for the administrator account.


g. Now try to sync the database in AX and you should have success!



Solution 2: Run Business Logic


The second thing you can try which occasionally works is to run the business logic not using IL.  You can disable this by:



a. In the AX client navigate to:  File > Tools > Options > Development hyperlink.

b. Unmark “Execute Business Operations in CIL”.


c.  Close the AX app and restart your AOS.


d. Open AX and try to Sync.



Solution3. Run a Full CIL.


a. To do this restart your AOS 1st and then from the AX Development Environment go to:


i. Build > Generate Full CIL.


Generate Full CIL in AX 2012


b. Now try to Sync.




Solution 4: Delete your AUC Files.


NOTE:  The AUC file is a cache of objects from the AOT.


a. Close out of AX.


b. Navigate to one of the following:


i. Windows XP and Windows 2003


C:\Documents and Settings\%username%\Local Settings\Application Data


ii. Windows Vista, Windows 7 and Windows 2008


C:\Users\%username%\AppData\Local


c. Delete the file or files with the extension .auc.


d. Open AX and try to Sync.




Solution 5: Improper Privileges


The user actually doesn’t have the proper privileges in SQL to run a sync which means they aren’t in the db.reader and db.datawrite roles check your SQL User Mapping.



Grant the AX AOS account permissions over the databases as follows:
AXProdNEW:
db_datareader
db_datawriter
db_ddladmin
public
axpermissions1
AXProdNEW_model:
public
axpermissions2
You can identify the AOS account by going to the services on the application server (start->
services.msc) and check the Log On tab:
axservices1
If you are using NETWORK SERVICES as the service account you will need to grant permissions to the machine$ account – Use the following query to do it:

Monday, 8 May 2017

Retail POS Opening Error Store Not Found

Getting Error While Open Retail POS after configuration of all POS AX setup :-

Retail POS Error:-




Event Viewer Error:-




Event Viewer Error:-

LSRetailPosis.POS.Program: LSRetailPosis.PosisException ---> System.Exception: Information about store: 000002 was not found.
   at LSRetailPosis.Settings.ApplicationSettings.LoadSettingsForTerminal(Terminal terminal)
   at LSRetailPosis.Settings.ApplicationSettings.InitializeSettings(String[] args)
   at LSRetailPosis.POS.Program.InitializeAndLoadPOS(String[] args, Boolean owned, SplashScreenForm splashScreenForm)
   --- End of inner exception stack trace ---
   at LSRetailPosis.POS.Program.InitializeAndLoadPOS(String[] args, Boolean owned, SplashScreenForm splashScreenForm)

   at LSRetailPosis.POS.Program.Main(String[] args).


Solution 

Check Application & Kernel Version and Update Retail Patch Binary Or Application Update, In my case I was battling with CU12 Update after binary update problem resolved.