AnsweredAssumed Answered

If issue

Question asked by willrollo on Sep 9, 2014
Latest reply on Sep 9, 2014 by philmodjunk

Title

If issue

Post

I have part of a script that is designed to enter a figure into a tax field depending what data is entered in another field. 

The target fields are called  INVOICE DETAILS::VAT Rate (result to be 0 or invoicedetails_PREF::Tax Rate) and INVOICE DETAILS::VAT Code and the result is either EU export, "Non-EU Export" or Standard. I want this to change by the script depending on the data in the  INVOICE DETAILS::Billing_Country field. 

Every thing else to 

 

I did try a series of Ifs in my script but it didn't work reliably...

 

         
  • If [ INVOICE DETAILS::Billing_Country = "" or INVOICE DETAILS::Billing_Country = "United Kingdom" or INVOICE DETAILS::Billing_Country = "Northern Ireland" or INVOICE DETAILS::Billing_Country = "Wales" or INVOICE DETAILS::Billing_Country = "Scotland" or INVOICE DETAILS::Billing_Country = "Cornwall" ]
  •      
  • Set Field [ INVOICE DETAILS::VAT Rate; invoicedetails_PREF::Tax Rate ]

 

         
  • Else If [ INVOICE DETAILS::Billing_Country = "France" or INVOICE DETAILS::Billing_Country = "Austria" or INVOICE DETAILS::Billing_Country = "Belgium" or INVOICE DETAILS::Billing_Country = "Germany" or INVOICE DETAILS::Billing_Country = "Greece" or INVOICE DETAILS::Billing_Country = "Ireland" or INVOICE DETAILS::Billing_Country = "Italy" or INVOICE DETAILS::Billing_Country = "Luxembourg" or INVOICE DETAILS::Billing_Country = "Spain" or INVOICE DETAILS::Billing_Country = "Netherlands" or INVOICE DETAILS::Billing_Country = "Bulgaria" or INVOICE DETAILS::Billing_Country = "Cyprus" or INVOICE DETAILS::Billing_Country = "Czech Republic" or INVOICE DETAILS::Billing_Country = "Denmark" or INVOICE DETAILS::Billing_Country = "Estonia" or INVOICE DETAILS::Billing_Country = "Finland" or INVOICE DETAILS::Billing_Country= "Hungary" or INVOICE DETAILS::Billing_Country = "Malta" or INVOICE DETAILS::Billing_Country = "Portugal" or INVOICE DETAILS::Billing_Country = "Sweden" or INVOICE DETAILS::Billing_Country = "Portugal" ]
  •      
  • Set Field [ INVOICE DETAILS::VAT Code; "EU Export" ]
  •      
  • Set Field [ INVOICE DETAILS::VAT Rate; 0 ]
  •      
  • Else
  •      
  • Set Field [ INVOICE DETAILS::VAT Code; "Non-EU Export" ]
  •      
  • Set Field [ INVOICE DETAILS::VAT Rate; 0 ]
  •      
  • End If

Any suggestions?

Thank you

 

 

Outcomes