Jump to content

FMserver.local Schedule "Invoice" completed; last scripting error(100)


This topic is 2817 days old. Please don't post here. Open a new topic instead.

Recommended Posts

My script runs but with error 100 and no invoice or any record is created, any body be able to explain this please - Thank you. 

#Script used to find Chamäleon, Aclass and Blue Planet tours running on current date #
Go to Layout [ “Console_Guided” (Console) ]
Set Field [ Console::gn_Console_Trigger_chk; 1 ]
Enter Find Mode [ ] #
#FIRST REQUEST
Set Field [ Console::TG_Start; Get ( CurrentDate ) ] Set Field [ Console::Operator_Type; "Chamäleon" ] Set Field [ Reservati::Final_chk; "Yes" ]
#
Duplicate Record/Request
#SECOND REQUEST
Set Field [ Console::Operator_Type; "Aclass" ] #
#THIRD REQUEST
Duplicate Record/Request
Set Field [ Console::Operator_Type; "Blue Planet" ] Set Error Capture [ On ]
Perform Find [ ]
If [ not Get(FoundCount) ]
Exit Script [ ] Else
Go to Record/Request/Page
[ First ] Loop
Copy [ Console::Tour_Nr ] [ Select ]
Perform Script [ “New Invoice Record” from file: “TransportRemittance” ] Go to Record/Request/Page
[ Next; Exit after last ] End Loop
Set Field [ Console::gn_Console_Trigger_chk; 0 ]
Perform Script [ “Transport Invoice - Mail Current” from file: “TransportRemittance” ] End If
Link to comment
Share on other sites

Error 100 = File is missing.  That seems to fit with the script step that performs the script in the other file "TransportRemittance"

How is the file reference to that file defined?

 

It may work from your machine but not from server.

If the file is hosted on the same server just use the "file:" prefix for the file reference

Link to comment
Share on other sites

No, the file in which the script runs is "Timetable Vehicle" and other subscripts ran in it script are contained in two other different files, "TransportRemittance" and "Remittance".....could that mean problem?

This how it is;

In "TimetableVehicles" there are current running tours and the vehicles they will use,In "TransportRemittance" is transport invoices to be created and mailed out, lastly in "Remittance" a record should be created with the invoice information for accounts department.

This whole exercise is a script named Tours4Today running from "TimetableVehicles" within it is the scripts for creating(within this script is subscript for creating invoice info record in Remittance) and mailing the invoice.

Link to comment
Share on other sites

No, the file in which the script runs is "Timetable Vehicle" and other subscripts ran in it script are contained in two other different files, "TransportRemittance" and "Remittance".....could that mean problem?

 

 

Did you mean "are contained in two different folders..."?

 

What the script does is not relevant here.  I suspect that on the server, the files referenced are not in the same folder.  Which is ok for FMP client because the "File:" reference is translated to:

- look for files hosted on the same server

But for a schedule running on FMS the "File:" reference means:

- look for files in the same folder

 

If the files are not in the same folder then you need to have a second file reference to the file that you are calling the script in, one that uses a relative path.  That way the script will work from both the client and in a server-side schedule.

Link to comment
Share on other sites

Hi Wim,

Yes, all files are in the same folder, it is three files BTW(Timetable Vehicle, Transport Remittance and Remittance). The account initiating the script however had different passwords to each file and this thought to be the problem cause - now that is fixed but the script is not running correctly, instead of finding vehicles on tour for the current day, it will invoice all records in Timetable Vehicle(1562) and create a record for each invoice in Remittance for accounts........I have the following scripts for finding vehicles on tour, Creating Invoice Record and Creating Remittance record for accounts - everything runs well on the debugger but i don't understand server schedule madness to invoice for all existing records in Timetable Vehicle - please guide me through.......many thanx!

Tours4Today
#Script used to find Chamäleon, Aclass and Blue Planet tours running on current date #
Go to Layout [ “Console_Guided” (Console) ]
Set Field [ Console::gn_Console_Trigger_chk; 1 ]
Enter Find Mode [ ] #
#FIRST REQUEST
Set Field [ Console::TG_Start; Get(CurrentDate) ] Set Field [ Console::Operator_Type; "Chamäleon" ] Set Field [ Reservati::Final_chk; "Yes" ]
#
Duplicate Record/Request
#SECOND REQUEST
Set Field [ Console::Operator_Type; "Aclass" ] #
#THIRD REQUEST
Duplicate Record/Request
Set Field [ Console::Operator_Type; "Blue Planet" ] Set Error Capture [ On ]
Perform Find [ ]
If [ not Get(FoundCount) ]
Exit Script [ ] Else
Go to Record/Request/Page
[ First ] Loop
Copy [ Console::Tour_Nr ] [ Select ]
#
#Perform script to create new invoice record in Transport Invoice NEW TC Layout
Perform Script [ “New Invoice Record” from file: “TransportRemittance” ]
Go to Layout [ “Console_Guided” (Console) ]
Go to Record/Request/Page
[ Next; Exit after last ] End Loop
6 March 2015 9:53:39
TimetableVehicle.fmp12 - Tours4Today -1-
Tours4Today
#
#Perform script to create pdf invoice file for mailing to accounts
Perform Script [ “Transport Invoice - Mail Current” from file: “TransportRemittance” ]
End If
#Script by MSA
PS Transport Invoice: New Invoice Record
#Script used to create new Transport Invoice Record for the Chamäleon, blue Planet or AClass tours
Go to Layout [ “Invoice_Transport_New_TC” (Invoice_Transport) ] New Record/Request
#Paste tour number from console and set ledger account
Paste [ Invoice_Transport::Tour_Number ]
[ Select ]
Set Field [ Invoice_Transport::Ledger_Accounts; "2010 Income" ]
// Set Field [ Invoice_Transport::Date_Tour_begin; $$TG_Start ]
// Set Field [ Invoice_Transport::Date_Tour_end; $$TG_End ]
Commit Records/Requests
[ Skip data entry validation; No dialog ]
#Perform Script to copy Transport Invoice details to Remittance Perform Script [ “Copy Fields InvoiceToRemittance” ] Exit Script [ ]
#Script by MSA
PS Transport Invoice: Copy Fields InvoiceToRemittance
#
#Script used to update Pack Safari Remittance with Transport invoice details
#Copy field data from Invoice transport layout and paste to Remittance
Copy [ Invoice_Transport::__ID_INVOICE_PT_NUMBER ] [ Select ]
Perform Script [ “Safari Remittance - Paste Invoice Nr_TC” from file: “Remittance 2” ] Copy [ Invoice_Transport::Date_Invoice_PT ]
[ Select ]
Perform Script [ “Safari Remitance - Paste Date Invoice_TC” from file: “Remittance 2” ]
Copy [ Invoice_Transport::Tour_Number ] [ Select ]
Perform Script [ “Safari Remitance - Paste Tour Nr_TC” from file: “Remittance 2” ] Copy [ Invoice_Transport::Kürzel ]
[ Select ]
Perform Script [ “Safari Remittance - Paste Kürzel_TC” from file: “Remittance 2” ]
Copy [ Invoice_Transport::lcd_TG_Start_TC ] [ Select ]
Perform Script [ “Safari Remittance - Paste TG_Start_TC” from file: “Remittance 2” ] Copy [ Invoice_Transport::lcn_Amo_Debit_VAT_Output_Sum_TC ]
[ Select ]
Perform Script [ “Safari Remittance - Paste Input Vat” from file: “Remittance 2” ]
Copy [ Invoice_Transport::lcn_Amo_Debit_Unit_Grand_TC ] [ Select ]
Perform Script [ “Safari Remittance - Paste Amount Incl VAT” from file: “Remittance 2” ] Exit Script [ ]
#Script By MSA
Link to comment
Share on other sites

No errors "FileMaker Server 13.0v5 on FMserver.local reported the following event:

2015-03-06 03:00:50.616 +0200 Information 150 FMserver.local Schedule "Transport Invoice" completed."

 

The going on problem is that the script is working up on all records rather than the found set, that is it will still create invoices and post records of invoice to remittance even when there are no vehicles on tour at current date -  

Link to comment
Share on other sites

Two more thoughts:

 

1) you should really stop using copy and paste.  Pass parameters to the scripts that need them or at the very least use global variables or global fields for the same purpose

 

2) this particular check does not make sense: If [ not Get(FoundCount) ]

Use explicit code to say what you really mean.  IF [ Get(foundCount) > 0 ]   Then the check would probably mean more sense.  I know other folks here will rip me for this but their brains are wired differently than mine.  Get(foundcount) returns a number from 0 to whatever.  By throwing a boolean operator "not" at a number you are very implicitly trusting FM to correctly translate what you mean.  Don't do that.  Be explicit and make the test exactly what you mean.

 

Given that you seem to experience that your find fails and produces the full record set as the found count you probably should do a plausibility check:

 

IF[ Get(foundcount) > 0 and Get(foundcount) <> Get(TotalRecordCount) ]

Link to comment
Share on other sites

This topic is 2817 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.