0

return Vat % by using select

Okay- So I have the following:

VatValue (Table name)

VatRate (text Field)

Vat% (number field)

 

QuoteLines (Table name)

QVatRate (choice field)

QVat% (number Feld)

QVatValue

 

In the QuoteLines Table - Rather than set a fixed relationship to the VatValue table- I would rather use select in some way

I would prefer to use a choice field in Quotelines to set the VAT Rate (T1, T0 etc) then when T1 is chosen - lookup to the VatValues Table to find the match and select the % from Vat% and return this to QuoteLines QVat%

I guess I put the script in Quotelines QVatRate(field) – trigger on update and test for ‘T1’ etc.

Along the lines of

Is QVatRate = “T1” then do a lookup to VatValue (VatRate%) to find a match then select VatValues(vat% and store it in QuoteLines QVat%

 

Also I guess I may have to change the VatRate field in (VatValue Table) to a number as the the choice field may store T1 as simply the first index ie 1
also I want to store (save) the value in QuoteLines (Qvat%) rather than use a formula field and simply calc it virtually. As I don’t want to fall foul the vat rate changing and it altering all historical quotes (foe the same reason I don’t want to hard code it in the script ie if x = T1 the price is * 20.00%

I’ve have several stabs at this but can’t get the script right for it to work?

Not used select much so a bit confused - if anyone can give me some guidance that would be a great help

2 replies

null

Content aside

  • 4 yrs agoLast active
  • 2Replies
  • 487Views