Desktop and UI Extensibility

Get Involved. Join the Conversation.

Topic

    Rajesh Ashok Kumar
    How to update custom field in BUIAnswered
    Topic posted June 18, 2019 by Rajesh Ashok KumarRed Ribbon: 250+ Points 
    72 Views, 5 Comments
    Title:
    How to update custom field in BUI
    Content:

    In incident object, we have a custom field Essence ( Objects >> Incident >> CustomFields  >> CustAttrib  >> Essence). This is of type RightNow\Connect\v1_3\CO\Essence.

    How do I update this using WorkspaceRecord.updateField() method

    Something is wrong in mapping field name. "Incident.C$Essence"

    Code Snippet:

    Best Comment

    Rajesh Ashok Kumar

    Hi Lakshay

    Thanks for all your help. Finally I got this working.

    Incident.CustAttrib$Essence worked. The package name was CustAttrib.

    workspaceRecord.updateField('Incident.CustAttrib$Essence', "3");

    Comment

     

    • Lakshay Bhalla

      Hi Rajesh,

      If this is a Custom Attribute then, You need to use "CO$Essence" instead of "C$Essence".

      See the Documentation article:

      Custom objects

      When created, custom objects behave like primary objects, and their child objects behave like sub-objects. The only difference between primary objects and custom objects is in their nomenclature:

      • For primary objects, you use the name of the class, such as Contact.
      • For custom objects, you concatenate the package name and object name. For example, if you have a customobject package called CO and a custom object named purchased_product, you reference this object as COpurchased_product.

      Custom fields

      Custom fields are referenced using C$ appended with camelcase field names. For example, a custom field named cust_int is referenced as C$CustInt.

      Custom attributes

      Custom attributes are referenced using the package name and object name joined by a dollar sign ($). For example, a custom attribute named cust_attr, packaged under CO, is referenced as CO$cust_attr.

       Thanks

      -Lakshay

    • Rajesh Ashok Kumar

      Hi Lakshay

      Incident.CO$Essence is also not working.

      workspaceRecord.updateField('Incident.CO$Essence', "3");

      I get error message "Unable to update value for field CO$Essence".

    • Rajesh Ashok Kumar

      Hi Lakshay

      Thanks for all your help. Finally I got this working.

      Incident.CustAttrib$Essence worked. The package name was CustAttrib.

      workspaceRecord.updateField('Incident.CustAttrib$Essence', "3");