Hi all,
I am currently working on a solution/integration where i now need to import sales discounts from an ERP system into Dynamicweb.
It seems to be possible using the DataIntegration module. However, there are some fields that i dont know what to put in or how it's calculated.
A note: I am exporting data from the ERP system, with full control(a simple .NET/C# application), to xml files, ready for DW(DataIntegration) to read.
These fields are:
- SalesDiscountCustomersAndGroups
- I believe this should be AccessUserIds and/or AccessUserGroupIds.However, I do not know the DW Id of neighter user nor usergroup. For users, I only know the AccessUserUserName(which is what i have defined a the key, defines "what" a unique user is) and the AccsssUserExternalID. For UserGroups, i only know the name. Can I uses either of these values, to specify a UserGroup and/or User that the sales discount valid/applied for?
- I took a look in the database, to see what DW enters in that field, for a user and a user group, which was:
- USR_256,GRP_4209 Where i believe USR_256 is a reference to a user with ID of 256, and GRP_4209, is a reference to the UserGroup with an id of 4209
- So in my case, for users, would USR_<AccessUserUserName> or USR_<AccsssUserExternalID> OR GRP_<AccessUserGroupGroupName> work?
- SalesDiscountDateFrom, SalesDiscountDateTo
- Is a BigInt DataType, how is this calculated/converted from DateTime?
This job would prob. run once a day, so in order to update existing sales discount (instead of deleting all, an reinsert them), i guess i would need to come up with a unique SalesDiscountID ?
Any help regarding importing sales discounts using the DataIntegration module is much appreciated. I would like to avoid deveoping a custom module/extender, in order to do the import, if possible.
I tested the import with a simple xml document i created manually: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <tables> <table tableName="EcomSalesDiscounts"> <item table="EcomSalesDiscounts"> <column columnName="SalesDiscountName"><![CDATA[-10% for merchants]]></column> <column columnName="SalesDiscountDescription"><![CDATA[Imported -10% for merchants]]></column> <column columnName="SalesDiscountDiscountType"><![CDATA[1]]></column> <column columnName="SalesDiscountCustomersAndGroups"><![CDATA[Merchants]]></column> <column columnName="SalesDiscountValuePercentage"><![CDATA[10]]></column> <column columnName="SalesDiscountValueType"><![CDATA[Percentage]]></column> </item> </table> </tables>
Although, this failed with the message:
Exception: The data types ntext and ntext are incompatible in the equal to operator.
I have attached a txt document with the full error message.
Any help on how to fix the error is very appreciated.
A sidenote: The fields "SalesDiscountCustomersAndGroups" and "SalesDiscountParameters" is the DataType "ntext" which microsoft seem to be deprecating in the future(comming version of ms sql server) as stated here: http://technet.microsoft.com/en-us/library/ms187993.aspx