Not able to select a value from the Multilist field of Manufacturer Part
Hi,
I am trying to set a P2 multilist value through SDK. The same setSelection is working for Items but not for Manufacturer Part.
Can anyone suggest where m doing wrong.
ICell cm = mfpart.getCell(ManufacturerPartConstants.ATT_PAGE_TWO_MULTILIST01);
System.out.println(cm);
IAttribute attribute = cm.getAttribute();
System.out.println(attribute);
IAgileList availValues = attribute.getAvailableValues();
System.out.println(availValues); //getting null here though value exists in field
Object[] vals = availValues.getChildren();
System.out.println(vals);
Well, the “ManufacturerPartsConstants” is probably the key. When you say, “Page Two MultiList”, are you referring to the Page 2 Attribute within the Manufacturer’s Part class itself? (Base ID 2090 in my system) Or the Change Order/MCO redlines? Or item table itself?
I ask because the ManufacturerPartsConstants doesn’t have ATT_Page_Two_Multilist01 as one of its legal values. Instead, use something along the lines of <change.setValue(1575, null); > , <String division = item.getValue(1004)>, or <item.setValue(1279, “Each”)> to set or get a value based off of the Base ID instead.
Let us know if you need further clarification.
Try something like this, but modify it for the specific base ID of what you’re looking at getting.
(This is mine in the case of a SaveAs event, works to update Item values based off of Product Line)
try{
IItem item = (IItem) session.getObject(IItem.OBJECT_TYPE, newNumber);
String division = item.getValue(1004) //get Product Line of created item
// then I add a few if statements to my script
item.setValue(2029, “TBD”) //update US HTS code to TBD
}catch…
Hi Matt,
I tried using the BaseID as well. We are updating the Page Two field of Manufacturer part.
Whatever the value am trying to update, it says it cannot have that value. Posted the error message below.
Error:
Invalid cell value. Cell “Page Two.External Access (for CMs)” cannot have value “1”
Hi Nagma,
Can you make sure that your multilist has “1” as one of its legal values? Remember, you’ve used a MultiList here, not a text box, so you need a value that is on the current dropdown of your list.
Does that help?