Posted on 14/08/2019 05:25:00
Dear Morten,
Thank you for your reply.
Question 1: Use SQL Update query
Here is my code
public class ProductStockScheduleTaskAddin : BaseScheduledTaskAddIn
{
/// <summary>
/// Main method in ScheduledTask Addin - is run when scheduled Task is run
/// </summary>
/// <returns></returns>
public override bool Run()
{
bool ret = true;
Dynamicweb.Data.Database.ExecuteNonQuery("UPDATE EcomProducts SET ProductStock=0 WHERE StockNotAvailable=1");
Dynamicweb.Data.Database.ExecuteNonQuery("UPDATE EcomProducts SET ProductStock=9999999 WHERE StockNotAvailable=0");
return ret;
}
}
Question 2: It is delta update
Regards,
Tin Ma Ma