• AvinashB
  • 5 Points
  • Member since 2012

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 5
Hi there,

I'm trying to make a simple change to this Apex code, trying to add RecordType to the list of fields displayed (see in bold):

public class AttendeeController{
   // global List<SelectableAccount> accounts {get;private set;}
    public List<ClientWrapper> clientList {get;set;}
    public Set<Id> selClientIds {get;set;}
    public Boolean hasSelClient {get;set;}
    public String datename {get; set;}
    public AttendeeController()
        clientList = new List<ClientWrapper>();
        selClientIds = new Set<Id>();
        for(Clients__c c : [Select Id, Name, RecordType from Clients__c where Name != null and active__c = true order by Name limit 999])
            clientList.add(new ClientWrapper(c));
        integer i = 0;

I then get this error message:
No such column 'RecordType' on entity 'Clients__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

I have confirmed that RecordType is the correct field name. It is a standard field. I have also tried selecting another standard field and I get the same mesage. When I try selecting a custome field I have no problem at all.

Can someone help pleae?
Hi All,

I am trying to implement one scenario as mentioed following.

There are certain fields on one object which should be read-only when a user is creating a record. Also, when he edits the records he owns, these fields should be read-only.

All other users should be able to modify those fields on that object while viewing and editing the records created by the other users.

I tried record type, permission set however it does not seem to be working the way I am expecting.Any idea how to proceed on this. 

  • September 30, 2015
  • Like
  • 0
We can use Schema.sObjectType.Contact.isUpdatable() to check if the current user has permissions to update Contact objects in general.

I want this for dynamic object.my object name is within the objName string variable.
I can create a new task from a button and set all the fields I want except the record type. Can anyone help?

I tried myTask.RecordType = "Support Type"; and also RecordTypeID. I either get an error message or no task created.

This code works:

var myTask = new sforce.SObject("Task");
myTask.WhatId= "{!Case.Id}";
myTask.Subject = "{!Case.Account} - {!Case.Reason}";
myTask.status = "Not Started";
myTask.Activity_Business_Type__c = "Existing Business";
myTask.Type = "Product Support Task";
myTask.ActivityDate = "{!SUBSTITUTE(TEXT(TODAY()+3), "/", "-")}";