So, how do I refer to a field in a subform?? :-k
This is on the Sales Order Form
I need something like the following:
IF SalesOrderSubform."Vendor No." = 'Labor"
Then.... rec."Tax Code" = 'VA-COST-TAXABLE'; (change value of Tax Code field in Sales Header).
Thanks
0
Comments
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
phew - I wasn't the only one having a heart attack =D>
Henrik Helgesen,
President | Helgesen Consulting
about.me | LinkedIN
You are referring to "rec"? Yes that is a good point.
You're better off adding a field to the vendor table that you can check off(boolean) like Labor Vendor.
Then by having Salesline."Vendor No." you're able to get the rest of the vendor info. Makes if more flexible and easier to add additional vendors if needed in the future or change them.
if vendor.get(Salesline."Vendor No.") then begin
if vendor."Labor vendor" then
...
...
..
end;
same thing with the tax code - you can add a default labor tax setup field (or whatever your working on) in salessetup. that you can pull into your code salessetup.get; that allows you the same flexability.
So many times over the years I've heard in our office alone "we need this change, it's just for this customer or/vendor or/Item. No other will be like this..ever!" then in a month Oh there's another one we need to treat like ABC. I say good - now go check the box I made the first time "
http://www.BiloBeauty.com
http://www.autismspeaks.org
I'm not certain I understand....
I will tell you what the request is:
If the word Labor is detected in the Sales Lines area of the sales order Form/Page, we need to change the Tax code to something like VA-INSTALL. These tax codes will be copies of the normal tax codes. For all orders that have INSTALL in the Tax code, we will show zero Sales Taxes on the Customer Invoice. Then we calculate tax based on the COST instead of the retail price.
This is only for projects where they hire a subcontractorto install their product (do the labor).
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
What if the tax VA-INSTALL has to be changed? (or renamed, or ...)
Those "constants" should immediatly be recognized as parameters.
So instead of checking if the vendor no. is a specific vendor (labor: subcontractor), you ought to get the vendor and check if the subcontractor/laborer boolean is true.
If you don't want to depend on the vendor no. you could check for each salesline if the description contains labor.
something like:
if strpos(salesline.description,salesetup.magicword (which contains "labor")) > 0 then
|To-Increase|