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);

Agile Talent Asked on June 19, 2017 in Agile PLM (v9),   Product Collaboration.
Add Comment
4 Answer(s)

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.

Agile Angel Answered on June 19, 2017.
Add Comment

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…

Agile Angel Answered on June 19, 2017.
Add Comment

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”

Agile Talent Answered on June 20, 2017.
Add Comment

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?

Agile Angel Answered on June 20, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.