How can I hide some columns in relationship grid base on the some rule of parent item type

I need to hide  some columns in relationship grid base on the some rules of parent item type when form on populated.

Is it possible?

  • yaa it's possible,may i know your requirement

  • I have a property department in parent item type,I would like to hide some columns in relationship grid depends on department property when the form on populated event.

  • it is possible when that relationshiptype is not added in any other item type's relationshiptype

  • please tell me how to do that, thanks.

  • Hi tenny,

    Hope this is useful.

    var inn=new Innovator();
    var cType=document.thisItem.getType();

    var iType=inn.newItem("ItemType","get");
    iType.setAttribute("where","[ItemType].name='"+cType+"'");
    iType=iType.apply();

    var RT=inn.newItem("RelationshipType","get");
    RT.setAttribute("where","[RelationshipType].source_id='"+iType.getID()+"' and [relationshiptype].name=''");//relationship type name
    RT=RT.apply();
    var relId=RT.getProperty("related_id");

    var nProp=inn.newItem("Property","get");
    nProp.setAttribute("where","[Property].source_id='"+relid+"' and [property].name='property name'");//say department
    nProp=nProp.apply();

    if(document.thisItem.getProperty("say department")==="")//give your dept name
    {
    nProp.setAction("edit");
    nProp.setProperty("is_hidden2","1");
    nProp=nProp.apply();
    }
    else{
    nProp.setAction("edit");
    nProp.setProperty("is_hidden2","0");
    nProp=nProp.apply();
    aras.clearClientMetadataCache();
    }

  • Hi Siva,

    thanks for sharing your sample code! Will it also work when several people work within the same instance in parallel? As you directly change the ItemType property I assume it will work well for a certain amount of people. But what will happen when around 1000 users will move around in the same ItemType? 

    I am also interested in the use case, but haven´t found a solution yet. But in the past I was thinking about a Method that uses dijit to influences the relationship content. But that was just an idea...

    Angela

    // EDIT: I think made some mistake reading your code. You only overwrite the property settings in the DOM, not in the database, correct? That of course shouldn´t make any trouble. :-)