• priyanshi
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 7
    Replies
Hi

I have to submit an app for security review and want to know if CRUD and FLS need to be enforced manually for apex triggers as well? I am referring to the link below but it does not mention anything about triggers.
https://developer.salesforce.com/page/Enforcing_CRUD_and_FLS

Please help.
Thanks!

Hi

 

I am trying to upload an image as an attachment in my VF page but get the maximum view state reached error when I try to upload the file. My code is as follows:

 

VF:

<tr>
<td>{!companyLogoLabel} </td>
<td>
<apex:image id="theImage" value="{!$Site.Prefix}/servlet/servlet.FileDownload?file={!attachID}" width="80" height="80" /> <br/>
<apex:outputPanel >
<div class="fileinput"><apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file" style="font-size: 12px"/>
<apex:commandButton value="{!uploadLabel}" action="{!upload}" /></div>
</apex:outputPanel>
</td>
</tr>

 

Apex:

public Attachment attachment //for company logo
{
get
{
if (attachment == null)
attachment = new Attachment();
return attachment;
}
set;
}

public pagereference upload() // used for uploading company logo
{
if(attachID != null)
{
list<attachment> attList = [select id from attachment where id=: attachID and id !=: oldattId];
delete attList;
}
attachment.OwnerId = UserInfo.getUserId();
attachment.ParentId = accId; // the record the file is attached to
attachment.contentType ='image/jpg';
attachment.name ='logo.jpg';
try
{
insert attachment;
attachID = attachment.id;
}
catch (DMLException e) {
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading attachment'));
return null;
}
finally {
attachment.body=null; //to clear the viewstate
attachment = new Attachment();
}
return null;
}

 

 

Please help.

 

Thanks

Priyanshi

i have the following piece of code but it has no effect on the command link style.

 

<style>

.linksclass
{
a:link {color:#FF0000;}
a:visited {color:#00FF00;}
a:hover {color:#FF00FF;}
a:active {color:#0000FF;}
}

</style>

 

<apex:commandLink action="{!first}" styleClass="linksclass" >First</apex:commandlink>

 

 

can anyone suggest how to achieve a similar effect?

thanks 

i have a master object with private sharing settings i.e. it has only read only access.

the child object's records should also be read only then. however other users r able to edit the record. why is that so? can anyone explain how to correct this?

hi

i am trying to save a new child record on a vf page. i want that the master detail field of the record is filled automatically with the parent id passed in the url of the page. can anyone help me with this plz...

is it possible to access the created by standard field name of a record? how and what is its api?

i have this custom controller and when i try to retrieve the owner field it shows an error.

 

public class postscontroller {

public list<post__c> getMyposts() {

return [select name,owner,id,subject__c,posted_on__c,category__c from post__c];
}

}

 

can anyone help me know why i am getting an error?

is there any way to add new records in an object without creating a custom tab for that object?

i have the following piece of code but it has no effect on the command link style.

 

<style>

.linksclass
{
a:link {color:#FF0000;}
a:visited {color:#00FF00;}
a:hover {color:#FF00FF;}
a:active {color:#0000FF;}
}

</style>

 

<apex:commandLink action="{!first}" styleClass="linksclass" >First</apex:commandlink>

 

 

can anyone suggest how to achieve a similar effect?

thanks 

i have a master object with private sharing settings i.e. it has only read only access.

the child object's records should also be read only then. however other users r able to edit the record. why is that so? can anyone explain how to correct this?

is it possible to access the created by standard field name of a record? how and what is its api?

i have this custom controller and when i try to retrieve the owner field it shows an error.

 

public class postscontroller {

public list<post__c> getMyposts() {

return [select name,owner,id,subject__c,posted_on__c,category__c from post__c];
}

}

 

can anyone help me know why i am getting an error?

Is it possible to create a java script variable in visual force that can be used in multiple areas.

 

For instance if I have multiple page block and java script sections in a VF page, I want to declare a variable once in Java Script and use it in multiple page blocks. Currently I have to declare them multiple times within the individual page block section, I would like to declare it once and use it multiple java script blocks in my page.

 

How do I declare this?

 

Thanks

 

 

  • September 30, 2010
  • Like
  • 0