Symantec IGA

 View Only
  • 1.  How to add value in multiValue attribute using BLTH

    Posted Sep 05, 2016 08:33 AM

    Hi,

     

    Can anyone help in explaining how to store values in a multi-value attribute using BLTH.  I tired the  setAttributeMultiValue() , but it keeps generating error on screen. I also tried addValueToAttribute() a try but it stores the attribute values as a one string i.e. append the new value to the end to last value.

    Also, how can we read values from a multi-value attribute using BLTH. Use Case is read value from one multi-value attribute(e.g.  outlets ) and store in another multi-value attribute (i.e. stores) .

    Thanks,
    Vasu



  • 2.  Re: How to add value in multiValue attribute using BLTH
    Best Answer

    Broadcom Employee
    Posted Sep 06, 2016 02:18 AM

    Hi Vasu,

     

    If you are using BLTH JavaScript, then following piece of code may help:

     

    var valuesVecObj = new java.util.Vector();

                    valuesVecObj.add("Value1");

                    valuesVecObj.add("Value2");

                    blthContext.getUser().setAttributeMultiValue (valuesVecObj);

     

     

    Thank you,

     

    Best regards,

    Sumeet



  • 3.  Re: How to add value in multiValue attribute using BLTH

    Posted Sep 06, 2016 02:48 AM

    HI Sumeet,

     

    We are using BLTH java code.  I have tried using  setAttributeMultiValue but it keeps generating error "Bad attribute specified " .

     

    Thanks,

    Vasu



  • 4.  Re: How to add value in multiValue attribute using BLTH

    Posted Sep 06, 2016 03:20 AM

    Hi Vasu,

     

    Assuming:

    Attribute Physical Name in the Directory = eTMyMultiValueAttr

    Attribute Multi-Valued value in the Directory = true

    Attribute Data Type in the Directory = String

    Attribute eTMyMultiValueAttr, is present on the profile screen.

     

    You could use the following code snippet:

     

    import java.util.Vector;

    .

    .

    try {

    Vector<String> MyMultiValuedAttribute = new Vector<String>();

    MyMultiValuedAttribute.add("FirstValue");

    MyMultiValuedAttribute.add("SecondValue");

    MyMultiValuedAttribute.add("ThirdValue");

     

    blthContext.getUser().setAttributeMultiValue("eTMyMultiValueAttr", MyMultiValuedAttribute );

    } catch (Exception ex)

    }

     

    Regards,


    Arij



  • 5.  Re: How to add value in multiValue attribute using BLTH

    Posted Sep 06, 2016 03:35 AM

    Hi Arij,

     

    I tired this approach , but it keeps generating error message   Bad attribute specified  . Below is the code snippet , as per the code, it should update the multi-value attribute "directReport" of user user4. 

     

    User user4 = blthContext.getUserProvider().findUser("user4",null);
    Vector<String> vct = new Vector<String>();
    vct.add("value1");
    vct.add("value2");
    vct.add("value3");
    user4.setAttributeMultiValue("directReport",vct);

     

    Thanks,

    Vasu



  • 6.  Re: How to add value in multiValue attribute using BLTH

    Posted Sep 06, 2016 04:59 AM

    Hi Vasu,

     

    It is working fine with me without any issues.

    Can you share Dir XMl extract and your profile screen?

    You also need to call user4.modifyObject() to persist changes.

     

    Regards,

     

    Arij



  • 7.  Re: How to add value in multiValue attribute using BLTH

    Posted Sep 06, 2016 06:25 AM

    Ok I got where the problem lies. The attribute was set as single valued in directory.xml while in LDAP it's multi-valued. Changes it to multi-valued and is working now. 

     

    Thanks,

    Vasu