Last requirement (changed respect previous one) is to have, on Customer Card, the date o last Posted Invoices and number of days between this date and actual day.
Do you have some suggestion to calculate that?
Last requirement (changed respect previous one) is to have, on Customer Card, the date o last Posted Invoices and number of days between this date and actual day.
Do you have some suggestion to calculate that?
Thank you
And also let us know what did you try and what is not working..
I have to begin the development.
I think to create a new report that pass along Customer and Customer Ledger Entries.
Is that ok or can I find these info in other parts?
I don't understand when the field is exactly calculated.
I see that all records have this field populated also if not scrolled in the form...
When I make a new invoice for customer X, is this new field refreshed automatically.?
I ask you that because we should extract this data of Customer table via a query.
If you're going to use it in a report you need to use the command CALCFIELDS to get it's current value.
Just like any other flowfield. ie/ Balance field, etc.
Customer.CALCFIELDS("Last Invoice Date"); needs to be added to your report to populate the field with it's current value.
If you view the field in form or table - it will be correct & updated.
It finds the largest(newest) posting date of an "Invoice" type ledger entry. Therefore giving you the last invoice date for that customer.
Ok, this means that should be better make a report of NAV than to create a SQL Query to extract data.
But if I would also want to calculate the no. of days betweend that date and today, automatically updated for all customer?
I would like to see that updated correctly in Customer List form.
I don't know if it's a "Save to table" type of value since it constantly needs recalculating. For me the date would be enough. and the #ofdays seems like overkill. It something you can easily calc for reports but you also wanty it to show on a form.
I don;t like putting code on forms - but if it's just for a visual effect on the customer list then you have to calc it on the form.
Add a global var to the form "NoOfDays" type integer.
OnAfterGetRecord() of the form
CALCFIELDS("Last Invoice Date");
NoofDays := TODAY -"Last Invoice Date";
Drop an integer type field onto the list & change the sourceexp to "NoOfDays" or whatever name you give it.
Comments
Check how Date field is calculating..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
On screen I don't see date fields.
Thank you
Like "FindLast"?
http://msdn.microsoft.com/en-us/library/dd355375
http://www.BiloBeauty.com
http://www.autismspeaks.org
Regards,
Faisal Bukhari
Do you have some suggestion to calculate that?
Thank you
What does this day and actual date means????
_____________
Regards,
Faisal Bukhari
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I think to create a new report that pass along Customer and Customer Ledger Entries.
Is that ok or can I find these info in other parts?
Thank you
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Create A flowfield in the Customer Table
50050 -> Last Invoice Date -> Datatype=Date
FieldClass->Flowfield
CalcFormula->Max("Cust. Ledger Entry"."Posting Date" WHERE (Document Type=FILTER(Invoice),Customer No.=FIELD(No.)))
Add the new field to customer card.
Save->Compile->Enjoy!
http://www.BiloBeauty.com
http://www.autismspeaks.org
I don't understand when the field is exactly calculated.
I see that all records have this field populated also if not scrolled in the form...
When I make a new invoice for customer X, is this new field refreshed automatically.?
I ask you that because we should extract this data of Customer table via a query.
Just like any other flowfield. ie/ Balance field, etc.
Customer.CALCFIELDS("Last Invoice Date"); needs to be added to your report to populate the field with it's current value.
http://msdn.microsoft.com/en-us/library/dd338766.aspx
If you view the field in form or table - it will be correct & updated.
It finds the largest(newest) posting date of an "Invoice" type ledger entry. Therefore giving you the last invoice date for that customer.
http://www.BiloBeauty.com
http://www.autismspeaks.org
But if I would also want to calculate the no. of days betweend that date and today, automatically updated for all customer?
I would like to see that updated correctly in Customer List form.
http://www.BiloBeauty.com
http://www.autismspeaks.org
I don;t like putting code on forms - but if it's just for a visual effect on the customer list then you have to calc it on the form.
Add a global var to the form "NoOfDays" type integer.
OnAfterGetRecord() of the form
CALCFIELDS("Last Invoice Date");
NoofDays := TODAY -"Last Invoice Date";
Drop an integer type field onto the list & change the sourceexp to "NoOfDays" or whatever name you give it.
http://www.BiloBeauty.com
http://www.autismspeaks.org