The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss SalesLogix legacy development including views, scripts, etc.. View the code of conduct for posting guidelines.
|
|
|
|
CloseCurrentView issues ??
Posted: 24 Jan 08 8:52 AM
|
Hello All,
I have legacy form when i click OK i call the scripts below and i get general error message regarding CLose CurrentView.
When i execute the client network using many PCs it's work fine. but when i execute the same version under a server it's give to me this error.
Can please give me some soulution ?
Atmane Montreal / CA / QC
sub main
GlobalInfoFor "GridMode",grdmode GlobalInfoFor "EditModeB",EditModeB
if grdmode = "Add" then DoInvoke "Basic","Opportunity:CTBR Quote Project Associate" end if
GlobalInfoFor "ProjID",ProjectID
if isNull(ProjectID) or ProjectID="" then ProjectID = getPropertyOf("CTBRProjectsVersionsCTBRProjectsVersionsID","text") end if
'msgbox "step .1..." & grdmode
if grdmode = "Edit" then 'msgbox "step .2..." & grdmode if getPropertyof("qty","text")="" then setPropertyof "qty","text", 1 setPropertyOf "EditBox1","text",getPropertyof("ActPr","text") end if
if EditModeB <> "EditOnly" then GlobalInfoFor "Comments",Comments if Comments = GetPropertyof("StudyRevisionComments","text") then v = msgbox("Your comments are the same a the previous version. Would you like to change it before saving ?",4) if v=6 then exit sub end if end if v = msgbox("Are you sure you want to save as a new version ?",4) if v <> 6 then closecurrentview true exit sub end if end if
version=cdbl(GetPropertyOf("ProjRev","Text"))
NEWstatus=GetPropertyOf("PickList","Text") if not isnumeric(GetPropertyOf("ActPr","Text")) then NEWactual=0 else NEWactual=cdbl(GetPropertyOf("ActPr","Text")) end if GlobalInfoFor "ProjectID",ProjectID
QuoteID = ProjectID handle = dbOpenSQL("SELECT CTBR_PROJECTS_VERSIONSID FROM CTBR_QUOTE_PROJECTS WHERE CTBR_QUOTE_PROJECTSID='" & QuoteID & "'",false) prjVerKey = dbgetvalue(handle,"CTBR_PROJECTS_VERSIONSID") dbclose(handle) handle = dbOpenSQL("SELECT CTBR_PROJECTSID FROM CTBR_PROJECTS_VERSIONS WHERE CTBR_PROJECTS_VERSIONSID='" & prjVerKey & "'",false) prjKey = dbgetvalue(handle,"CTBR_PROJECTSID") dbclose(handle) newVerKey=""
if version >1 then if EditModeB = "Add" or EditModeB="EditOnly" then prjKey = ProjectID hnd = DBOpensql("SELECT MAX(PROJECT_VERSION) AS MAXVER FROM CTBR_PROJECTS_VERSIONS WHERE CTBR_PROJECTSID='" & prjKey & "'",1) latest_Version = dbgetvalue(hnd,"MAXVER") + 1 dbclose(hnd) newVerKey = getPropertyOf("CTBRProjectsVersionsCTBRProjectsVersionsID", "text") else version = version + 1 latest_Version = version newVerKey = DBCreateIDFor("CTBR_PROJECTS_VERSIONS") ' SET NEW ID end if
if EditModeB<>"EditOnly" then ' UPDATER LES CHAMPS NECESSAIRES POUR ORACLE VALIDATION AND FE EXCEPTION dbExecuteSQL "UPDATE CTBR_PROJECTS SET LATEST_VERSION_NUMBER=" & latest_Version & " WHERE CTBR_PROJECTSID='" & prjKey & "'" dbExecuteSQL "UPDATE CTBR_FRONTEND_STATUSES SET CTBR_PROJECTS_VERSIONSID='" & newVerKey & "' WHERE CTBR_PROJECTSID='" & prjKey & "' AND CTBR_PROJECTS_VERSIONSID<>'HISTORY'" end if
GlobalInfoSet "ThisPrj",PrjKey DoInvoke "Basic","Opportunity:CTBR Calculate Prj Sales"
hnd=DBOpenSQL("select STATUS_MARKETING, VERSION_DATE, PRICING_CURRENCY , PRICING_ACTUAL, CTBR_PROJECTS_VERSIONSID from CTBR_PROJECTS_VERSIONS where CTBR_PROJECTSID='"+prjKey+"' and PROJECT_VERSION="+cstr(version-1)+"",true)
if DBRecordCount(hnd)>0 then if isnumeric(DBGetValue(hnd,"PRICING_ACTUAL")) then OLDactual=cdbl(DBGetValue(hnd,"PRICING_ACTUAL")) else OLDactual=0 end if
OLDstatus=DBGetValue(hnd,"STATUS_MARKETING") ' CALCUL DE LA VENTE RÉELLE ' COLLECTE DES INFORMATIONS NECESSAIRES lastMktStatus = UCASE(dbgetvalue(hnd,"STATUS_MARKETING")) lastPrice = dbgetvalue(hnd,"PRICING_ACTUAL") lastCurrency = dbgetvalue(hnd,"PRICING_CURRENCY")
currentMktStatus = UCASE(getPropertyOf("PickList","text")) currentPrice = GetPropertyOf("ActPr","Text") currentCurrency = getpropertyof("PickList5","Text") isChange = 0 type_sale = "" amount_sale = 0
if lastMktStatus<>"" and currentMktStatus<>"" then ' SI LA DERNIERE VERSION AVAIT COMME STATUS CON ET QUE LA PRESENTE EST CAN ALORS C'EST UNE ANNULATION
If lastMktStatus = "CON" and currentMktStatus = "CAN" then type_sale = "Cancelled" if currentPrice >0 then amount_sale = (lastPrice) - ((currentPrice)) else amount_sale = (lastPrice) * -1 end if
' SI LA DERNIERE VERSION ETAIT UN WIN ET QUE LA PRECEDENTE EST UN LOST, ALORS C'EST UNE NOUVELLE VENTE (PGR, 22 octobre 2004) elseif lastmktstatus="LOST" and CurrentMktStatus="WIN" then type_sale="Sale" amount_sale=currentprice ' 22-11-2004 By SA -------------------------------------------------------- ' elseif lastMktStatus = "T2" AND currentMktStatus = "T2" then ' if clng(lastprice) > clng(currentPrice) then ' type_sale = "" ' amount_sale = 0 ' else ' type_sale = "" ' amount_sale = 0 ' end if ' ' fin 22-11-2004 By SA --------------------------------
' SI LA DERNIERE VERSION ETAIT UN Tx ET QUE LA PRESENTE EST UN CON OU WIN, ALORS C'EST UNE VENTE elseif (left(lastMktStatus,1) = "T" or lastMktStatus="CAN") AND (currentMktStatus = "CON" OR currentMktStatus="WIN") then type_sale = "Sale" amount_sale = currentPrice
' SI LA DERNIERE VERSION ETAIT UN WIN ET QUE LA PRECENTE L'EST AUSSI ALORS C'EST SOIT UN INCREASE SOIT UN DECREASE elseif lastMktStatus="WIN" and currentMktStatus="WIN" then if lastcurrency <> currentCurrency then if lastCurrency = "USD" and currentCurrency="CDN" then curHandle = dbOpensql("SELECT BUDGET_RATE FROM CURRENCY_RATES WHERE YEAR_RATE=" & "20" & right(GetPropertyOf("DateEdit", "text"),2) ,true) if dbeof(curHandle) = true then msgbox "Unknown exchange rate for this period." cRate = 1 else cRate = dbgetvalue(curHandle,"BUDGET_RATE") end if dbclose(curHandle) if (lastprice * cRate) > currentPrice then type_sale = "Decrease" amount_sale = currentPrice - (lastprice * cRate) else type_sale = "Increase" amount_sale = currentPrice - (lastprice * cRate) end if elseif lastCurrency="CDN" and currentCurrency="USD" then curHandle = dbOpensql("SELECT BUDGET_RATE FROM CURRENCY_RATES WHERE YEAR_RATE=" & Year(Date) ,true) if dbeof(curHandle) = true then msgbox "Unknown exchange rate for this period." cRate = 1 else cRate = dbgetvalue(curHandle,"BUDGET_RATE") end if dbclose(curHandle) if (lastprice) > (currentPrice * cRate) then type_sale = "Decrease" amount_sale = currentPrice - (lastprice / cRate) else type_sale = "Increase" amount_sale = currentPrice - (lastprice / cRate) end if end if else if clng(lastprice) > clng(currentPrice) then type_sale = "Decrease" amount_sale = currentPrice - lastprice else type_sale = "Increase" amount_sale = currentPrice - lastprice end if end if ' SI LA DERNIERE VERSION ETAIT UN WIN QUE LA PRECENTE EST CAN ALORS C'EST UNE ANNULATION elseif lastMktStatus="WIN" and currentMktStatus="CAN" then type_sale = "Cancelled" if currentPrice >0 then amount_sale = (lastPrice) - ((currentPrice)) else amount_sale = (lastPrice) * -1 end if
' SI LA DERNIERE VERSION ETAIT CAN ET QUE LA PRECENTE EST CAN ALORS LA VALEUR DE L'ANNULATION EST LA DIFFERENCE ENTRE LES DEUX elseif lastMktStatus="CAN" and currentMktStatus="CAN" then type_sale = "Cancelled" amount_sale = currentprice - lastprice
' SI LA DERNIERE VERSION ETAIT CON ET QUE LA PRECENTE EST WIN ALORS C'EST SOIT UN INCREASE OU UN DECREASE elseif lastMktStatus="CON" and currentMktStatus="WIN" then if lastcurrency <> currentCurrency then if lastCurrency = "USD" and currentCurrency="CDN" then curHandle = dbOpensql("SELECT BUDGET_RATE FROM CURRENCY_RATES WHERE YEAR_RATE=" & "20" & right(GetPropertyOf("DateEdit", "text"),2) ,true) if dbeof(curHandle) = true then msgbox "Unknown exchange rate for this period." cRate = 1 else cRate = dbgetvalue(curHandle,"BUDGET_RATE") end if dbclose(curHandle) if (lastprice * cRate) > currentPrice then type_sale = "Decrease" amount_sale = currentPrice - (lastprice * cRate) else type_sale = "Increase" amount_sale = currentPrice - (lastprice * cRate) end if elseif lastCurrency="CDN" and currentCurrency="USD" then curHandle = dbOpensql("SELECT BUDGET_RATE FROM CURRENCY_RATES WHERE YEAR_RATE=" & Year(Date) ,true) if dbeof(curHandle) = true then msgbox "Unknown exchange rate for this period." cRate = 1 else cRate = dbgetvalue(curHandle,"BUDGET_RATE") end if dbclose(curHandle) if (lastprice) > (currentPrice * cRate) then type_sale = "Decrease" amount_sale = currentPrice - (lastprice / cRate) else type_sale = "Increase" amount_sale = currentPrice - (lastprice / cRate) end if end if else if lastprice > currentPrice then type_sale = "Decrease" amount_sale = currentPrice - lastprice else type_sale = "Increase" amount_sale = currentPrice - lastprice end if end if ' SI LA DERNIERE ETAIT WIN OU UN CON ET QUE LA PRESENTE EST UN Tx ALORS C'EST ANNULÉ elseif lastMktStatus="WIN" and (left(currentMktStatus,1)="T" or currentMktStatus="SHO") then type_sale = "Cancelled" amount_sale = (lastprice) * -1 End if isChange = 1 SetPropertyOf "AmountSale","Text",amount_sale SetPropertyOf "TypeSale","Text",type_sale SetPropertyOf "txtMonthDate","Text", mid((GetPropertyOf("DateEdit", "text")),4,2) SetPropertyOf "txtYearDate","Text","20" + right((GetPropertyOf("DateEdit", "text")),2) if currentuserid="ADMIN" then msgbox GetPropertyOf("txtMonthDate","Text") msgbox GetPropertyOf("txtYearDate","Text") end if 'msgbox "Calculated sale..." End if
else msgbox "Error in statuses. Contact your system administrator. " + cstr(NEWactual)+" "+NEWstatus+" "+projectid+" "+cstr(version) exit sub end if DBClose hnd end if 'hnd
'savons les nouvelles valeurs... GlobalInfoFor "ProjectID",ProjectID GlobalInfoFor "ProjVerNum",versionID
if EditModeB = "Edit" then
' msgbox "step .3..." & grdmode handle = dbOpenSQL("SELECT MAX(PROJECT_VERSION) AS MAXVER FROM CTBR_PROJECTS_VERSIONS WHERE CTBR_PROJECTSID='"& prjKey & "'",false) newVerNum = dbgetvalue(handle,"MAXVER") + 1 dbclose handle newVerKey = DBCreateIDFor("CTBR_PROJECTS_VERSIONS") ' SET NEW ID handle = dbOpenSQL("SELECT * FROM CTBR_PROJECTS_VERSIONS WHERE CTBR_PROJECTS_VERSIONSID='" & newVerKey & "'",false) zzz= getpropertyof("PickList5","Text")
' msgbox newVerKey
if newVerKey = "" then end if
if val(getPropertyof("StudyRevisionProbability","text"))<0 or val(getPropertyof("StudyRevisionProbability","text"))>100 then msgbox "Invalid probability. Please enter a value between 0 and 100. Value remain unchanged." end if
type_bp = "" type_bp = getPropertyOf("bpType","text")
dbInsert handle dbsetvalue handle,"CTBR_PROJECTS_VERSIONSID", newVerKey dbsetvalue handle,"PRICING_PROBABILITY",getPropertyof("StudyRevisionProbability","text") dbsetvalue handle, "CREATEUSER", currentuserid dbsetvalue handle, "MODIFYUSER", currentuserid dbsetvalue handle, "MODIFYDATE", date dbsetvalue handle, "CREATEDATE", date
dbsetvalue handle,"CTBR_PROJECTSID", prjKey dbsetvalue handle,"PRICING_ACTUAL",GetPropertyOf("ActPr","Text") dbsetvalue handle, "PRICING_QTY",getPropertyof("qty","text") dbsetvalue handle,"PROJECT_VERSION", newVerNum dbsetvalue handle,"PRICING_UNIT",getPropertyof("EditBox1","text") dbsetvalue handle, "PRICING_TYPE",getPropertyof("PickList3","text") dbsetvalue handle,"DATE_ESTIMATED_CLOSE",getPropertyof("DateEdit5","text") dbsetvalue handle,"DATE_ACTUAL_CLOSE",getPropertyof("DateEdit6","text") dbsetvalue handle, "DATE_PROTOCOL",getPropertyof("DateEdit7","text") dbsetvalue handle,"STATUS_REASON",getPropertyof("PickList1","text") dbsetvalue handle,"STATUS_CANCEL_REASON",getPropertyof("PickList2","text") dbsetvalue handle,"STATUS_COMMENTS",getPropertyof("StudyRevisionComments","text") dbsetvalue handle, "STATUS_MARKETING", getPropertyOf("PickList","text") dbsetvalue handle,"PRICING_CURRENCY",zzz
dbsetvalue handle,"VERSION_DATE",Date dbsetvalue handle,"PRICING_COST", getPropertyOf("Cost","text") dbsetvalue handle,"PRICING_SUGGESTED", getPropertyOf("SuggPr","text") dbsetvalue handle,"PRICING_CANCEL_CHARGES", getPropertyOf("StudyRevisionCancelCharges","text") dbsetvalue handle,"PRICING_SAVINGS", getPropertyOf("StudyRevisionSavings","text") dbsetvalue handle,"PRICING_MARKUP_SUGGESTED", getPropertyOf("SuggMarkup","text") dbsetvalue handle,"PRICING_MARKUP_ACTUAL", getPropertyOf("ActMarkup","text") dbsetvalue handle,"TYPE_SALE", getPropertyOf("TypeSale","text") dbsetvalue handle,"DATE_INQUIRY", getPropertyOf("DateEdit1","text") dbsetvalue handle,"DATE_DELAYED", getPropertyOf("DateEdit3","text") dbsetvalue handle,"DATE_PROJECT_BEGINS", getPropertyOf("DateEdit4","text")
dbsetvalue handle,"AMOUNT_SALE",amount_sale dbsetvalue handle,"TYPE_SALE", type_sale dbsetvalue handle,"MONTH_DATE",mid(CSTR(DATE),4,2) dbsetvalue handle, "YEAR_DATE", "20" & RIGHT(CSTR(DATE),2) dbsetvalue handle,"BASIC_PRICE", type_bp dbPost handle
' associer cette nouvelle version avec la quote et enlever l'autre d'avant... dbExecuteSQL "UPDATE CTBR_QUOTE_PROJECTS SET CTBR_PROJECTS_VERSIONSID='" & newVerKey & "' WHERE CTBR_QUOTE_PROJECTSID='" & QuoteID & "'" end if end if
if EditModeB<>"Edit" then RefreshMainView CloseCurrentView FALSE else RefreshMainView closecurrentview TRUE end if
end sub
|
|
|
|
Re: CloseCurrentView issues ??
Posted: 24 Jan 08 9:42 AM
|
That is a lot of code for us to look at to try to help you
What exactly is the error? I don't see it listed. What line is the error occuring on?
-Ryan |
|
|
|
Re: CloseCurrentView issues ??
Posted: 24 Jan 08 1:07 PM
|
Hi, My error is : general: Error on line 345 and Basic had an error : context : pane23 @0 : Basic Opportunity:CTBR reportingValues status : 0x159
ps: line 345 has closecurrentview False
Thank you for your help
Atmane
|
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|