• nileshj
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 5
    Replies

Hi,

I am facing an issue while making HTTP POST request on remote site for uploading file.

On HTTP req.setbody() there is a limit of 3 mb.

So how can I upload files larger than 3 mb??


I have noted down the request and http call for the same

 

     

  sUrl = 'https://upload.box.net/api/1.0/upload/'my_auth_token/598054528';


        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setHeader('Content-Type','multipart/form-data;boundary='+boundary);
        req.setHeader('Content-Encoding','base64');
        req.setEndpoint(sUrl);
        req.setMethod('POST');
        req.setTimeout(60000);        
        req.setBodyAsBlob(EncodingUtil.base64Decode(blobObject));

        response = h.send(req);

 

 

Any pointer on this will be helpful.

 

Thanks,

Nilesh.

I have a picklist in my flow.
But it shows that VALUE in this field is mandatory?

Ho do I resolve this problem?

Can we add splash screen for a button?

Hi,

 

I am new to salesforce..
I am iterating textbox in apex:datalist

 

 

<apex:form>

<apex:datalist value="{!a}" var="temp">

         <apex:outputtext value="{!a.name}"/>

 

         <apex:inputText   id="commentBody"   value="{!x}"/>

 

                     <apex:commandButton action="{!commentFunction}" value="Submit" >
                                          <apex:param name="commentUserId" value="{!$User.Id}"/>
                                        <apex:param name="postIdcomment" value="{!a.Id}"/>
                                      </apex:commandButton>
</apex:datalist>

</apex:form>

 

Now on click of submit when I try to get the value of text box I am getting the null value as the value for last textbox is null.


How to I dynamically iterate textbox so that values will get captured correctly in controller?
Also the the param values are getting captured null
Any pointers will be helpfull.

Thanks.

Hi ,

I have a query

 

List<NewsFeed>newsFeedList  = [SELECT Id, Type,
                                        CreatedById, CreatedBy.Name,
                                        CreatedDate, LastModifiedDate,
                                        ParentId, Parent.Name, Parent.Type,
                                        RelatedRecordId, CommentCount,LikeCount,
                                        Body, Title, LinkUrl, ContentData, ContentFileName,
                                            (SELECT Id, FieldName, OldValue, NewValue
                                                FROM FeedTrackedChanges ORDER BY Id DESC),
                                            (SELECT Id, CommentBody, CreatedDate,
                                                CreatedBy.Name, InsertedBy.SmallPhotoUrl,FeeditemId
                                                FROM FeedComments ORDER BY CreatedDate DESC LIMIT 2),
                                            (SELECT CreatedBy.Name FROM FeedLikes)
                                        FROM NewsFeed ORDER BY CreatedDate DESC LIMIT 10];

 

 

 

and i want to get like and comment count for current news feed item.

How this can be acheived?

I have a query

[SELECT Id, Type,
                                            CreatedById, CreatedBy.Name,
                                            CreatedDate, LastModifiedDate,
                                            ParentId, Parent.Name, Parent.Type,
                                            RelatedRecordId, CommentCount,LikeCount,
                                            Body, Title, LinkUrl, ContentData, ContentFileName,
                                                (SELECT Id, FieldName, OldValue, NewValue
                                                 FROM FeedTrackedChanges ORDER BY Id DESC),
                                                (SELECT Id, CommentBody, CreatedDate,
                                                 CreatedBy.Name, InsertedBy.SmallPhotoUrl
                                                 FROM FeedComments fc ORDER BY CreatedDate DESC LIMIT 2),
                                                (SELECT CreatedBy.Name
                                                 FROM FeedLikes)
                                            FROM NewsFeed  ORDER BY CreatedDate DESC LIMIT 4];



I want to use     InsertedBy.SmallPhotoUrl       field from inner query in my visualforce page.

How this can be achived?

 

 

trigger Trigger1 on Task (after insert,after update)
{
List<String> mlist = new List<String>();
List<String> mailAddrs = new List<String>();
String fURL = URL.getSalesforceBaseUrl().toExternalForm() ;


for(Task t : Trigger.new)

{
Account act = [select Name from Account where Id =: t.AccountId];
if(t.Status == 'Completed')
{
if( t.Activity_Type__c == 'Resolved')
{

Group g = [SELECT (select userOrGroupId from groupMembers) FROM group WHERE name = 'SET A'];

for (GroupMember gm : g.groupMembers)
{
mlist.add(gm.userOrGroupId);
}

User[] usr = [SELECT email FROM user WHERE id IN :mlist];
for(User u : usr)
{
mailAddrs.add(u.email);

}
}
else if ( t.Activity_Type__c == 'Completed')

{
Group g = [SELECT (select userOrGroupId from groupMembers) FROM group WHERE name = 'SET B'];
for (GroupMember gm : g.groupMembers)

{
mlist.add(gm.userOrGroupId);
}

User[] usr = [SELECT email FROM user WHERE id IN :mlist];
for(User u : usr)
{
mailAddrs.add(u.email);
}
}

else if ( t.Activity_Type__c == 'In Progress')

{
Group g = [SELECT (select userOrGroupId from groupMembers) FROM group WHERE name = 'SET C'];
for (GroupMember gm : g.groupMembers)

{
mlist.add(gm.userOrGroupId);

}
User[] usr = [SELECT email FROM user WHERE id IN :mlist];
for(User u : usr)
{
mailAddrs.add(u.email);
}
}

else if ( t.Activity_Type__c == 'On Hold')

{
Group g = [SELECT (select userOrGroupId from groupMembers) FROM group WHERE name = 'SET D'];
for (GroupMember gm : g.groupMembers)

{
mlist.add(gm.userOrGroupId);

}
User[] usr = [SELECT email FROM user WHERE id IN :mlist];
for(User u : usr)
{
mailAddrs.add(u.email);
}
}

else
{
Group g = [SELECT (select userOrGroupId from groupMembers) FROM group WHERE name = 'SET E'];

for (GroupMember gm : g.groupMembers) {
mlist.add(gm.userOrGroupId); }

User[] usr = [SELECT email FROM user WHERE id IN :mlist];
for(User u : usr) { mailAddrs.add(u.email); }

}

if(mailAddrs != null || mailAddrs.size() > 0)
{
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

mail.setToAddresses(mailAddrs);

mail.setSubject(t.Activity_Type__c+' : '+act.Name+' Task Information');

mail.setPlainTextBody(' Contact Report has been completed '+'\n'+fURL+'/'+t.Id);

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}

}
}

 

The above trigger is working fine. Can any one help to avoid Governor limits for this trigger. by using collections can do it. but am not able fix it please help me on this.

  • October 15, 2013
  • Like
  • 0

Hi All,

I have a custom VF page which performs the normal search functionality on Account and based on the selected account value wants to proceed further.

Problem:

I am not able to pass the selected account's id as action function is not working in the following code:

 

<apex:page controller="accountSearch">
<apex:form >
<script>
function toGetAccountId(id)
{
alert('test1');
variable1=document.getElementById(id).value;
xyz(variable1);
alert('test2');
}
</script>

<apex:pageBlock >


<apex:actionFunction name="xyz" action="{!samepage}">  

   <apex:param value="" assignTo="{!var1}"/>

</apex:actionFunction>



<apex:outputLabel value="Enter your search text:" >
<apex:inputText value="{!searchVar}">
</apex:inputText>
</apex:outputLabel>

<apex:commandLink value="Search" action="{!getAccounts}" />

<apex:pageBlockTable value="{!accList}" var="acc">
<apex:column headerValue="Account Name" > <apex:outputLink id="olId" onclick="toGetAccountId('{!$Component.olId}')">{!acc.name}
</apex:outputLink></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

-----------------------------------------------------

controller:

public with sharing class accountSearch {

public String olId { get; set; }
public String searchVar { get; set; }
public String var;
public String var1{get;set;}
public String var2;
public list<Account> accList = new list<Account>();

public PageReference getAccounts() {
var='%'+searchVar+'%';
system.debug('aaaaaaaaaaaa'+var);
accList = [Select name,NumberOfEmployees from account where name LIKE:var ];
system.debug('vvvvv'+accList);
return null;
}

public list<Account> getAccList(){
return accList;
}
public pagereference samepage()
{
//PageReference curPage = ApexPages.currentPage();
system.debug('lllllllllll');
var2=var1;
system.debug('dddddddddddddd'+var2);
PageReference curPage = new Pagereference('/apex/testpage2');
curPage.setRedirect(true);
return curPage ;
}
}

 

After the list of accounts returned, if I select a particular account (onclick of a output link),the javascript is getting invoked and I am getting the alerts. But the action method (samepage()) is not invoked. (for testing purpose, I am just redirecting a test page on the action method and its not working)

Also, if I try saving <apex:actionFunction name="xyz" action="{samepage}"> instead of  <apex:actionFunction name="xyz" action="{!samepage}"> , its getting saved which is wrong

 

I am at lost. Please help..

 

Thanks.

 

 

 

  • April 08, 2013
  • Like
  • 0

Hi,

 

I am new to salesforce..
I am iterating textbox in apex:datalist

 

 

<apex:form>

<apex:datalist value="{!a}" var="temp">

         <apex:outputtext value="{!a.name}"/>

 

         <apex:inputText   id="commentBody"   value="{!x}"/>

 

                     <apex:commandButton action="{!commentFunction}" value="Submit" >
                                          <apex:param name="commentUserId" value="{!$User.Id}"/>
                                        <apex:param name="postIdcomment" value="{!a.Id}"/>
                                      </apex:commandButton>
</apex:datalist>

</apex:form>

 

Now on click of submit when I try to get the value of text box I am getting the null value as the value for last textbox is null.


How to I dynamically iterate textbox so that values will get captured correctly in controller?
Also the the param values are getting captured null
Any pointers will be helpfull.

Thanks.

I have a query

[SELECT Id, Type,
                                            CreatedById, CreatedBy.Name,
                                            CreatedDate, LastModifiedDate,
                                            ParentId, Parent.Name, Parent.Type,
                                            RelatedRecordId, CommentCount,LikeCount,
                                            Body, Title, LinkUrl, ContentData, ContentFileName,
                                                (SELECT Id, FieldName, OldValue, NewValue
                                                 FROM FeedTrackedChanges ORDER BY Id DESC),
                                                (SELECT Id, CommentBody, CreatedDate,
                                                 CreatedBy.Name, InsertedBy.SmallPhotoUrl
                                                 FROM FeedComments fc ORDER BY CreatedDate DESC LIMIT 2),
                                                (SELECT CreatedBy.Name
                                                 FROM FeedLikes)
                                            FROM NewsFeed  ORDER BY CreatedDate DESC LIMIT 4];



I want to use     InsertedBy.SmallPhotoUrl       field from inner query in my visualforce page.

How this can be achived?