I have added a product popup view and in that view i customize it to create a new product. by making formbase
method.
Now i am successfully saving an populating a new product but the problem is there is field in product called product image
. it is not showing in product create view and empty field is appearing in front of its label.
Further more i tried to also get the html by
$productObj->preDisplay();
$html = $productObj->display();
echo $html;
in html text the product image is empty. Any body can help in this regard?
pgr
12 September 2020 11:18
#2
What is that fields internal type, as seen in the vardefs?
1 Like
its varchar
as
'product_image' =>
array(
'name' => 'product_image',
'vname' => 'LBL_PRODUCT_IMAGE',
'type' => 'varchar',
'len' => '255',
'reportable' => true,
'comment' => 'File name associated with the note (attachment)'
),
pgr
12 September 2020 12:10
#4
I was hoping it was the correct SugarField type for images, but no, it seems to be handled differently.
Have a look at this, it will help you understand how itβs handled in other places.
β> https://github.com/salesagility/SuiteCRM/search?q=product_image&unscoped_q=product_image
For example, this
'name' => 'description',
'label' => 'LBL_DESCRIPTION',
),
),
6 =>
array(
0 =>
array(
'name' => 'product_image',
'label' => 'LBL_PRODUCT_IMAGE',
'customCode' => '<img src="{$fields.product_image.value}"/>',
),
),
),
),
),
);
yeah i have seen but it is in the quick create view not in the detail view.
pgr
13 September 2020 10:12
#6
The quickcreatedefs are in the same directory.
What I meant is that you can apply the logic that works in one place to the other place. Perhaps all you need to do is change the customCode here to look the same as in the Detail view:
array(
'name' => 'description',
'label' => 'LBL_DESCRIPTION',
),
),
5 =>
array(
0 =>
array(
'name' => 'product_image',
'customCode' => '{$PRODUCT_IMAGE}',
),
),
),
),
),
);
thank you for your reply i want to ask i have to modify the βview.quickcreate
β file?
pgr
14 September 2020 08:43
#8
Have you tried modifying modules/AOS_Products/metadata/quickcreatedefs.php#L109
? What happened?
yeah i tried but no success i thing the problem is it is not getting the variable {$PRODUCT_IMAGE}
pgr
18 September 2020 10:30
#10
Can you use a debugger to break when loading the view, and checking the assignments before entering the tpl?
yeah sure i will do that and if i cam upon any success i will update here