If you create a new document, the field serviceline is empty. In this situation the lookup will always generate an error. You should wrap the lookup in an if clause like so:
To make sure, that this code is reevaluated after the user choose a service line, make sure, that the option “Refresh fields on keyword change” is set.
The error “view index not built” looks a little strange. Make sure that the view is set to refresh it’s index automatically and that Discard is not set to “After each use”.
If the first column of ServiceLine is categorized, the values retrieved by @DbColumn are unique already, so there’s no need for an additional @Unique (although this will have no influence on your problem).
Since both formulas access the same view, I would not use a cached @DbColumn and then an uncached @DbLookup. You should use @DbColumn with the ReCache option instead and make a cached @DbLookup.
I think its just a spelling mistake!You say your field is named servicelines whereas in the @dblookup formula you are using serviceline (missing s) as the lookup key!
Is ReceivingSites also a field?If yes then is this the first field i.e the one which for you are using @dblookup?
If I understand correctly you have a field serviceline for which you have used @Dbcolumn. You have another field for which you want to use @DbLookup based on the value of serviceline field - correct?
Have you also checked whether the first column of the ServiceLines view is sorted? @DbColumn works on the first sorted column only.