You need to sign in to do that
Don't have an account?
John L.
My thinking was that the controller code did nothing to cause the field to be non-writeable, and there are not any programming facilities (that I know of) to make the field writable. BTW, I have also tried copying Results via the deepclone() method, but the cloned array is non-writable in this field also.
request for help redirected here by Customer Support (salesforce.com Case Number 02343719)
I am receiving the following Apex Controller compile error message:
Field is not writeable: Name.Name at line 17 column 38
Below is the code in question:
Code:
public class mySecondApexPageController { public String getMumbledpeg() { return ('Mumbledpeg'); } public List<EmailTemplate> getTemplates() { System.debug('Entering getTemplates() in mySecondApexPageController'); List<EMailTemplate> Results = [ SELECT Id, EMailTemplate.Name, Subject, TemplateType, FolderId, Folder.Name FROM EmailTemplate WHERE IsActive = true ORDER BY Folder.Name, EMailTemplate.Name ]; for ( EMailTemplate i : Results ) { if (i.Folder.Name==null) { i.Folder.Name = 'Unfiled Email Template'; } } return Results; } }
My thinking was that the controller code did nothing to cause the field to be non-writeable, and there are not any programming facilities (that I know of) to make the field writable. BTW, I have also tried copying Results via the deepclone() method, but the cloned array is non-writable in this field also.
That said, is there another methodology I can use to accomplish the desired goal of modifying the Results array contents prior to being returned by the getTemplates() method???
THanks in advance for your time and consideration.
What if I were to implement a GUI which provides function simular to that provided by salesforce.com?
My background in computer instructions, storage, cache, and disk storage suggests that many times things are displayed differently than they are stored. Your post suggests I can only display the information in the same format that it is stored. I can appreciate the source of the problem; I could use help with an appropriate solution. Much of the available documentation adds nothing regarding the source of the "problem", or a method of "solution".
The existing salesforce.com implementation also suggests there is a possible solution, if in fact the existing user interfaces are based on the services offered for customization. As a new solution provider, I appreciate any help you can provide to achieve that goal.
Thanks in advance for any help you can provide.
So: you can't set the Name field because it comes from a relationship. But you can directly set the FolderId field that drives that relationship.