0

Help with a new connect view with dashboard button....

l recently added a connect view with dashboard to show all invoices in a date range. I was wondering if someone could help add to this formula so that l can add another button with the same formula that would show all outstanding invoices within a date range

this is my current formula to show all invoices in a date range. 

let myFrom := From;
let myTo := To;
let me := this;
Invoices.(Dashboard := 0);
let myChoice := (select Invoices where 'Date of Invoice' >= myFrom and 'Date of Invoice' <= myTo);
let txt := "";
for i in myChoice do
txt := txt + "> " + i + " " + i.Dashboard;
i.(Dashboard := me);
txt := txt + " => " + i.Dashboard + "
"
end;
'Show connected invoices' := 1

regards

Michael

5 replies

null
    • John_Halls
    • 3 yrs ago
    • Reported - view

    Hi Michael

     

    What is the field name in invoices for the outstanding amount. Is this a number or a yes/no style flag?

     

    Regards John

    • John_Halls
    • 3 yrs ago
    • Reported - view

    Hi Michael

     

    You took this from the example 112_Print view element in dashboard. This example allows the dashboard to be printed (as views can't but relationships can). Do you need yours to be printed? If not we can simplify the code (it can be simplified anyway).

     

    Regards John

    • Central Park Furnishings
    • Michael_McKenna
    • 3 yrs ago
    • Reported - view

    Hi John, sorry for late reply. Yes l do want to be able to print the 'view', the name of the field is called Amt_Outstanding and is a formula field numeric. 
    l would ideally like to set up a button that would only show all customers with the 'Amt_Outstanding' rather than showing all invoices. 
    My thought is to have a button to show all invoices in a date range and a button to show only the invoices with an outstanding amount. Both reports in a view and to be printed. 
    l currently have the all invoices button which is brilliant , now looking to add the other. 
    hope this makes sense 

    kind regards 

    Michael 

    • John_Halls
    • 3 yrs ago
    • Reported - view

    Hi Michael

     

    Your code above can be simplified to

     

    let myFrom := From;
    let myTo := To;
    let me := this;
    Invoices.(Dashboard := 0);
    for i in (select Invoice)['Invoice Date' >= myFrom and 'Invoice Date' <= myTo] do
    i.(Dashboard := me)
    end

     

    The txt variable is metadata and not needed.

     

    To update this to include the outstanding invoices only change the code to

     

    let myFrom := From;
    let myTo := To;
    let me := this;
    Invoices.(Dashboard := 0);
    for i in (select Invoice)['Invoice Date' >= myFrom and 'Invoice Date' <= myTo and Amt_Outstanding > 0] do
    i.(Dashboard := me)
    end

     

    Regards John

    • Central Park Furnishings
    • Michael_McKenna
    • 3 yrs ago
    • Reported - view

    Thanks John, works brilliantly, really appreciate your time. 
    regards

    Michael 

Content aside

  • 3 yrs agoLast active
  • 5Replies
  • 308Views