Question

This report is working fine but is generating report if vendor is unpaid also. i want to have a criteria here. If[CustomerPaid+VendorPaid==TotalAmount] End If; Report should generate if this condition pass only. how to go with it? Please help me out

    New Window[Name: "Report"; height: 700; width: 900; Left; Style: Document]
Enter Find Mode[]
Go to Layout["Economic Report(Finance)"]
Set Field[Finance::PaidDate; Finance: ReportDateFrom & "..." & Finance::ReportDateTo]
Set Field[Finance::Customer Status;
    "Paid by"]
Set Field[Finance::Vendor Status;
    "Paid by"]
//New Record/Request
//Set Field[Finance::Customer Status;"Unpaid"]
// Omit Record`enter code here`
//New Record/Request
//Set Field[Finance::Customer Status;"Only_Deposit_Received"]
//Omit Record
Perform Find[]
Sort Records[Restore; No dialog]
Pause / Resume Script[Indefinitely]
Print[]
Close Window[Current Window]
Was it helpful?

Solution

You cannot enter a formula as a search criterion. Either define a OutstandingBalance field =

TotalAmount - CustomerPaid - VendorPaid

and search for 0 in this field, or find records that meet the other criteria (date range, status...) and loop among them, omitting records where:

CustomerPaid + VendorPaid ≠ TotalAmount

--
Another option is to use ExecuteSQL() to "perform the find" - but then you'd have to format the text results for printing, instead of using a report layout.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top