Objective: Develop and extend features to enhance the management of released products including tracking product reviews
Add new field for rating which you created earlier and display the rating as * on the invent table form
Get the Rating from ProductReviewForm (max value rating for the form)"
{
public void init()
{
next init();
ProductReview productReview;
FormDataSource inventTableDS = this.datasource(formDataSourceStr(EcoResProductDetailsExtended, InventTable));
{
// Fetch the highest rating for the current product
select firstOnly maxof(ReviewRating) from productReview
where productReview.ProductId == inventTableDS.cursor().(fieldNum(InventTable, ItemId));
{
str imagePath;
BinData binData = new BinData();
container imageContainer;
// Determine the image path based on the rating
switch (productReview.ReviewRating)
{
case 1:
imagePath = resourceStr("Stars_1");
break;
case 2:
imagePath = resourceStr("Stars_2");
break;
case 3:
imagePath = resourceStr("Stars_3");
break;
case 4:
imagePath = resourceStr("Stars_4");
break;
case 5:
imagePath = resourceStr("Stars_5");
break;
default:
imagePath = resourceStr("NoStarRating");
break;
}
binData.loadFile(imagePath);
imageContainer = binData.getData();
inventTableDS.cursor().(fieldNum(InventTable, RatingStar)) = imageContainer;
inventTableDS.refresh();
}
}
}
ErrorOperationCanceledException: The operation was canceled.ProductManagement (ISV) [YD]C:\Program Files (x86)\MSBuild\Microsoft\Dynamics\AX\Microsoft.Dynamics.Framework.Tools.BuildTasks.17.0.targets63"
The form with name ecoresproductdetailsextended could not be opened."