Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3282082
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:53:16+00:00 2026-05-17T19:53:16+00:00

I want to update a custom user field in QC using the Label of

  • 0

I want to update a custom user field in QC using the Label of field instead of the name

At the moment we are doing it this way

Set currentRun = QCUtil.CurrentRun
currentRun.Field("RN_USER_03") = 1
currentRun.Post

But I would like to do it this way

Set currentRun = QCUtil.CurrentRun
currentRun.Field("Data Rows Passed") = 4
currentRun.Post

But I can’t find the method to do it with.
Any Ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:53:17+00:00Added an answer on May 17, 2026 at 7:53 pm

    Implying all labels are unique (which I doubt..):

    You could create a function which accepts a label, searches in QC’s tables that define customized fields for the correct field definition, and returns the field name. Then use the function’s result value as the indexed property’s index.

    Suppose that function would be called “GetNameOfLabel”, then the Caller’s code would look like:

    Set currentRun = QCUtil.CurrentRun 
    currentRun.Field(GetNameOfLabel ("Data Rows Passed")) = 1 
    currentRun.Post 
    

    Of course, the function would not really be trivial, but easy enough after some digging in the QC data model and finding an efficient way to fetch the name from the DB via SQL.

    Or, the function could look up the name in an array, or a dictionary, then you would have to maintain that dictionary, but you would not have to go to the database for each lookup.

    Disadventages:

    • Scripts with the wrong label might be harder to be debug
    • If labels are not unique, it might be real “fun” to debug

    If looking up on the DB:

    • All scripts slow down if you don’t cache, or pre-load, SQL query results for those lookups;
    • complexity, as you have to do the right SQL query, and you depend on QC’s data model in a quite peculiar way (usually a horror when you’re upgrading)

    If looking up in an array, or dictionary:

    • You either must maintain its initialization (bet other admin guys adding a cust field will forget that easily), or must “load” it from QC’s table (which is a bit like the SQL solution above, and has the same downsides).

    I’d go with the array/dictionary-initialized-from-db-idea. Or, if you can live with the constant idea already presented, that one is a good bet. Considering that there is no session-independent scope in QCs customizing scripts, the SQL access idea might really kill performance because it would have to be executed for every new user session. Which is why I, too, +1’d the constant idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Silverlight application with custom animations. I want to update the
i want to update my sqlite database but i cannot find the way to
I'm trying to put together a custom user update page so you can update
I want to add some custom fields to add new user in Wordpress .
I wrote custom servlet in Liferay and want to know which user page calls
I am using a CreateUserWizard together with a custom MembershipProvider to add a user
I have a Windows form which hosts a custom User Control. This User Control
My app ships with a .plist that looks like this: I want the user
I have a custom control with a field where the user will enter a
What I want: Update all new commits from server with my local repository in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.