• Eva DeLoriol
  • NEWBIE
  • 25 Points
  • Member since 2006
  • Sr Developer
  • Univar

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 3
    Questions
  • 13
    Replies

can someone point out what i am doing wrong, or what is the correct way to find if the picklist field contains any of the mentioned values.


Save error: Method does not exist or incorrect signature: [SET<String>].contains(String, String, String, String, String, String, String)

 

 

Schema.DescribeFieldResult F = Object__c.Picklist_Field__c.getDescribe();
List<Schema.PicklistEntry> P = F.getPicklistValues();

set<string> s1 = new set<string>();
for ( Schema.PicklistEntry p1: p){

s1.add(p1.getValue());

system.debug(s1);
}
if (Field1__c == 0) {


if (s1.contains('Support Calls- A','IT Help Desk-L1','IT Help Desk - L2','Support Calls- B','Support Calls- C','Support Calls- D')){    // this is where the error is

Total = a.otherField__c ;

}

 

  • September 06, 2012
  • Like
  • 0
Can we add the Data.com Clean button to Visual force pages? It appears to require a csrf token.I am trying to deconstuct the standard button but maybe someone has already come up with a way to add the Data.com Clean button to a Visual force page.

I have written some code that gets the confirmationtoken and tries to insert it into the csrf arg, but I am still not getting anything other than the error about an invalid session. 

JavaScript to get the key:
<script>
 // get confirmation token and set webform field
 var jQuery = jQuery.noConflict();
 jQuery(function($){
  $(document).ready(function(){
$.ajax({
url:location.href,
contentType:"text/html",
xhrFields:{withCredentials:true}
}).done (
function(data){
key_start='chatter.getToolbox().setToken(';
key_end=');';
pos_start=data.indexOf(key_start);
pos_end=data.indexOf(key_end,pos_start+key_start.length);
confirmationtoken=data.substring((pos_start+key_start.length)+1,pos_end-1);
//add value to page params 
console.log('^^^^^^^^^^^^^^^^^^^^^^ confirmationtoken val : ' + confirmationtoken);
paraConfirm(confirmationtoken);
});
});	
 });

function stopPage(){
return false;
}	
 </script>

Actionfunction to use the key:
 
<apex:actionFunction name="paraConfirm" rerender="buttonform" onComplete="stopPage();">     
     <apex:param id="ct" name="confirmationtoken" value="" />
 </apex:actionFunction>

Button for "Clean"
<input value=" Clean " id="dataClean" class="btn" title="Clean" 
name="datadotcomclean" type="button" onclick="SfdcApp.DataDotCom.CleanDialog.showDialog({entityId:'{!LEFT(account.id,15)}',cleanStatus:'1',csrf:'{!csrfValue}'})"/>

The csrfValue is coming from the Controller where I am just returning what was passed via the JavaScript:
public String getCsrfValue(){
    csrfValue = Apexpages.currentPage().getParameters().get('confirmationtoken');

    Apexpages.currentPage().getParameters().put('csrf', csrfValue);
	return csrfValue;
		
	}

I know that the value is being passed to the controller since I had debug statements there to let me know if it was successful or not.

If anyone has actually figured this out I would really appreciate the help. 

Maybe it isn't the confirmationtoken that I need to use, but when viewing a standard page, it looks similar since they start with a "VF..."
Thanks!
 

I've written a trigger that can find all content related to the Tags on an opportunity.

I have related the content to the Opportunity, but it shows up in the "Content" related list and not the "Related Content" related list where there are actions to deliver content. 

I added Opportunity as a Field on the Content object to try and achieve the relationship, and I am getting results in the Content related list, but I really don't want it there, it needs to be in Related Content. 

trigger opportunityTagContent on Opportunity (before insert, before update) {

String tagN;


   for(Opportunity o: Trigger.new){
   //get all tags for this opportunity
    list<OpportunityTag> list_tags = new list<OpportunityTag>();
     for (OpportunityTag ot : [SELECT Id, Name, ItemId, Type FROM OpportunityTag WHERE ItemId = : o.Id]){
     if(ot.Type == 'Public'){
       // Create a new wrapper object
        tagN = String.valueOf(ot.Name);
        //now we should have a list of Opportunity Tags to work with
         System.debug('********** TAGN ' + tagN);
          String searchquery='FIND\'' + tagN + '\'IN ALL FIELDS RETURNING ContentVersion(Id, ContentDocumentId)'; 
          
          List<List<ContentVersion>>searchList= search.query(searchquery);
          //ContentVersion[] is a list using searchList - first returned item in the searchQuery - id
          ContentVersion[] cv = ((List<ContentVersion>)searchList[0]);
             for(ContentVersion convers : cv){
             convers.Opportunity__c = o.id;
             update convers;
             }         
          
        }
    
    }
   
  }
     
}

 Thanks,

Eva

The url ref to the user image on the Chatter connector VF page is broken.  It refers to this url:

 

https://combopack.cs3.visual.f orce.com/userphoto?u=005300000 00dTejAAE&v=1&s=T

Which is wrong - it should be:
https://cs3.salesforce.com/use rphoto?id=00530000000esEw&v=1&s=T

I'd like to be able to edit this myself, but I can't since the VF Page is part of a managed package? It needs to be fixed though. Or if there is a workaround, I would be happy with that too.  Thanks!

Eva DeLorio

I have arequiremnt that i want to take a photo from vf page using mobile/tablet
Hello,

How can I show header on visual force page with google map in the page. Now if I try to set shoheader to true in <apex:page> tag it stops displaiyng the header.. Please if anyone can give any idea it will be great..
  • January 09, 2014
  • Like
  • 0

Hi, users want to see all Campaign Members for Contacts at an Account on the Account page in a related list. Makes sense.

So I need to link the Campaign Member object directly to the Account.

Here's my code - am not sure why it isn't working.

Oddly the system debug tells me the field Contact on the Campaign member is Null even though the Member is linked to a Contact via it.

 

Any help appreciated thanks!

 

trigger AccountCampaignMember on CampaignMember (after insert, after update)
{
    
    for (CampaignMember t : Trigger.new)
    {
       system.debug('camp memb id================'+t.id);
       system.debug('camp memb Contact================'+t.Contact);
       system.debug('camp memb ContactAccount================'+t.Contact.Account);

            if (t.Contact<> null)
{
If (t.Account__c==null){

                t.Account__c= t.Contact.AccountId;
            }
        }
    //update t;
}}

 

Hi All,

I have a custom button on VF page (say open), when clicking on the button the page should open in a new window; it is working when Development mode is on (checked) , when switched off the development mode the page is opening inline on VF page only. Any help is highly appreiciated.


<apex:pageblockButtons location="top">
            
    <apex:commandButton action="{!tOpen}" value="Open"/>
            
</apex:pageblockButtons>



 public PageReference tOpen(){  

        PageReference pref= new PageReference('/'+ tid +'?retURL=%2F'+cid);
        pref.setRedirect(true);
        return pref;
 
    }



Thanks a ton inadvance!

 

 

  • March 25, 2013
  • Like
  • 0

can someone point out what i am doing wrong, or what is the correct way to find if the picklist field contains any of the mentioned values.


Save error: Method does not exist or incorrect signature: [SET<String>].contains(String, String, String, String, String, String, String)

 

 

Schema.DescribeFieldResult F = Object__c.Picklist_Field__c.getDescribe();
List<Schema.PicklistEntry> P = F.getPicklistValues();

set<string> s1 = new set<string>();
for ( Schema.PicklistEntry p1: p){

s1.add(p1.getValue());

system.debug(s1);
}
if (Field1__c == 0) {


if (s1.contains('Support Calls- A','IT Help Desk-L1','IT Help Desk - L2','Support Calls- B','Support Calls- C','Support Calls- D')){    // this is where the error is

Total = a.otherField__c ;

}

 

  • September 06, 2012
  • Like
  • 0

Hi,

 

I am attempting to use the new $RemoteAction variable and Visualforce.remoting.Manager.invokeAction() function in the summer 12 release.

 

I have successfully used them to call a remote action function when that function takes a single argument as its input, e.g.


Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteController.test1Str}','1 argument', handleReturn,{escape: true});

 

I have methods currently working in salesforce which accept 0 and 2 or more arguments. The obvious way of calling these to me would be to simply include the arguments separated by commas as that is what is done with the current calls, e.g.

RemoteController.test0Str( handleReturn,{escape: true})

 would map to

Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteController.test0Str}', handleReturn,{escape: true});

 and likewise for 2 arguments:

RemoteController.test2Str('2','arguments',  handleReturn,{escape: true})
Visualforce.remoting.Manager.invokeAction('RemoteController.test2Str','2','arguments', handleReturn,{escape: true})

 But for these two cases I get the following logged to the JS console:

Visualforce Remoting: Parameter length does not match remote action parameters: expected 0 parameters, got
Visualforce Remoting: Parameter length does not match remote action parameters: expected 2 parameters, got  

 So it is clear that salesforce know what it is expecting, but it is not clear how I pass the arguments.

 

I have also attempted passing the arguments as an array ,e.g.

[]
['1 argument']
['2','arguments']

 and (in desparation) as a single object with the argument names as the parameter names! None of this works.

 

Has anyone had any success using remoting in this fashion? There is a gist of my code at https://gist.github.com/2713502.

 

Regards,

 

James

I'm trying to include related lists for Related Content and Content Deliveries on a VF page and I can't figure out their relationship names. I searched in the docs but couldn't find that info. Can someone help?

Where is that info (list of all standard relationship names) documented?

 

I tried the following and few other names without luck.

 

 

<apex:relatedList list="RelatedContent" />
<apex:relatedList list="Content" />
<apex:relatedList list="ContentDeliveries" />

 

 

Thanks much

  • February 15, 2011
  • Like
  • 0

Hi,

I need to put a custom related list on the account detail page and put the Hover link on the top of the page for the custom related list.

 

I was able to do the custom related list displayed on the bottom of the Account detail page wiring a standard controller extension and visula force page.

 

Now the problem is How do I place the Hover link on the top of the page for the custom list? I saw couple of threads for the above, but the hover links issue was never discussed?.

 

Can any one please guide me how can I do this.

 

Thank you.

I'm able to make Debug Log entries from (service-side) APEX code via System.debug() calls, and referring to Setup+Monitoring+Debug Logs+...
 
From using the various resources at my disposal, I understand that the following should accomplish the subject task:
Code:
<script type="text/javascript" src="/soap/ajax/8.0/connection.js"></script>

 
Code:
sforce.debug.trace=on;
if (sforce.debug.trace) { sforce.debug.log("This is the message inserted into the Debug Log.");}

Alas, this does not work as expected (and I suspect the referenced ajax level is downlevel also).
 
Thanks  in advance for any help you could provide to accomplish the desired task.

Hi,
 
I would like to add "Personal Tagging" or " Public Tagging" in visual force page layout.
 
Can it be possible? do we have any syntex or pageblock section or header section with Tagging enable?
 
 
Thanks in advance.
 
  • September 29, 2008
  • Like
  • 0
Hi there, I've created a public class called SponsorshipMaintenance that has a public method UpdateSponsorshipCountry. Looks like this:

public class SponsorshipMaintenance {
   
    public void UpdateSponsorshipCountry(List<Sponsorship__c> Sponsorships, List<Id> ChildIds){
          // .... some code here
   }

}

The class compiles with no errors. When I try to compile a trigger that has a call to the UpdateSponsorshipCountry method, I get the message "method does not exist or incorrect signature" on the line that calls the method. The trigger looks like this:

trigger SponsorshipSetCountry on Sponsorship__c (before insert, before update) {   
    //get list of sponsored child Ids of new sponsorships
    Id[] SponsoredKids = new Id[]{};
    for (Sponsorship__c spons : Trigger.new){
        SponsoredKids.add(spons.Child__c);   
    }
   
    //call method to set the correct country on the sponsorship objects
    SponsorshipMaintenance.UpdateSponsorshipCountry(Trigger.New,SponsoredKids); //this is the line that's generating the error. If I comment it out, the trigger compiles.
}

Any guidance would be most appreciated. Thank you!

  • October 21, 2007
  • Like
  • 0
Have ported the Mass Create Tasks freebie to 8.0 from ajax beta and would like to add the email notification option.  The ajax documentation seems to indicate that I don't need to create an EmailHeader instance, but rather just need to set

sforce.connection.triggerUserEmail=true;

before the task 'create' call. Is this the case? I assume something is missing, as it does not work. 
 
Any help would be greatly appreciated!!
 
p.s. - when done and with notification working, I will post this to appexchange, if anyone is looking for something similar
Hi,

We have a Java Script running on Home page load when user logs in to do some functions like which we have done through placing custom link in the homepage component

1. hide the  Salesforce Discover button on home page.
2. to hide the chatter section on home page
3. to set some variables to hide some section on Account standard page layout based on the user profile.
4. to customize some links.

With Winter 16 release in place, all these functionalities are disturbed which works only on click of the custom link on home page.
Appreciate any help in getting rid of this  instead to run some scripts on page load without any button clicks.