• gene.koopman
  • NEWBIE
  • 0 Points
  • Member since 2011

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

I need to query the remote site settings through the API, but I'm having some trouble finding an example. Based on what I've read/seen it should be possible, this way I don't have to hard code the service endpoint into my apex code, I can just reference the remote site settings and if it changes, no further update will be necessary.

 

Can anyone provide an example of how to query this? 

 

Thanks,
Gene 

This is an odd one, hopefully one of you superstars can help a brother out.

 

I have a 'picker' page, where users chose a product and add it to a list. I have an action function processing the addition, and it's working fine. On completion of the action function, I rerender the dataTable with the added products. Here's the code for the dataTable:

 

        <apex:dataTable value="{!UserProducts}" var="userProd" id="tblUserProducts">
            <apex:column>
                <apex:facet name="header"><input id="chkSelectAllUserProducts" type="checkbox"/></apex:facet>
                <apex:inputcheckbox value="{!userProd.ID}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header"><b>Product</b></apex:facet>
                {!userProd.Name}
            </apex:column>         
            <apex:column >
                <apex:facet name="header"><b>Platform</b></apex:facet>
                {!userProd.Platform__c}
            </apex:column>
            <apex:column >
                <apex:facet name="header"><b>Media Group</b></apex:facet>
                {!userProd.Media_Group_Code__c}
            </apex:column>
        </apex:dataTable>

 Here's the problem: After the first insert, no other values can be inserted. I execute the code, and nothing happens. In fact, it breaks some of the other JS on my page. But, if I remove the <apex:inputCheckbox .../> from the first column, BANG!! It all works again. As you might guess, I'm providing the ability to remove multiple items at once, based on whether the items are checked or not. Any idea why the checkbox would cause this kind of error?

 

Thanks,
Gene

 

I'm building a list of users, and optionally, querying for an alternative list of users, and then removing the users from list #2, from list #1. I'm using Set<User>, so I should be able to use removeAll(setOfUsers) to accomplish this, but it doesn't seem to work. I know both lists contain at least 1 common user, but after this method executes nothing is changed. What is the criteria for matching? Can I influence it somehow? I would prefer not to have to loop through both sets of returns multiple times to find any matches.

 

Also, before anyone asks: No, I cannot simply include the optional filtering criteria in the initial query. I would love to do this, as it would be simpler, but the complexity of both queries precludes this option.

 

Here's the code:

 

        //iterate over the matches and load the users                
        foundSet = new Set<User>();
        for(sObject s : Database.query(qry))
                foundSet.add(new User(ID        = ((User_Info__c)s).User__c, 
                                        FirstName = ((User_Info__c)s).User__r.FirstName, 
                                        LastName  = ((User_Info__c)s).User__r.LastName,
                                        City      = ((User_Info__c)s).User__r.City,
                                        State     = ((User_Info__c)s).User__r.State));
        
        //exclude those users with existing events
        if(foundSet.size() > 0 && includeConflictingUsers.toLowerCase() == 'false')
            foundSet.removeAll(buildUsersWithConflictList(new List<User>(foundSet)));

 

 

We are trying to load images using Javascript by simply appending straight HTML to a page element. Within the HTML we have the following:

 

<img src="img/nextIcon.png" />

 But for some reason, we are being shown a blue box with a question mark in it (meaning that the image could not be found).

 

We are currently developing a Hybrid app with jQuery mobile. I know you all have the solution to this because you have working apps. So how do we get our image to display correctly?

 

This is not a case-sensitive issue, and the path is correct.

 

Thanks for your help.

I have the following method that is performing a javascript remoting call:

 

function doRemote(){
	alert(1);
	
	MyClassName.searchUsers('test',function(result,event){
		//Process the result
		alert('2');
	});
	
	//return the result
	alert(3);
}

 

What I thought would happen is the alerts would execute in 1, 2, 3 order. What actually happens is 1, 3, 2. Is there anyway to control this order of execution? Ideally would like to be able to call a method that performs a JS remoting call, process the results, and then return the results. Seems like a simple request but I can't seem to accomplish this.

 

Thanks,

Jason

 

This is an odd one, hopefully one of you superstars can help a brother out.

 

I have a 'picker' page, where users chose a product and add it to a list. I have an action function processing the addition, and it's working fine. On completion of the action function, I rerender the dataTable with the added products. Here's the code for the dataTable:

 

        <apex:dataTable value="{!UserProducts}" var="userProd" id="tblUserProducts">
            <apex:column>
                <apex:facet name="header"><input id="chkSelectAllUserProducts" type="checkbox"/></apex:facet>
                <apex:inputcheckbox value="{!userProd.ID}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header"><b>Product</b></apex:facet>
                {!userProd.Name}
            </apex:column>         
            <apex:column >
                <apex:facet name="header"><b>Platform</b></apex:facet>
                {!userProd.Platform__c}
            </apex:column>
            <apex:column >
                <apex:facet name="header"><b>Media Group</b></apex:facet>
                {!userProd.Media_Group_Code__c}
            </apex:column>
        </apex:dataTable>

 Here's the problem: After the first insert, no other values can be inserted. I execute the code, and nothing happens. In fact, it breaks some of the other JS on my page. But, if I remove the <apex:inputCheckbox .../> from the first column, BANG!! It all works again. As you might guess, I'm providing the ability to remove multiple items at once, based on whether the items are checked or not. Any idea why the checkbox would cause this kind of error?

 

Thanks,
Gene

 

I'm building a list of users, and optionally, querying for an alternative list of users, and then removing the users from list #2, from list #1. I'm using Set<User>, so I should be able to use removeAll(setOfUsers) to accomplish this, but it doesn't seem to work. I know both lists contain at least 1 common user, but after this method executes nothing is changed. What is the criteria for matching? Can I influence it somehow? I would prefer not to have to loop through both sets of returns multiple times to find any matches.

 

Also, before anyone asks: No, I cannot simply include the optional filtering criteria in the initial query. I would love to do this, as it would be simpler, but the complexity of both queries precludes this option.

 

Here's the code:

 

        //iterate over the matches and load the users                
        foundSet = new Set<User>();
        for(sObject s : Database.query(qry))
                foundSet.add(new User(ID        = ((User_Info__c)s).User__c, 
                                        FirstName = ((User_Info__c)s).User__r.FirstName, 
                                        LastName  = ((User_Info__c)s).User__r.LastName,
                                        City      = ((User_Info__c)s).User__r.City,
                                        State     = ((User_Info__c)s).User__r.State));
        
        //exclude those users with existing events
        if(foundSet.size() > 0 && includeConflictingUsers.toLowerCase() == 'false')
            foundSet.removeAll(buildUsersWithConflictList(new List<User>(foundSet)));

 

 

I am running into a very serious error with deploys, and before I log a case, was wondering if anyone else has seen this.

 

I have two sandboxes, A and B.  A is in Spring 11 and B is in Summer 11.

 

In my org, I have a VF Page and its controller which utilizes javascript remoting.  It works fine in both Sandbox A and B.

 

Now lets say I make a change to an sobject, such as adding a field that is not referenced anywhere, then deploy just this changed sobject to sandbox B.

 

After the deploy, the VF Page and its controller break in Sandbox B, but continue to work in Sandbox A.  The error given is a strange one:

 

Visualforce Remoting Exception: Cannot call test methods in non-test context

 

I am definitely not calling test methods from my remote apex.  If I drill into the error with Firebug, I can see it gets thrown in the following code (which is salesforces):

 

 

Visualforce.remoting.Util = {
log: function(msg, obj) {
if (typeof console === 'undefined' || !console.groupCollapsed || !console.log || !console.groupEnd) return;
if (typeof obj !== 'undefined' && obj !== null) {
try {
console.groupCollapsed(msg);
console.log(obj);
console.groupEnd();
} catch(e) {}
} else {
try { console.log(msg); } catch(e) {}
}
}, 

 

 

I can then add one dummy line (it literally does not matter what I add) of code to the problematic VF page and its controller, then I can redeploy the page and its controller, and things work again in Sandbox B.

 

This is quite strange, but I can consistently reproduce it with these steps.

 

Any ideas?

Does anyone know how to display image on mobile using mobile function?

  • May 09, 2011
  • Like
  • 0

I have a custom setting that I want to be able to see the value of via the API.

"Custom settings that have Privacy defined as Public are exposed to the API in the same way custom objects are exposed."

But how do I match that to the user I'm logged in as?  It's not like the Id's returned are the same as ProfileIds.

 

PS: Sorry for the double posting of this.

Message Edited by NBlasgen on 01-24-2010 09:43 PM