priyanka's Profile
Agile User
74
Points

Questions
8

Answers
8

  • Agile User Asked on August 16, 2019 in Product Collaboration.

    Hi Janne,

    If you want to load manufacturer using SDK then here is my code

    First you have to load item or part

    IItem itemObj7 = (IItem)AgileUtility.iAgileSession.getObject(ItemConstants.CLASS_PARTS_CLASS, “Item name”);

    then you have to load manufacturer table on that part

    ITable tab7 =itemObj7.getTable(ItemConstants.TABLE_MANUFACTURERS);

    then using loop iterate each and every row of manufacturer and access there attribute

     

    for (Iterator iterator10 = tab7.iterator(); iterator10.hasNext();)
    {
    partsetflag = true;
    IRow manurow1 = (IRow) iterator10.next();
    String mfrname = manurow1.getCell(ItemConstants.ATT_MANUFACTURERS_MFR_NAME).toString();
    String MFRPART = manurow1.getCell(ItemConstants.ATT_MANUFACTURERS_MFR_PART_NUMBER).toString();
    String MfrReach = manurow1.getCell(ItemConstants.ATT_MANUFACTURERS_MFR_PART_LIST20).toString();
    System.out.println(mfrname+” “+MFRPART + ” “+MfrReach);
    if(MfrReach.equalsIgnoreCase(“No”) || MfrReach.equals(“”))
    {
    System.out.println(“null found for “+MFRPART);
    partsetflag = false;
    break;

    }
    }

    if you want to access page two attribute or load manufacturer object then

    IManufacturer mfr1 = (IManufacturer)AgileUtility.iAgileSession.getObject(IManufacturer.OBJECT_TYPE, mfrname );
    System.out.println(“Manufacturer : ” + mfr1.getName());
    MName = mfr1.getName();

    String lovvalue = mfr.getValue(ManufacturerConstants.ATT_PAGE_TWO_MULTILIST01).toString();
    mfr1.setValue(ManufacturerConstants.ATT_GENERAL_INFO_LIFECYCLE_PHASE, “Debarred”);

     

    Similarly for manufacturer parts :-

     

    IManufacturerPart mfrPartObj =(IManufacturerPart) AgileUtility.iAgileSession.getObject(ManufacturerPartConstants.CLASS_MANUFACTURER_PART, MFRPART );

    String MPDesc = mfrPart1.getValue(
    ManufacturerPartConstants.ATT_GENERAL_INFO_MANUFACTURER_PART_NUMBER)
    .toString();

    Hopefully it will help you.

     

    Thanks

    Priyanka

    • 1324 views
    • 2 answers
    • 1 votes
  • Hi All,

    Thanks for viewing but after struggling and try all permutation and computation …Now its work for me.

    For your reference if anyone will require same thing in future i am updating my working code here.

    ArrayList<String> UserGroupList = new ArrayList<String>();

    // Initialize your usergrouplist here

    IQuery query10 = (IQuery) AgileUtility.iAgileSession.getObject(IQuery.OBJECT_TYPE,

    query10.setCaseSensitive(false);
    HashMap mypar = new HashMap();

    query10.setParams(new Object[] {QueryConstants.PARAM_LIST_ELEMENT_CLASS,IUserGroup.OBJECT_TYPE});
    query10.setParams(new Object[] {UserGroupList});

    Iterator iter10 =query10.execute().iterator();
    while (iter10.hasNext()) {
    IRow row = (IRow) iter10.next();
    HashMap rowMap = new HashMap();
    IChange changeobj = (IChange) row.getReferent();

    changeobj.getId();
    // String number=program.getName();
    String number = changeobj.getName();
    String name = (String) changeobj.getCell(
    ChangeConstants.ATT_COVER_PAGE_NUMBER).getValue();
    System.out.println(number);
    }

    • 1995 views
    • 2 answers
    • 0 votes
  • Agile User Asked on June 18, 2019 in Other APIs.

    Hi Liran,

    If you detailed your requirement then it would be more helpful for me to provide solution but I think below code helpful for you.

     

    import com.agile.agileDSL.ScriptObj.IBaseScriptObj
    // add other import statements here
    import com.agile.api.ItemConstants

    void invokeScript(IBaseScriptObj obj) {

    oldItemDescription = obj.getValueByAttId(ItemConstants.ATT_PAGE_TWO_LIST14);
    obj.setValueByAttId(ItemConstants.ATT_PAGE_TWO_LIST14, “Capital Item”);
    newItemDescription = obj.getValueByAttId(ItemConstants.ATT_PAGE_TWO_LIST14);
    obj.logMonitor( “Old description: ” + oldItemDescription + “| ” + “New description: ” + newItemDescription);
    }

     

    Thanks

    priyanka

    • 1394 views
    • 1 answers
    • 0 votes
  • Agile User Asked on May 24, 2019 in Agile PLM (v9).

    Hi Surya,

    I don’t think your first requirement could be possible without PX.  You can check attribute value using workflow criteria and allow to set of values but you can’t set it without px. To set value in attribute you need a external event or Java PX/Event.

    Thanks
    Priyanka

    • 1687 views
    • 4 answers
    • 0 votes
    • 1826 views
    • 3 answers
    • 0 votes
  • Hi JanB,
    Can you explain what you have done.
    I also needed to do same thing, When escalation period expired then needed to send notification mail to each user’s whose approval is awaiting everyday till he or she is not approve the same.

    Thanks
    Priyanka

    • 2873 views
    • 3 answers
    • 0 votes
  • Hi,
    After struggling whole day and after posting question on myagileplm community i just click on view tab of my TOAD where i found view agile_objects where i get to know that attachment table is a table where file folder entry is made similar like item ,psr,change table.

    So i made a query with attachment table to get id of my particular object join with page_two and page_three table and for list type value again join entry id with listentry table.
    All in all my purpose resolved.

    Thanks for your concern.

    Thanks
    Priyanka

    This answer accepted by priyanka. on April 25, 2024 Earned 15 points.

    • 1521 views
    • 3 answers
    • 1 votes
  • Agile User Asked on August 9, 2018 in Agile PLM (v9).

    Hi,
    I have to do similar thing. Once user select one value from first LOV then on the bases of selected value second LOV selective value will populate and one default value will be set.
    Does it possible with Agile SDK, if yes please share some code or steps for further development.
    Secondly if it is only possible to groovy please share groovy script for basic idea.
    Any help will be appreciable.

    • 4025 views
    • 4 answers
    • 0 votes