Skip to content

Instantly share code, notes, and snippets.

View cgillis-aras's full-sized avatar

Chris Gillis cgillis-aras

View GitHub Profile
/*
This sample code is intended to be attached to a button through CUI.
The purpose of this code is to supplement the standard refresh functionality
with the ability to refresh an item with information from the database.
*/
var inn = this.getInnovator();
var doc = parent.frames[1].document;
if (doc)
// We need to pass the ID of the form into the dialog
var formNd = top.aras.getItemByName("Form", "Dialog Example", 0);
// Set the arguments being passed to the dialog
var param = {
title: "Dialog Example",
aras: top.aras,
formId: formNd.getAttribute("id"),
isEditMode: true
};
// We need to pass the ID of the form into the dialog
var formNd = top.aras.getItemByName("Form", "Dialog Example", 0);
// Set the arguments being passed to the dialog
var param = {
title: "Dialog Example",
aras: top.aras,
formId: formNd.getAttribute("id"),
isEditMode: true,
dialogWidth: 500,
// Set the arguments being passed to the dialog
var param = {
title: "Dialog Example",
aras: top.aras,
header: "Our cool new dialog of an HTML Page!",
isEditMode: true,
dialogWidth: 500,
dialogHeight: 250,
content: '../customer/test_page.html'
};
var param = {
aras: top.aras,
type: 'SearchDialog',
dialogWidth: 700,
dialogHeight: 450,
itemtypeName: 'Part'
};
function callback(res) {
if (res) {
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../styles/default.css" />
<script type="text/javascript">
window.dialogArguments = window.frameElement.dialogArguments;
var aras = dialogArguments.aras;
document.title = dialogArguments.title;
// We need to pass the ID of the form into the dialog
var formNd = top.aras.getItemByName("Form", "Dialog Example", 0);
// Set the arguments being passed to the dialog
var param = {
title: "Dialog Example",
aras: top.aras,
formId: formNd.getAttribute("id"),
isEditMode: true
};
// The field on the form is called "name". We are getting that value to return.
var usersName = getFieldByName("name").getElementsByTagName("input")[0].value;
result = top.aras.newObject();
result.usersName = usersName;
parent.returnValue = result;
window.close();
// The field on the form is called "name". We are getting that value to return.
var usersName = getFieldByName("name").getElementsByTagName("input")[0].value;
result = top.aras.newObject();
result.usersName = usersName;
parent.args.dialog.result = result;
parent.args.dialog.close();
// The field on the form is called "name". We are getting that value to return.
var usersName = getFieldByName("name").getElementsByTagName("input")[0].value;
result = top.aras.newObject();
result.usersName = usersName;
parent.dialogArguments.dialog.close(usersName);