• TheCustomCloud
  • NEWBIE
  • 75 Points
  • Member since 2009

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 35
    Questions
  • 27
    Replies
I select a file, I click the button to save the file as an attachment.  This all works fine.  But if I then refresh the browser it adds that same file a second time.  If I refresh again it again adds a 3rd file and so on..

Anyone know how to fix this?  I tried nulling the attachment out in the controller but it doesnt help :(

Here is the inputfile and command button in the VF page.
<apex:pageBlockButtons location="top">
            <apex:inputFile styleClass="btn" value="{!anAttachment.Body}" fileName="{!anAttachment.Name}"/>&nbsp;
            <apex:commandButton id="saveButton" value="{!$Label.Save_Attachment}" action="{!saveAttachment}"/>
</apex:pageBlockButtons>

Here is the save method in the controller

// save attachment to service case
    public void saveAttachment(){
        // create bridge object for additional functionality
        Attachment__c bridge = new Attachment__c();
        bridge.External__c = false;
        bridge.Restricted__c = false;
        bridge.Service_Case__c = theCase.York_Case__c;
        insert bridge;
        
        // create attachment and add it to the bridge object
        anAttachment.parentId = bridge.id;
        insert anAttachment;
        anAttachment = null;
        anAttachment = new Attachment();
    }

Here is the end result with multiple copies of the same file being attached after I clicked refresh twice.

  User-added image

I am inserting share records on a custom object fine through dataloader.

 

I am trying to insert a share record in a trigger and I get errors when the user is currently inactive.

 

 

This is going to be a huge problem for my project, anyone know how to get around this?

 

 

thank you!!

If I want to message a particular user I can just use @Mark Benioff.  Is there a way to message a whole organization?

<apex:image url="https://c.cs7.content.force.com/servlet/servlet.ImageServer?id={!TD_Logo}&oid={!$Organization.Id}"/>

I remove all hardcoding but this one is giving me problems.  Is there a command to pull the org instance?

Why doesnt this trigger work?  It doesnt throw any errors it just doesnt populate the title field.  Can I not use a reference like Contact__r.Contacts_Title__c in a trigger?

 

trigger AddTitleToAttendee_BI on Attendee__c (Before Insert) {  
    
    for(Attendee__c a : trigger.new){
        a.Title__c = a.Contact__r.Contacts_Title__c;
    }
}



Has anyone been able to get jQuery to work in a custom button for a standard page layout?  All the examples I can find are on custom VF pages :(

 

Example code or a link to example code would be very much appreciated.

 

Thank you.

It is a pretty simple scenario so I will summarize it.   I cannot find anything to explain this behaviour so I am hoping some of you Apex geniuses can tell me that I am just making a simple mistake.

 

The users enters input into a field and then clicks a button.  The button calls the controller to create another sObject and it is displayed on the VF page using a repeat.  Another button is suppose to delete the last item from the list.  The field the user is inputting is a master-detail and therefore is a required field but why do I get the "Error: You must enter a value" when I am trying to just remove the last sObject from the list?


Here is the code.

 

<apex:repeat value="{!requests}" var="r">
                    <apex:pageBlockSection columns="1">
                    <apex:inputField value="{!r.Contact__c}"/>
                    </apex:pageBlockSection>
</apex:repeat>

 

public List<Attendee__c> requests {get; set;}

 

public void addAttendee() {
        attendeesList.add(new Attendee__c(Meeting__c = meet.Id));
}

 

public void removeAttendee() {
        if(attendeesList.size() > 0){
            attendeesList.remove(requests.size()-1);
        }
}

 

 

Thank you!

Hi,

 

Any ideas how I can print an Attachment given I know the url to it? The url to an Attachment is something like:

https://na3.salesforce.com/servlet/servlet.FileDownload?file=00PA0000002Dlc5

 

The Documents.Open() method takes in a url, and the above url doesn't work.

Hi all,

 

I have a standalone Flex app, e.g. not embedded in a VF page.

 

I can log into a non-sandbox org, but I cannot seem to log into a sandbox org.

 

I have tried changing the LoginRequest.server_url property to "https://test.salesforce.com" and "http://cs2.salesforce.com" with no luck, and I also tried changing xmlns:salesforce= to both of these values as well.

 

How is this meant to be attained? 

 

Thanks!

Salesforce saves phone numbers like this (905) 123 - 1234

 

Agents type numbers in the search like this 9051231234

 

 

This works for standard account and contact objects but not for my client's custom objects.

 

 

There are hundreds of thousands of records so the addition of a hidden field that changes the phone format to be more searchable is not a valid option at this point since this field would only be updated if each record was opened and resaved.

 

The Salesforce support does not have any solutions for me so I am reaching out to you guys in the dev community.  Please help! 

SAML for Web Access and Delegated Authentication for API (Web Service - desktop client) access.

 

Thanks.

I have a button that when the user clicks it it is suppose to grab from the fields the user just filled in and say return them an alert message.  I am having trouble tho because the object is not saved so the values do no exist in the db yet.   

 

How do I retrieve values from the user's currently open page before they save those values? 

Message Edited by Redfin on 10-05-2009 02:28 PM
Hi,
 
I am a new bee to Apex development.
I am trying to generate Apex class from Fedex shipping WSDL file.
 
After parsing the file, I tried to generate the Apex class but I was getting the following error,
 
Apex generation failed.
Error message:
Error: Unsupported WSDL. Operation 'deleteShipment' has more than one output element.
 
How do I generate the Apex class?
 
please throw some light on it.
 
thanks
sk