You need to sign in to do that
Don't have an account?
Creation of page layouts using Java
LayoutItem[] MyLayout=new LayoutItem[100]; LayoutItem item1=new LayoutItem(); item1.setField(nf1.getFullName()); MyLayout[0]=item1; LayoutColumn[] lc= new LayoutColumn[5]; LayoutColumn lc1= new LayoutColumn(); lc1.setLayoutItems(MyLayout); lc[0]=lc1; LayoutSection[] ls=new LayoutSection[5]; LayoutSection ls1=new LayoutSection(); ls1.setLayoutColumns(lc); LayoutSectionStyle lstyle; ls1.setStyle(LayoutSectionStyle.OneColumn); ls[0]=ls1; Layout MyLayout1=new Layout(); MyLayout1.setFullName(co.getFullName()+"-Mylayout"); MyLayout1.setLayoutSections(ls); try { AsyncResult[] avl = msfdc.create(new Metadata[]{MyLayout1}); if(avl.length>0) { System.out.println("page layout Created Successfully"); } } catch(Exception e) {System.out.println("page layout Error"+e);}
where 'co' is the custom object created and 'nf1' is the custom field .I tried '.' for setname function but its not working.