Create form

Hello I want to write method to create form for following case 1.create section in a form can anyone please explain?
Parents
  • Former Member
    Former Member
    Hi Angela, I presume you want the onClick event to show the other form as a Dialog.  
    var ctx = document.thisItem;
    var q = ctx.newItem("Form", "get");
    q.setAttribute("select", "id,width,height");
    q.setProperty("name", "DEF");  //your form name goes here
    var r = q.apply();
    
    var height = r.getProperty("height", "500");
    var width = r.getProperty("width", "500");
    
    var param = new Object();
    param.title = "Title of dialog box goes here"; 
    param.formId = r.getItemByIndex(0).getID(); // the id of the Form to be used
    param.item = ctx;
    param.aras = top.aras; // the aras object
    param.isEditMode=true;
    
    var res = showModalDialog(
    "ShowFormAsADialog.html",
    param,
    "dialogHeight:" + height + "px; dialogWidth:" + width + 
    "px; " +
    "status:0; help:0; resizable:1; scroll:0;"
    );
    
    Put the above code into a method that you call from the onClick of the button.
    This should show the dialog box DEF. Hope this helps. Brian.
Reply
  • Former Member
    Former Member
    Hi Angela, I presume you want the onClick event to show the other form as a Dialog.  
    var ctx = document.thisItem;
    var q = ctx.newItem("Form", "get");
    q.setAttribute("select", "id,width,height");
    q.setProperty("name", "DEF");  //your form name goes here
    var r = q.apply();
    
    var height = r.getProperty("height", "500");
    var width = r.getProperty("width", "500");
    
    var param = new Object();
    param.title = "Title of dialog box goes here"; 
    param.formId = r.getItemByIndex(0).getID(); // the id of the Form to be used
    param.item = ctx;
    param.aras = top.aras; // the aras object
    param.isEditMode=true;
    
    var res = showModalDialog(
    "ShowFormAsADialog.html",
    param,
    "dialogHeight:" + height + "px; dialogWidth:" + width + 
    "px; " +
    "status:0; help:0; resizable:1; scroll:0;"
    );
    
    Put the above code into a method that you call from the onClick of the button.
    This should show the dialog box DEF. Hope this helps. Brian.
Children
No Data