Backoffice : ClassificationAttributeValue visibility issue - sap-commerce-cloud

Hybris 6.3.0.2
In ClassAttributeAssignment, user can changed the type to valueList so that he can show a pre-defined list of ClassificationAttributeValues in dropdown in product attribute tab for classificationAttribute.
Problem : The problem is very weird, as for some of classification attribute, value is not showing even though we are setting type as valuelist/enum and giving some classificationAttributeValues to feature descriptor values. Only na is showing, nothing else.
The whole pattern is random, for some of classification attribute, its working, for some of classification attribute, its not working. We are not able to identify why its happening because we match those attributes as well with one which is working with another which is not working. Both having same configuration but one of them its not showing.
In HMC, values are coming for all, but in Backoffice only its giving problem.
Can someone please guide us to fix this issue.

The problem seems to be in FeatureEditor in the below line.
ClassificationAttributeModel attribute = assignment.getClassificationAttribute();
ClassificationClassModel cclass = (ClassificationClassModel)attribute.getClasses().iterator().next();
We extend FeatureEditor to override method and fetched ClassificationClassModel from ClassAttributeAssignmentModel instead of ClassificationAttributeModel .

Related

Segmented Keys in ACUMATICA

I’ve created new Segmented Keys in ACUMATICA for use in a specific module. I would like to assign the Dimension name dynamically but I noticed it works only with hard code or name like [PXDimension(“VENDOR”)]
Also, I have some limitation to create an IF Conditional inside the customized field… it does not recognize the IF clause (see the image).
I would appreciate any suggestion how to solve this issue.
I haven't seen how your original attempt at PXDimension looked, but I'm going to take a guess and assume you tried to reference a new custom field contained in a setup table, something like:
[PXDimension(typeof(XXMySetup.usrMyCustomField))]
If that's indeed what you tried to do, one very important thing to do is to ensure that you have a view for your table in your graph, otherwise the attribute will not find the table and record in your cache. For instance:
public PXSetup<XXMySetup> XXMySetup;
Without this view declared in the graph, the dimension attribute will not work as expected. It would be nice if a clear exception was thrown in this case - I made the same mistake recently and it would have been helpful.

Ignore ID in Attribute Selection

I have a dataset with an unique id for each instance. Now I am running some Attribute Selection on that dataset. Concrete I use the CfsSubsetEval for selecting the relevant attributes.
The problem is that I don't want to include the id in this attribute selection, but I need it later to write out a .arff File (which should contain the id and the selected attributes).
I found some posts which used the FilteredClassifier. But in my case I want to have something like a FilteredAttributeSelection. Something like an exklusive view on the data for the AttributeSelection Algorithm.
Is there a way solving this problem?
Thanks in advance!
I solved the problem by copying the attribute vector (the ids) before the filter. After selecting the attributes I restore it.

Two Criteria in on jsf page

I have a jsf page with two query components with following view criterias:
VC1 and two bind variabe a(required) and b,
VC2 and two bind variable c(required) and d
Both applied to the same instance of viewObject and rendered property of both queries change with a pageFlowScope parameter
When I apply VC2 view criteria and press search button an error appears: The attribute a(from VC1) is required
Whats the solution?
Required parameter is required to be set, even if not used.So you either have to set it with some value or remove require restriction.
In most cases ViewCriteria parameters shouldn't have require property set. And this is default behavior for such parameters in 12c. I assume you using some of 11g releases.
But may be you trying to solve your problem in a wrong way? If it is the case, give us more details on your problem, you trying to solve.

Magento: Attribute always returns default value in catalog view, works fine in product view

I've created a new Yes/No attribute for products. I've extended the Product model to do some custom logic and the custom functions are working everywhere.
When I initially tried getting the custom attribute value, I ran into some issue. Magento wasn't loading it for me, so calls to $product->getMyAttributeName() did nothing. In the product views, I got it working with this additional function:
public function getAttrVal($attr_name)
{
return $this->getResource()->getAttribute($attr_name)->getFrontend()->getValue($this);
}
So that worked great when viewing a product on the frontend. It would fetch the assigned value if set, or the default if not.
When I view any Category (grid of all products in that category), the same exact code is being executed. But my getAttrVal() function always returns the default value, even if I've explicitly set this value for my product.
I can't, for the life of me, figure out why the attribute loads correctly in the Product view but the Category view always grabs the default value, despite running the same exact code. Any thoughts?
Because Magento uses an EAV model for its extensible catalog attributes, not every attribute may be carried over onto every page. Try fiddling with the "displayed in catalog" and other related variables on the attribute, and it may fix your problem. If not, say so and we can try other things.
Hope that helps!
Thanks,
Joe

Set value of datetime field to null

So, I´ve got an issue that someone might have solved (or so I hope). I have a datetime field that I use in a contenttype (on a listtemplate) that has its own editform.
Here´s a walkthrough of what happens:
Adding a value to the datetime column and saving the updated value shows up (as expected).
Updating the datetime column and adding null (emptying out the value) via the editform. The value isn´t updated but instead showing the old value.
I did some experimenting with this and I came to the conclusion that if I add an eventreceiver and try to update the value there it doesn´t even enter the eventreceiver as a blank string (I had an idea that the value is as a blank string and sharepoint can´t parse that to a null datetime) which leads me to think that there´s an issue with the fieldcontrol that causes this. I also found this article on MSDN which seems to be around the same issue. And also, the datetime field in the contenttype isn´t required.
Any ideas or suggestions?
UPDATE:
Apparently this only happens when I use a custom editform. When I use one of built in listtemplates this works like a charm.
I've had similar issues with this in the past. It is indeed a known bug. One work around is to set the field to the min or max value of the type and check for this value wherever needed and do the appropriate conversions. Depending on your setup and use, you could create a trigger to convert min/max values to null and thus minimize the code required to handle such a work around.
After some deep investiongation I have found that the root of this problem is related to the fact that I was using XML node propagation between the columns in the list and the actual xml file. I had prevoiusly been struggling with this regarding stardard text fields and thought that I had taken care of the issue..apparently not. DateTime fields apparently will not get sent to the eventreceiver afterproperties if it is null as thus my code will not pick it up as a null value. I had to take case of that and add them to afterproperties if I can´t find them in afterproperties. I will make a blogpost series about these issues and post the links to this post shortly.
UPDATE:
I have now completed a blogpost about how I solved this issue. Feel free to check it out:
http://johanleino.wordpress.com/2009/08/24/node-demotion-does-not-work-with-blank-empty-values/

Resources