View Full Version: Custmize Web Inbasket

LawsonTalk > Coding, Program Errors and Bugs > Custmize Web Inbasket


Title: Custmize Web Inbasket
Description: How to customize recsume.htm


tbuvia - July 11, 2007 03:56 PM (GMT)
I am trying to customize our Web Inbasket and I cannot get my code to work. We would like to be able to see the accounting unit and the accounting unit description in the Web Inbasket. Can anyone help?

anets - July 12, 2007 03:14 PM (GMT)
I have done this to add the accounting unit and the account to the display. There are several places you will need to add code to get this to work. I'll send you an email from this site with my contact information and I can send you our recsum.htm file. I also modified the index.html file in the inbasket directory to allow the users to resize the recsum display window.

tbuvia - July 13, 2007 04:07 PM (GMT)
I am almost have it but my dilemma now is I can display my accounting unit information but the requisition information will not display. I am attaching my file, can someone take a look and tell me where I’m going wrong.

tbuvia - July 13, 2007 04:12 PM (GMT)
Sorry, I posted the wrong one.

tbuvia - July 13, 2007 04:23 PM (GMT)
/ ****************************************************************************************************
***************************
<!-- 8-)@(#)@8.0.3.7.286 2006-05-04 22:00:00 -->
<!-- @(#)$Header: /cvs/cvs_archive/ccs/src/webdocs/inbasket/execs/recsum.htm,v 1.1.2.1.6.20 2006/04/11 14:18:14 amits Exp $ -->
<html>
<META HTTP-EQUIV="Pragma" CONTENT="No-Cache">
<META HTTP-EQUIV="Expires" CONTENT="Mon, 01 Jan 1990 00:00:01 GMT">
<!--<Change title for top of screen> -->
<head><title>Requisition Summary</title></head>
<!--
/*************************************
Change History

Date: June 23 2000
Who: Greg Wegner
Changes:
1) Accept the product lines as passed parameters, instead of calling getwebuser
2) Fixed problems with numeric displays
3) Commented and cleaned up code
4) Use standard skins for html page displays

*************************************/
-->
<script src="/lawson/javascript/dme.js"></script>
<script src="/lawson/javascript/loganenv.js"></script>
<script src="/lawson/javascript/rndtodecimal.js"></script>
<SCRIPT src="/lawson/inbasket/useskin.js" language="JavaScript1.2"></SCRIPT>
<SCRIPT src="/lawson/inbasket/combine.js" language="JavaScript1.2"></SCRIPT>
<SCRIPT src="/lawson/inbasket/execs/styles.js" language="JavaScript1.2"></SCRIPT>
<SCRIPT src="/lawson/inbasket/execs/translate.js" language="JavaScript1.2"></SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
<!--
/* Parse passed parameters*/
var prmPassed=unescape(window.location.search)
prmPassed=prmPassed.substring(1)
prmPassed = prmPassed.split("|")

/* Set global variables passed from Inbasket driver.
These variables are common to all display execs */
var workUnit = unescape(prmPassed[0])
var workTitle = unescape(prmPassed[1])
var prodline = unescape(prmPassed[2])
//var ccsProdline = unescape(prmPassed[3])
var ccsProdline = "LOGAN"

//set other common global variables
ondrill = new Image (67,27) ;
ondrill.src = "/lawson/inbasket/images/drillaroo.gif";
offdrill = new Image (67,27) ;
offdrill.src = "/lawson/inbasket/images/drillaro.gif" ;

LoadTimer = setTimeout("LoadCatcher()", 3000)
var theblank = (window.location.protocol == 'http:')?'about:blank':'/lawson/inbasket/dot.htm'
var theFrameset = '';

if (isPortal)
{
theFrameset += ''
+ '<FRAMESET ROWS="100%,*,*,*,*" bordercolor="black" border=0 onLoad="LoadCatcher()">'
+ '<FRAME NAME="mainFrame1" SRC="/lawson/inbasket/dot.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="PRODLINE" SRC="dot.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="WFVARIABLE" SRC="dot.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="REQHEADER" SRC="dot.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="GLNAMES" SRC="dot.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="REQLINE" SRC="dot.htm" SCROLLING="AUTO">'
+ '</FRAMESET>'
}
else
{
theFrameset += ''
+ '<FRAMESET ROWS="100%,*,*,*,*" bordercolor="black" border=0 onLoad="LoadCatcher()">'
+ '<FRAME NAME="mainFrame1" SRC="/lawson/inbasket/webibwait.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="PRODLINE" SRC="dot.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="WFVARIABLE" SRC="dot.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="REQHEADER" SRC="dot.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="GLNAMES" SRC="dot.htm" SCROLLING="AUTO">'
+ '<FRAME NAME="REQLINE" SRC="dot.htm" SCROLLING="AUTO">'
+ '</FRAMESET>'
}

// These variables are specific to this display exec
var m_Company = ''
var m_ReqNumber = ''

//These variables are for using the translation table for label values
var lblRequisition = ''
var lblRequester = ''
var lblRequestDelDate = ''
var lblRequestLocation = ''
/************************************************************
This is the beginning of Thomas Buvia Custome code
*************************************************************/
var lblAccountUnit = ''
var lblAccUnitDesc = ''
/************************************************************
This is the end of Thomas Buvia Custome code
*************************************************************/
var lblItem = ''
var lblQuantity = ''
var lblDescription = ''
var lblUOM = ''
var lblUnitCost = ''
var lblExtendedCost = ''
var lblLines = ''
var lblInventoryTotal = ''
var lblNonStockTotal = ''
var lblSpecServTotal = ''
var lblRequisitionTotal = ''
var lblDrillAround = ''

//Write document frameset to window, then close it
window.document.write(theFrameset)
window.document.close()

//Functions-------------------------------------------------------------------------------------------

/************************************************************
Function: LoadCatcher

Purpose: Driver function called by frameset onLoad event driver

************************************************************/
function LoadCatcher()
{
//alert("here1")
LoadVariables()
clearTimeout(LoadTimer);
}
/************************************************************
Function: StoreVariables

Purpose: Function required by LoadVariable function.
Logan call requires logancall.func
************************************************************/
function StoreVariables()
{
m_Company = GetVariable("RQH_COMPANY")
m_ReqNumber = GetVariable("RQH_REQ_NUMBER")

GetReqHdrInfo()

}

/************************************************************
Function: GetReqHdrInfo

Purpose: Get Requisition header information via dme

************************************************************/
function GetReqHdrInfo()
{
if
( m_Company != '')
{
var logancall = new DMEObject(prodline, "REQHEADER")
logancall.out = "JAVASCRIPT"
logancall.field ="company;requester;req-location;acct-unit;req-del-date;nbr-lines;i-total;n-total;x-s-total"
logancall.index = "rqhset1"
logancall.key = m_Company + "=" + m_ReqNumber
logancall.func = "GetAcctUnitInfo()"
DME(logancall, "REQHEADER")
REQHEADERwin = self.REQHEADER
//alert(prodline)
}
else
{
alert("No variable setup for this workunit");
close();
}
}


/************************************************************
Function: GetReqDtlInfo

Purpose: Get Requisition detail information via dme
************************************************************/
function GetReqDtlInfo()
{
//alert("xxx")
var logancall = new DMEObject(prodline, "REQLINE")
logancall.out = "JAVASCRIPT"
//logancall.field ="item;description;quantity;buy-uom;unit-cost"
logancall.field ="item;description;quantity;entered-uom;unit-cost"
logancall.index = "rlnset1"
logancall.key = m_Company + "=" + m_ReqNumber
logancall.max = "250"
logancall.func = "GetAcctUnitInfo()"
DME(logancall, "REQLINE")
REQLINEwin = self.REQLINE
}

/************************************************************
Function: GetAcctUnitInfo

Purpose: Get Accounting Unit detail information via dme
************************************************************/


function GetAcctUnitInfo()
{

//alert("xxx")
var AccountUnit = REQHEADERwin.record[0].acct_unit
var Comp = REQHEADERwin.record[0].company
var logancall = new DMEObject(prodline, "GLNAMES")
logancall.out = "JAVASCRIPT"
logancall.field ="acct-unit;description"
logancall.index = "glnset1"
logancall.key = Comp + "=" + AccountUnit
logancall.func = "displayRecSum()"
DME(logancall, "GLNAMES")
GLNAMESwin = self.GLNAMES
}


/************************************************************
Function: displayRecSum

Purpose: Display the Requisition summary info via HTML

************************************************************/
function displayRecSum()
{

var requester = REQHEADERwin.record[0].requester
var reqDate = REQHEADERwin.record[0].req_del_date
var reqLocation = REQHEADERwin.record[0].req_location
var imageDrill = '<img border=0 alt="Drill Around Requisition" name=drill src=/lawson/inbasket/images/drillaro.gif >'
var drillText = "Drill Around"
var da1 = '<center><h3>'
var da2 = '</h3></center>'
var TableBorder = ''
var TableBgColor = ''
var ThAlign = ''
var ThBgColor = ''
var TdAlign = ''
var str = '' + '<HTML>'

+ '<HEAD><STYLE TYPE="text/css">'

if (isPortal)
{
if (is_ie)
str += PortalStyle + '</STYLE></HEAD>'
else
str += PortalStyleNetscape + '</STYLE></HEAD>'
imageDrill = ''
TableBorder = PortalTableBorder
TableBgColor = PortalTableBgColor
ThBgColor = PortalThBgColor

//old logic - keep it commented here in case clients have issues
//var msgXML = ''
//msgXML = "" + getTranslationXML()
//if (msgXML.length > 0)
// LoadTranslationLabelValues(msgXML)
//else
// HardCodeLabelValues()

//new phrase logic - use portal phrase object
//PT 149647 - Amit K Shah - 05-Sep-05
//144404 Fix does not work on MOE & HUBCAP
try
{
LoadTranslationPhrases()
}
catch(e)
{
HardCodeLabelValues()
}
if( ENVDOMAIN != '')
{
str += '<BODY onLoad="window.document.domain=\'' + ENVDOMAIN + '\'">'
}
else
{
str += '<BODY>'
}
}
else
{
str += HtmlStyle + '</STYLE></HEAD>'
drillText = ''
da1 = ''
da2 = ''
TableBorder = HtmlTableBorder
TableBgColor = HtmlTableBgColor
ThBgColor = HtmlThBgColor
HardCodeLabelValues()
str += '<BODY>'
}

var AccUnit = GLNAMESwin.record[0].acct_unit
var AccUnitDesc = GLNAMESwin.record[0].description
str += '<center>'
+ '<table><tr><td>'
+ '<h2>' + workTitle + ' ' + da1 //'</td><td>&#32&#32&#32&#32</td><td>'
+ '<a href="javascript:parent.DrillMsg()" '
+ ' >'
+ imageDrill + drillText
+ '</a>' + da2 + '</h2></center>'
+ '</td></tr></table>'
+ '<table border="' + TableBorder + '" bgcolor="' + TableBgColor + '">'
+ '<tr>'
+ '<th align="left" bgcolor="' + ThBgColor + '">' + lblRequisition + '</th>'
+ '<td align="left">' + m_ReqNumber + '</td>'
+ '<th align="left" bgcolor="' + ThBgColor + '">' + lblRequester + '</th>'
+ '<td align="left">' + requester + '</td></tr>'
+ '<tr>'
+ '<th align="' + ThAlign + '" bgcolor="' + ThBgColor + '">' + lblRequestDelDate + '</th>'
+ '<td align="left">' + reqDate + '</td>'
+ '<th align="' + ThAlign + '" bgcolor="' + ThBgColor + '">' + lblRequestLocation + '</th>'
+ '<td align="left">' + reqLocation + '</td>'
+ '</tr>'
mainFrame1.document.write(str)
+ '</table><br>'



str = '<table border="' + TableBorder + '" bgcolor="' + TableBgColor + '"><br>'
+ '<tr>'
+ '<th bgcolor="' + ThBgColor + '">' + lblAccountUnit + '</th>'
+ '<th bgcolor="' + ThBgColor + '">' + lblAccUnitDesc + '</th>'
+ '</tr>'
mainFrame1.document.write(str)

str = '<tr>'
+ '<td align="center">' + AccUnit + '</td>'
+ '<td>' + AccUnitDesc + '</td>'
+ '</tr>'
mainFrame1.document.write(str)



str = '<table border="' + TableBorder + '" bgcolor="' + TableBgColor + '">'
+ '<tr>'
+ '<th bgcolor="' + ThBgColor + '">' + lblItem + '</th>'
+ '<th bgcolor="' + ThBgColor + '">' + lblDescription + '</th>'
+ '<th bgcolor="' + ThBgColor + '">' + lblQuantity + '</th>'
+ '<th align="center" bgcolor="' + ThBgColor + '">' + lblUOM + '</th>'
+ '<th align="center" bgcolor="' + ThBgColor + '">' + lblUnitCost + '</th>'
+ '<th align="center" bgcolor="' + ThBgColor + '">' + lblExtendedCost + '</th>'
+ '</tr>'
mainFrame1.document.write(str)

for ( var i=0;i<REQLINEwin.NbrRecs;i++)
{
var item = REQLINEwin.record[i].item
var itemDesc = REQLINEwin.record[i].description
//PT 104206 - Amit K Shah - 30-Jun-05
//fractional part of quantity should be displayed.
var quantity = REQLINEwin.record[i].quantity
var uom = REQLINEwin.record[i].entered_uom
var unitCost = roundToDecimal(parseFloat(REQLINEwin.record[i].unit_cost), 5)
var extendedCost = roundToDecimal((parseFloat(quantity) * unitCost), 5)
str = '<tr>'
+ '<td align="center">' + item + '</td>'
+ '<td>' + itemDesc + '</td>'
+ '<td align="center">' + quantity + '</td>'
+ '<td>' + uom + '</td>'
+ '<td align="center">$' + unitCost + '</td>'
+ '<td align="center">$' + roundToDecimal(extendedCost,2) + '</td>'
+ '</tr>'
mainFrame1.document.write(str)
}

str = '</table><br>'
mainFrame1.document.write(str)

var reqLines = REQLINEwin.NbrRecs
var iTotal = roundToDecimal(parseFloat(REQHEADERwin.record[0].i_total), 2)
var nTotal = roundToDecimal(parseFloat(REQHEADERwin.record[0].n_total), 2)
var xsTotal = roundToDecimal(parseFloat(REQHEADERwin.record[0].x_s_total), 2)
var gTotal = roundToDecimal((parseFloat(REQHEADERwin.record[0].i_total) + parseFloat(REQHEADERwin.record[0].n_total) + parseFloat(REQHEADERwin.record[0].x_s_total)), 2)

str = '<table border="' + TableBorder + '" bgcolor="' + TableBgColor + '">'
+ '<tr>'
+ '<th align="Left" bgcolor="' + ThBgColor + '">' + lblLines + '</th>'
+ '<td align="right">' + reqLines + '</td>'
+ '</tr><tr>'
+ '<th align="Left" bgcolor="' + ThBgColor + '">' + lblInventoryTotal + '</th>'
+ '<td align="right">$' + iTotal + '</td>'
+ '</tr><tr>'
+ '<th align="Left" align="center" bgcolor="' + ThBgColor + '">' + lblNonStockTotal + '</th>'
+ '<td align="right">$' + nTotal + '</td>'
+ '</tr><tr>'
+ '<th align="Left" bgcolor="' + ThBgColor + '">' + lblSpecServTotal + '</th>'
+ '<td align="right">$' + xsTotal + '</td>'
+ '</tr><tr>'
+ '<th align="Left" bgcolor="' + ThBgColor + '">' + lblRequisitionTotal + '</th>'
+ '<td align="right">$' + gTotal + '</td>'
+ '</tr></table>'
+ '</BODY></HTML>'
mainFrame1.document.write(str)
mainFrame1.document.close()
if ( isPortal && ENVDOMAIN != '' ) {
window.document.domain = ENVDOMAIN
}
}


/************************************************************
Function: DrillMsg

Purpose: Display the Requisition drill-around window

************************************************************/
//PT 135550 - Amit K Shah - 7-Jun-05
//Drill explorer should open in same portal window for portal
function DrillMsg()
{
REQIDAOBJ=REQHEADERwin.DrillRef[0]
if(isPortal) {
try {
top.lawsonPortal.tabArea.tabs["PAGE"].clearNavlets();
top.lawsonPortal.drill.doDrill(window,"formRestoreCallback",REQIDAOBJ + "&_OUT=XML",null);
return;
} catch(e) {
}
}
wndREQHEADER=window.open(REQIDAOBJ,"wndREQHEADER",& #39;width=500,height=350,directories=no,toolbar=no,menubar=no,status=yes,resizable=yes,scrollbars=ye
s')
wndREQHEADER.focus;
}

/************************************************************
Function: formRestoreCallback

Purpose: Called when the Drill window is closed to rebuild the left nav and toolbar

************************************************************/
function formRestoreCallback() {
parent.window.initializeFramework();
}

/************************************************************
Function: LoadTranslationLabelValues()

Purpose: Load the label values from the translation table

************************************************************/
function LoadTranslationLabelValues(msgXML)
{
lblRequisition = getPhraseText(msgXML,"lblRequisition")
//alert("lblRequisition = " + lblRequisition)
if (lblRequisition.length < 1) lblRequisition = 'Requisition'
lblRequester = getPhraseText(msgXML,"lblRequester")
if (lblRequester.length < 1) lblRequester = 'Requester'
lblRequestDelDate = getPhraseText(msgXML,"lblRequestDelDate")
if (lblRequestDelDate.length < 1) lblRequestDelDate = 'Requested Delivery Date'
lblRequestLocation = getPhraseText(msgXML,"lblRequestLocation")
if (lblRequestLocation.length < 1) lblRequestLocation = 'Requesting Location'
lblItem = getPhraseText(msgXML,"lblItem")
//alert("lblItem = " + lblItem)
if (lblItem.length < 1) lblItem = 'Item'
lblQuantity = getPhraseText(msgXML,"lblQuantity")
if (lblQuantity.length < 1) lblQuantity = 'Quantity'
lblDescription = getPhraseText(msgXML,"lblDescription")
if (lblDescription.length < 1) lblDescription = 'Description'
lblUOM = getPhraseText(msgXML,"lblUOM")
if (lblUOM.length < 1) lblUOM = 'UOM'
lblUnitCost = getPhraseText(msgXML,"lblUnitCost")
if (lblUnitCost.length < 1) lblUnitCost = 'Unit Cost'
lblExtendedCost = getPhraseText(msgXML,"lblExtendedCost")
if (lblExtendedCost.length < 1) lblExtendedCost = 'Extended Cost'
lblLines = getPhraseText(msgXML,"lblLines")
if (lblLines.length < 1) lblLines = 'Lines'
lblInventoryTotal = getPhraseText(msgXML,"lblInventoryTotal")
if (lblInventoryTotal.length < 1) lblInventoryTotal = 'Inventory Total'
lblNonStockTotal = getPhraseText(msgXML,"lblNonStockTotal")
if (lblNonStockTotal.length < 1) lblNonStockTotal = 'Non Stock Total'
lblSpecServTotal = getPhraseText(msgXML,"lblSpecServTotal")
if (lblSpecServTotal.length < 1) lblSpecServTotal = 'Special and Services Total'
lblRequisitionTotal = getPhraseText(msgXML,"lblRequisitionTotal")
if (lblRequisitionTotal.length < 1) lblRequisitionTotal = 'Requisition Total'
lblDrillAround = getPhraseText(msgXML,"lblDrillAround")
if (lblDrillAround.length < 1) lblDrillAround = 'Drill Around'
drillText = lblDrillAround
}

/************************************************************
Function: LoadTranslationPhrases()

Purpose: Load the translation phrases from the portal object

************************************************************/
function LoadTranslationPhrases()
{
lblRequisition = parent.pfMsgs.getPhrase("lblRequisition")
//alert("lblRequisition = " + lblRequisition)
if (lblRequisition.length < 1) lblRequisition = 'Requisition'
lblRequester = parent.pfMsgs.getPhrase("lblRequester")
if (lblRequester.length < 1) lblRequester = 'Requester'
lblRequestDelDate = parent.pfMsgs.getPhrase("lblRequestDelDate")
if (lblRequestDelDate.length < 1) lblRequestDelDate = 'Requested Delivery Date'
lblRequestLocation = parent.pfMsgs.getPhrase("lblRequestLocation")
if (lblRequestLocation.length < 1) lblRequestLocation = 'Requesting Location'
lblItem = parent.pfMsgs.getPhrase("lblItem")
if (lblItem.length < 1) lblItem = 'Item'
lblQuantity = parent.pfMsgs.getPhrase("lblQuantity")
if (lblQuantity.length < 1) lblQuantity = 'Quantity'
lblDescription = parent.pfMsgs.getPhrase("lblDescription")
if (lblDescription.length < 1) lblDescription = 'Description'
lblUOM = parent.pfMsgs.getPhrase("lblUOM")
if (lblUOM.length < 1) lblUOM = 'UOM'
lblUnitCost = parent.pfMsgs.getPhrase("lblUnitCost")
if (lblUnitCost.length < 1) lblUnitCost = 'Unit Cost'
lblExtendedCost = parent.pfMsgs.getPhrase("lblExtendedCost")
if (lblExtendedCost.length < 1) lblExtendedCost = 'Extended Cost'
lblLines = parent.pfMsgs.getPhrase("lblLines")
if (lblLines.length < 1) lblLines = 'Lines'
lblInventoryTotal = parent.pfMsgs.getPhrase("lblInventoryTotal")
if (lblInventoryTotal.length < 1) lblInventoryTotal = 'Inventory Total'
lblNonStockTotal = parent.pfMsgs.getPhrase("lblNonStockTotal")
if (lblNonStockTotal.length < 1) lblNonStockTotal = 'Non Stock Total'
lblSpecServTotal = parent.pfMsgs.getPhrase("lblSpecServTotal")
if (lblSpecServTotal.length < 1) lblSpecServTotal = 'Special and Services Total'
lblRequisitionTotal = parent.pfMsgs.getPhrase("lblRequisitionTotal")
if (lblRequisitionTotal.length < 1) lblRequisitionTotal = 'Requisition Total'
lblDrillAround = parent.pfMsgs.getPhrase("lblDrillAround")
if (lblDrillAround.length < 1) lblDrillAround = 'Drill Around'
drillText = lblDrillAround
//alert("drillText = " + drillText)
//test for language
//lblWorkUnit = getPhraseText(msgXML,"lblWorkUnit")
//alert("lblWorkUnit in " + xlateLanguage + " is " + lblWorkUnit)
}



/************************************************************
Function: HardCodeLabelValues()

Purpose: Hard Code the English label values

************************************************************/
function HardCodeLabelValues()
{
lblRequisition = 'Requisition'
lblRequester = 'Requester'
lblRequestDelDate = 'Requested Delivery Date'
lblRequestLocation = 'Requesting Location'

/************************************************************
This is the beginning of Thomas Buvia Custome code
*************************************************************/
lblAccountUnit = 'Accounting Unit'
lblAccUnitDesc = 'Description'
/************************************************************
This is the end of Thomas Buvia Custome code
*************************************************************/

lblItem = 'Item'
lblQuantity = 'Quantity'
lblDescription = 'Description'
lblUOM = 'UOM'
lblUnitCost = 'Unit Cost'
lblExtendedCost = 'Extended Cost'
lblLines = 'Lines'
lblInventoryTotal = 'Inventory Total'
lblNonStockTotal = 'Non Stock Total'
lblSpecServTotal = 'Special and Services Total'
lblRequisitionTotal = 'Requisition Total'
lblDrillAround = 'Drill Around'
}

//-->
</SCRIPT>
</head>
****************************************************************************************************
***************************/

anets - July 13, 2007 08:02 PM (GMT)
In the section:
function GetReqHdrInfo()

Shoudn't the line:
logancall.func = "GetAcctUnitInfo()"

be this instead?:
logancall.func = "GetReqDtlInfo()"



Hosted for free by InvisionFree