This is relatively new. Product whitelists are used to limit alerts for specific products. They can be based on time or not. To start, you should be given a ServiceRequestGroupConfiguration name and ProductSkuId (first request came in with client name and ProductItemId, if these are unique enough they can be used). If client name is given, lookup the client by name in Retail Engine and grab the Id. If ProductItemId or ProductId is given lookup using the MdmId column on the ProductItem table, and join that id to the ProductSku table, if the counts from the 2 match then we can use that.
--If using 1 for EnableEffectiveDates, StartDate is required but EndDate may be null --If using 0 for EnableEffectiveDates, both StartDate and EndDate should be null INSERT INTO [coordinator].[ConfigurationProductWhitelist] ([Id], [ServiceRequestGroupConfigurationId], [Active], [EnableEffectiveDates], [EffectiveStartDate], [EffectiveEndDate], [CreatedBy], [CreatedDate], [ModifiedBy], [ModifiedDate]) VALUES (NEWID(), @ServiceRequestGroupConfigurationId, 1, 1, @StartDate, @EndDate, @UserIdentifier, SYSUTCDATETIME(), @UserIdentifier, SYSUTCDATETIME());
Select from the table and find the Id you just created. Run the next inserts
--If given ProductItemId and you verified only one ProductSku exists for a ProductItemId INSERT INTO [coordinator].[ConfigurationProductWhitelistDetail] ([Id], [ConfigurationProductWhitelistId], [ProductSkuId], [CreatedBy], [CreatedDate], [ModifiedBy], [ModifiedDate]) SELECT NEWID(), @ConfigurationProductWhitelistId, [Id], @UserIdentifier, SYSUTCDATETIME(), @UserIdentifier, SYSUTCDATETIME() FROM [dbo].[ProductSku] WHERE ProductItemId IN ( SELECT Id FROM [dbo].[ProductItem] WHERE [MdmId] IN (@ProductItemId)) OR --If given ProductSkuIds INSERT INTO [coordinator].[ConfigurationProductWhitelistDetail] ([Id], [ConfigurationProductWhitelistId], [ProductSkuId], [CreatedBy], [CreatedDate], [ModifiedBy], [ModifiedDate]) SELECT NEWID(), @ConfigurationProductWhitelistId, [Id], @UserIdentifier, SYSUTCDATETIME(), @UserIdentifier, SYSUTCDATETIME() FROM [dbo].[ProductSku] WHERE MdmId IN (@ProductSkuIds)