taylorsharpe

Schedule Script killing FMSE on script that works in FMP

Discussion created by taylorsharpe on Jul 6, 2015
Latest reply on Aug 8, 2015 by taylorsharpe

I am working with a script where I am taking calculated and summed data and storing it in a related table.  It works perfectly fine when running in FMP 14 or 13.  But whenever run on FMS 13.0v9 (Mac OS X 10.10.3) as a Schedule Script, it crashes the FMSE and I have to manually restart it (fmsadmin start fmse).  I haven't tried it on FMS 14 yet.  Here is a shortened version of the script and this version kills the FMSE too:

 

Go to Layout [ “tblJOB Blank Table” (tblJOB) ]

Enter Find Mode []

Set Field [ tblJOB::JobSerial ; "==0003" ]

Perform Find []

 

Set Variable [ $FieldToSet ; Value: "tblJOB stored calcs::tbl_INVOICE_DATA|sEquipmentQuantCost" ]

Set Variable [ $Field ; Value: "tbl_INVOICE_DATA::sEquipmentQuantCost" ]

Set Variable [ $Value ; Value: "" ]   //  can put any value in here and it behaves the same way

Set Field By Name [ $FieldToSet ; Evaluate ( $Field ) ]

 

I am storing the results of a number of fields and only a few of them crash the FMSE, most do not.  But "tbl_INVOICE_DATA::sEquipmentQuantCost" does and it does every time.  Another field that crashes it is "tblJOB::cJobTotalExpensesQuant".  The FMSE crash happens at the evaluate function.  I was trying to figure out if there was some pattern like an illegal character in the field name.  But that didn't seem to be the case.  I've tried this script on different records and it consistently crashes FMSE on these fields every time no matter which record.  You can see that Evaluates from other fields in the same tables these two fields come from (tbl_INVOICE_DATA and tblJOB) work just fine.

 

The field "tbl_INVOICE_DATA::sEquipmentQuantCost" is a summary field that just totals up a calc field.  And "tblJOB::cJobTotalExpensesQuant" is a calculation field with the following calc:

 

tbl_INVOICE_DATA::sEquipmentQuantCost + tblPAYROLLPORTAL 3::sPayrollPortalEmployeeQuantCost + tblPAYROLLPORTAL 3::sPayrollPortalEmployeeQuantCostPD + tblPURCHASEORDERDATA2::sRebill_POAmount

 

So I don't see anything strange about the calc.

 

Here are some of the fields that work and don't crash the FMSE when run as a schedule script:

 

tbl_INVOICE_Data::sInvoiceSum

tblJOB::cJobActExp

tblJOB::cJobTotalExpenses

tblJOB::JobProjRev

tbl_INVOICE_DATA::cTotalEquipmentCost

tblJOB::JobProjectedCost

tblJOB::JobCostVariance

tblJOB::cJobActInc

tblJOB::cJobGrossMargin

tblJOB::cJobPayrollMin

tblJOB::cJobPayrollMax

tblJOB::cJobPayrollMaxMin

tblJOB::cJobPayrollMaxMinSQL

tblPAYROLLPORTAL 3::sPayrollPortalEmployeeCost

tblPAYROLLPORTAL 3::sPayrollPortalEmpHrsNet

tblJOB::cJobCodeOryx

tblJOB::JobNameOryx

lstJOBSTATUS::JobStatus_Description

tblJOB::JobStatusPercent

tblJOB::JobDateActualStart

tblJOB::JobDateActualFinish

tblJOB::JobProjExp

tblPAYROLLPORTAL 3::sPayrollPortalEmployeeCount

tblPAYROLLPORTAL 3::cPayrollPortalEmployeeQuantCostTotal

tblPURCHASEORDERDATA2::sPurchaseOrderShell_POAmount

tbl_INVOICE_DATA::cPayrollPortalEquipCost

tbl_INVOICE_DATA::sInvoicePaid

tblJOB::cJobGrossMarginPaid

tblJOB::JobTargetCost

tblJOB::JobTargetPercent

tblJOB::sInternalCompanyTotalExpenses

tblJOB::sInternalCompanyTotalIncOvr

tblEmp_Master::cEmp_NameFull

tblCLIENTDATA::ClientName

tblEmp_Master 3::cEmp_NameFull

tblJOB::JobProjectType

tblJOB::cJobRegion

lstINTERNALCOMPANIES 4::InternalCompanies_Name

tblPURCHASEORDERDATA2::PO_ReqstDate

tblPURCHASEORDERDATA2::PO_Num

tblPURCHASEORDERDATA2::PO_RebillYN

tblPURCHASEORDERDATA2::PO_InvRebillNum

tblPURCHASEORDERDATA2::PO_Rental

tblEmp_Master 12::cEmp_NameFull

tblPURCHASEORDERDATA2::zzcPurchaseOrderShell_VendorName

tblPURCHASEORDERDATA2::PO_Amount

tblPAYROLLPORTAL 6::cPayrollDate

tblPAYROLLEQUIPPORTAL2::Asset_Hours

tblPAYROLLEQUIPPORTAL2::Asset_ID

tblPAYROLLEQUIPPORTAL2::iSerialNumber

tblAsset_Rates 6::Type_Description

tblPAYROLLEQUIPPORTAL2::cEquipmentCostAct

tblAsset_Rates 6::Type_ID_2

tblPAYROLLPORTAL 6::iPayrollSerial

tblPAYROLLPORTAL 6::cPay_TicktNum

 

It is just frustrating that this always works just fine when running on any FMP client, just not on the server.  Is there some limitation of the Evaluate function on FMS?  This is a rather large file.

 

PS:  Yes, I run a lot of schedule scripts and know it runs the startup script for the file and that script exits at the top when run on the server.  And the startup script doesn't keep the fields in this script that do work from working if I just remove the problematic fields.

Outcomes