Agent Desktop

Get Involved. Join the Conversation.


    Muthulakshmi Muthaiah
    How to set a custom Primary Key in custom object
    Topic posted June 24, 2019 by Muthulakshmi MuthaiahBronze Trophy: 5,000+ Points 
    27 Views, 1 Comment
    How to set a custom Primary Key in custom object
    Primary Key(Text Field) in custom object

    Hi All,

    How to set a text field value as a primary key in custom object. For example I have a custom object called "Account" and the text field as "Account Name" as a Primary Key for that Account object. Whenever the Account name is duplicate, it throws an error, it should be an unique value (This will work like a email address field in Contact object)

    Is there anyway to achieve the above functionality and it works via API/Workspace level also.

    Please advise on this.






    • Gursimran Singh Saini

      AddIns be the recommended solution for this.

      A workspace Addin which listens to PropertyChanged Event of the Custom Object Record Context.
      Check the field change in PropertyChanged Function and run a ROQL or Report to check if the record is unique. Make sure Report is on Operational Database.