• praveenpro
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies
Hi,
@HttpPost
    global static String createNewAttachments() {
    
        RestRequest req = RestContext.request;        
      
        String optyName=req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        Opportunity objOpty= [ Select ID, Name from Opportunity where Name =:optyName limit 1];
        
        String doc=EncodingUtil.Base64Encode(req.requestBody);
        
        
        Attachment a = new Attachment();
        a.ParentId = objOpty.Id;
        a.Name = 'test.doc';
        a.Body = req.requestBody;
        a.ContentType = 'application/vsn.ms-word';
        insert a;
        
        return 'attachment added';
    }

I am able get attachment using Apex REST Api form external system but the file data was not opened properly in the document.

Hi guys,

 

I have Two Picklists 1.Start Time 2.End Time. i want to find difference between the both times.

 

Ex: Start time: 8:00 AM  End Time :10:00 PM   i want to find Difference Between Start time and end time and difference time populate in another field

 

Give me Reply if any solution.

 

Praveen.

Hi Everyone,

 

i want to display only  time in VF page.   current format is 18:30:00.000Z like this, but i want to show 6:30 pm .

Hi everyone ,

 

  task is i have two lists

                                           1. Existed records 2. new records

 i need to compare two lists and separate duplicates from new records  to one list and insert new records to another list.  pls give me suggestion urgent...

 

Thanks,

Praveen.

hi,

                    My requirement is i have 6 fields(Ptype, region, topic, etc)   in VF page , based on the field data i will get the records, for those records i need to give the pagination like ( first, next, previous, last).

hi,

                    My requirement is i have 6 fields(Ptype, region, topic, etc)   in VF page , based on the field data i will get the records, for those records i need to give the pagination like ( first, next, previous, last). 

<p>i have one task like when i click checkbox i want display pick list in vf page</p>

Hi guys,

 

I have Two Picklists 1.Start Time 2.End Time. i want to find difference between the both times.

 

Ex: Start time: 8:00 AM  End Time :10:00 PM   i want to find Difference Between Start time and end time and difference time populate in another field

 

Give me Reply if any solution.

 

Praveen.

Hi everyone ,

 

  task is i have two lists

                                           1. Existed records 2. new records

 i need to compare two lists and separate duplicates from new records  to one list and insert new records to another list.  pls give me suggestion urgent...

 

Thanks,

Praveen.

hi,

                    My requirement is i have 6 fields(Ptype, region, topic, etc)   in VF page , based on the field data i will get the records, for those records i need to give the pagination like ( first, next, previous, last).

i wrote a trigger on the Account object.It validates the First name for find out the duplicate record .once first names are same it throws an error like already exist.my question is suppose as per requirement  i want to change my rest of fields apart from First Name.i was trying to change the rest of fields and save the record,it throws an same error like already exist.can you tell me how to write a trigger to  save the record without affecting the first name and updating the rest of the fields

 

trigger duplicate on Account (before insert,before update) {
set<string> setnames=new set<string>();
list<account> listnames=new list<account>();
for(account acc:trigger.new)
{
setnames.add(acc.name);
}
listnames=[select name,id from account where name in:setnames];
for(account acc:trigger.new)
{
for(account dup:listnames)
{
if(acc.name==dup.name)
acc.adderror('already exist');

}

}

}

Hi,
 
We have the following visualforce page for new Lead that uses an ActionSupport tag. The functionality is to rerender the Street name field to auto-populate the information based on the postal code information entered. The issue is that the page does a validation before submitting the information to server when user enters the postal code; and the auto-population of street name fails. But if all the madatory information is entered in the VF lead page like (Lead name,Company,Street Number,etc) before the request is submittied with the postal code, then it works fine and populates the rest of the address.
 
We also tried using the "immediate"  attribute of actionSupport tag byt setting it to false like this, but in vain.
 
Please find the attached VF page and Controller. This is the snippet of VF code that is having issues:
 
Code:
            <apex:inputField value="{!lead.Postal_Code__c}" required="true" id="postal_code">           
                 <apex:actionSupport event="onblur"   action="{!addressAutoPop}"  reRender="sname" immediate="true" />
            </apex:inputField>            
             <apex:inputField id="snumber" value="{!lead.Street_Number__c}" required="true"/><b/>
                <apex:inputField id="sname" value="{!lead.Street_Name__c}" />           


 
Appreciate all your valuable feedbacks.

Thanks and regards
  • November 04, 2008
  • Like
  • 0