Skip to main content
Solved

Error: 'Cannot find either column "dbo" or the user-defined function or aggregate "dbo.tsf_user", or the name is ambiguous.'.

  • June 29, 2026
  • 3 replies
  • 34 views

Forum|alt.badge.img+4

Hi,

Since a couple of days I get the follow error message when generating a branch: 

Error: 'Cannot find either column "dbo" or the user-defined function or aggregate "dbo.tsf_user", or the name is ambiguous.'.

When compiling the function through the Functionality menu option, there are no problems, only when generating the branch. It would seem that the order of execution when generating functions has something to do with it, but the 2 functions used in this function, dbo.current_actor_id() and dbo.get_topic_access_level() both have a lower execution order number. So they should already exist before this function is generated. The function where the problem occurs is a new function, recently added.

Any ideas where I can look to see what the cause of the problem could be?

 

An unknown error occurred while executing '
/* Create or alter function can_assign_objective_topic_to_case. */

create or alter function "can_assign_objective_topic_to_case"
(
   @process_id     "identifier"   ,
   @objective_id   "identifier"   ,
   @topic_id       "identifier"   
)
returns "no_yes"
as
begin

    --control_proc_id:      func_can_assign_objective_topic_to_case
    --template_id:          func_can_assign_objective_topic_to_case
    --prog_object_item_id:  func_can_assign_objective_topic_to_case
    --template_description: 
    
    /*
        Input
            @process_id     "identifier"   ,
            @objective_id   "identifier"   ,
            @topic_id       "identifier"   
    
        returns "no_yes"
    */
    
    DECLARE 
        @v_actor_id             identifier = dbo.current_actor_id();
    
    IF dbo.get_topic_access_level(@objective_id, @topic_id) = 0
    BEGIN
        -- No access to the topic
        RETURN 0;
    END
    
    IF EXISTS(SELECT 'x' 
                FROM active_process_view
               WHERE process_id = @process_id 
                 AND (archive_date IS NOT NULL
                  OR current_state_completed = 1
                  OR is_current_state = 0
                  OR actor_id <> @v_actor_id)
                  )
    BEGIN              
        -- is not the actor of the current case state              
        RETURN 0;
    END
    
    IF NOT EXISTS(SELECT 'x'
                    FROM process_state_property psp
                    JOIN process_state pse ON pse.process_id = psp.process_id
                                          AND pse.process_state_id = psp.process_state_id
                                          AND pse.is_current_state = 1
                   WHERE psp.process_id = @process_id 
                     AND psp.property_type = 17 
                     AND psp.is_enabled = 1)
    BEGIN                 
        -- case has no editable TOPIC property in the current state
        RETURN 0;
    END
    
    RETURN 1;
    
    -- EOF
    
end
'. 

Error: 'Cannot find either column "dbo" or the user-defined function or aggregate "dbo.tsf_user", or the name is ambiguous.'.

 

Best answer by Robert Wijn 2

Sometimes a good night sleep gives one new insights. It seems the cause of the issue is the use of a view in the function. When generating a branch views do not yet exist when generating functions. In this case the active_process_view was not created yet.

The error message unfortunately was a bit misleading and put me on the wrong track, but after replacing the view with a regular table based query, generating the branch succeeded without any further problems.

 

3 replies

If you run this part on SSMS you will probably get the same error. 

 

    DECLARE 

        @v_actor_id             identifier = dbo.current_actor_id();


is current_actor a table or scalar function? 


Forum|alt.badge.img+4
  • Author
  • Vanguard
  • Answer
  • June 30, 2026

Sometimes a good night sleep gives one new insights. It seems the cause of the issue is the use of a view in the function. When generating a branch views do not yet exist when generating functions. In this case the active_process_view was not created yet.

The error message unfortunately was a bit misleading and put me on the wrong track, but after replacing the view with a regular table based query, generating the branch succeeded without any further problems.

 


Forum|alt.badge.img+4

@Erwin. The dbo.current_actror_id() is a scalar function and a wrapper that uses dbo.tsf_user() but does a lookup in an actor table to reply the id of the actor related to the logged on user.