• Pooperman
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies

I made a test hybrid remote app that I could then modify to do what is needed for a quick proof of concept. However, when I run the test, I immediately get an error as OAuth never loads in the first place. Any pointing in the right direction would be awesome. Was following the documntation. Error log follows:

 

2013-09-24 10:28:25.159 Test[39858:c07] userLogoutSettingEnabled: 0

2013-09-24 10:28:25.191 Test[39858:c07] Multi-tasking -> Device: YES, App: YES

2013-09-24 10:28:25:224 Test[39858:c07] DEBUG|SFAuthenticationManager|No authentication in progress.  Initiating new authentication request.

2013-09-24 10:28:25.349 Test[39858:c07] SFOAuthCredentials:tokenForKey: (-25300) no existing "com.salesforce.oauth.refresh" item matching "{

    acct = "Test-Default-login.salesforce.com";

    class = genp;

    "m_Limit" = "m_LimitOne";

    "r_Attributes" = 1;

    svce = "com.salesforce.oauth.refresh";

}"

2013-09-24 10:28:25.349 Test[39858:c07] SFOAuthCoordinator:authenticate: authenticating as 3MVG9Iu66FKeHhINkB1l7xt7kR8czFcCTUhgoA8Ol2Ltf1eYHOU4SqQRSEitYFDUpqRWcoQ2.dBv_a1Dyu5xa without refresh token on 'https://login.salesforce.com' ...

2013-09-24 10:28:25.351 Test[39858:c07] SFOAuthCredentials:tokenForKey: (-25300) no existing "com.salesforce.oauth.refresh" item matching "{

    acct = "Test-Default-login.salesforce.com";

    class = genp;

    "m_Limit" = "m_LimitOne";

    "r_Attributes" = 1;

    svce = "com.salesforce.oauth.refresh";

}"

2013-09-24 10:28:25:354 Test[39858:c07] DEBUG|SFAuthenticationManager|oauthCoordinator:willBeginAuthenticationWithView

2013-09-24 10:28:25.355 Test[39858:c07] SFOAuthCredentials:tokenForKey: (-25300) no existing "com.salesforce.oauth.activation" item matching "{

    acct = "Test-Default-login.salesforce.com";

    class = genp;

    "m_Limit" = "m_LimitOne";

    "r_Attributes" = 1;

    svce = "com.salesforce.oauth.activation";

}"

2013-09-24 10:28:25.355 Test[39858:c07] SFOAuthCoordinator:beginUserAgentFlow with https://login.salesforce.com/services/oauth2/authorize?client_id=3MVG9Iu66FKeHhINkB1l7xt7kR8czFcCTUhgoA8Ol2Ltf1eYHOU4SqQRSEitYFDUpqRWcoQ2.dBv_a1Dyu5xa&redirect_uri=https://test.salesforce.com/ services/oauth2/callback&display=touch&response_type=token&scope=refresh_token%20web%20api

2013-09-24 10:28:25.373 Test[39858:c07] SFOAuthCoordinator:webView:shouldStartLoadWithRequest: (navType=5): host=(null) : path=(null)

2013-09-24 10:28:25.375 Test[39858:c07] SFOAuthCoordinator:didFailLoadWithError Error Domain=WebKitErrorDomain Code=101 "The operation couldn’t be completed. (WebKitErrorDomain error 101.)" on URL: (null)

2013-09-24 10:28:25:376 Test[39858:c07] DEBUG|SFAuthenticationManager|oauthCoordinator:didFailWithError: Error Domain=WebKitErrorDomain Code=101 "The operation couldn’t be completed. (WebKitErrorDomain error 101.)", authInfo: <SFOAuthInfo: 0x9926520, authType=SFOAuthTypeUserAgent>

I created a Global Action that creates a record for a custom object. It shows up on my mobile correctly. It shows up correctly in chatter on SFDC. The custom objects in question both have Read and Create permissions for the users this issue is affecting. These users can use the chatter action on SFDC but it does NOT show up on the mobile app (latest version = 4.02). It only shows up for System Admins. If there is a specific setting preventing thi from whoing up, please let me know!

Flow saves it's state such that when you hit previous, everything is as it was. However, if you hit next again, even after changing the information, nothing changed (this includes DML ops). There's a solution to this by putting the Create DML into a subflow (with other logic). There is one place I have not found a workaround. Here is my scenario:

 

I have a lookup to account that uses a SSN to search for the account.Id. It's fine the first time; but if you hit previous, change the SSN to be searched, then hit forward again, it will not change anything. The next screens are in their own subflow, and the SSN search is in it's own subflow. I added a "reset" button to the search screen (Javascript + checkbox) in the hopes that going out in the forwards direction and back into the subflow (resetting all the values) would cause the subsequent "next" into the subflow to redo the search.

 

Here's what happens:

 

I put in a SSN that i know belongs to Joe Schmoe, search it sucessfully. But I typed it wrong, and instead wanted to find Jane Doe so I hit previous, hit reset. The thing is fresh and I type Jane Doe's SSN correctly, but when I hit next, Joe Schmoe's information is still there (separate subflow like I said before).

 

If any of you have a solution, please reply. If there is nothing I can do, please let me know that as well. Thanks!

Working on a Rock Paper Scissors game to learn Apex/visualforce with (and to be able to play with other devs on the org). Somewhere in the main body, something is not working right. It is running, that much I know, but somewhere down the line it is not updating the page nor the database as to the result. Here is the VF page:

 

<apex:page showheader="false">
<c:rps ></c:rps>
</apex:page>

 

Here is the Component:

 

<apex:component controller="rps" allowDML="true">
Lets play Rock Paper Scissors!
    <apex:form >
        <apex:selectList id="rps" value="{!input}" size="1" title="Choose Your Weapon">
            <apex:selectOptions value="{!inputSelect}"/>
        </apex:selectList>
        <apex:selectList id="rps2" value="{!partners}" size="1" title="Choose Your Weapon">
            <apex:selectOptions value="{!partner}"/>
        </apex:selectList>
        <apex:commandButton action="{!makeNew}" value="Create Game"/>
        <apex:commandButton action="{!makePlayable}" value="Allow Multiplayer"/>
    </apex:form>
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton value="Play" action="{!processSelected}" rerender="table"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!ListAvailable}" var="a" id="table">
                <apex:column >
                    <apex:inputCheckbox value="{!a.selected}"/>
                </apex:column>
                <apex:column value="{!a.game.Name}" />
            </apex:pageBlockTable>
        </apex:pageBlock>

    </apex:form>
    <apex:outputPanel id="dynamic">
        {!output}<br/>
    </apex:outputPanel>
</apex:component>

 

Here is the controller class:

 

public class rps{
    
    public PageReference makeNew(){
        Asynch_RPS_Game__c a = new Asynch_RPS_Game__c();
        a.move__c = input;
        a.user2__c = partners;
        INSERT a;
        
        return null;
    }
    
    public List<SelectOption> getPartner(){
        List<selectOption> op = new List<selectOption>();
        for(RPS_Save__c rps : [SELECT Name FROM RPS_Save__c WHERE MakePlayable__c = true]){
            op.add(new selectOption(rps.Name,rps.Name));
        }
        System.debug('op: ' + op);
        return op;
    }
    
    //Gives options to click
    public List<SelectOption> getinputSelect(){
        List<selectOption> options = new List<selectOption>();
        options.add(new selectOption('rock','Rock'));
        options.add(new selectOption('paper','Paper'));
        options.add(new selectOption('scissors','Scissors'));
        return options;
    }
    
    public String partners {get;set;}
    public String input {get;set;}
    public String output {get;set;}
    public integer wins {get;set;}
    public integer losses {get;set;}
    public integer ties {get;set;}
    private RPS_Save__c userScore;
    public List<aAsynch_RPS_Game> gamesList {get;set;}
    
    //allows the multiplayer
    public PageReference makePlayable(){
        RPS_Save__c[] userScores = [SELECT id FROM RPS_Save__c WHERE Name=:userInfo.getName()];
        if(userScores.size() > 0){
            userScore = userScores[0];
        } else {
            userScore = new RPS_Save__c(Name = userInfo.getName(), Wins__c = 0, Losses__c = 0, Ties__c = 0);
            INSERT userScore;
        }
        userScore.makePlayable__c = true;
        UPDATE userScore;
        return null;
    }
    
    //Lists games that still need to be finished
    public List<aAsynch_RPS_Game> getListAvailable(){
        if(gamesList == null) {
            gamesList = new List<aAsynch_RPS_Game>();
            for(Asynch_RPS_Game__c a : [SELECT Name, Owner.Name, Move__c, Finished__c FROM Asynch_RPS_Game__c WHERE User2__c =: userInfo.getName()]) {
                if(a.Finished__c == null){
                    gamesList.add(new aAsynch_RPS_Game(a));
                }
          }
        }
        return gamesList;
    }
    
    
    
    //does stuff when you select things
    public PageReference processSelected(){
        system.debug('is this even running?');
        List<Asynch_RPS_Game__c> available = new List<Asynch_RPS_Game__c>();
        for(aAsynch_RPS_Game ggame : getListAvailable()){
            if(ggame.selected == true){
                available.add(ggame.game);
                system.debug('sup from avail.add');
            }
        }
        
        integer l;
        integer w;
        integer t;
        
        RPS_Save__c[] userScores = [SELECT id, Wins__c, Losses__c, Ties__c, Name FROM RPS_Save__c WHERE Name=:userInfo.getName()];
        if(userScores.size() > 0){
            userScore = userScores[0];
          w = integer.valueOf(userScore.Wins__c);
          l = integer.valueOf(userScore.Losses__c);
          t = integer.valueOf(userScore.Ties__c);
        } else {
            userScore = new RPS_Save__c(Name = userInfo.getName(), Wins__c = 0, Losses__c = 0, Ties__c = 0);
            INSERT userScore;
        }
        
        for(Asynch_RPS_Game__c a : available){
          integer comp;
            if(a.move__c == 'rock'){
                comp = 0;
            }else if(a.move__c == 'paper'){
                comp = 1;
            }else{
                comp = 2;}
        
            //check win/loss/tie
          if(comp == 0){
              if(input == 'rock'){
                  output = 'Tie';
                  if(t > 0){
                      t++;
                  }else{
                      t = 1;
                  }
                  return null;
              }else if(input == 'paper'){
                  output = 'Win';
                  if(w > 0){
                      w++;
                  }else{
                        w = 1;
                  }
                  return null;
              }else if(input == 'scissors'){
                  output = 'Lose';
                  if(l > 0){
                      l++;
                  }else{
                      l = 1;
                  }
                  return null;
              }else{
                  output = ' ';
                  return null;
              }
          }else if(comp == 1){
              if(input == 'rock'){
                  output = 'Lose';
                  if(l > 0){
                      l++;
                  }else{
                      l = 1;
                  }
                  return null;
              }else if(input == 'paper'){
                  output = 'Tie';
                  if(t > 0){
                      t++;
                  }else{
                      t = 1;
                  }
                  return null;
              }else if(input == 'scissors'){
                  output = 'Win';
                  if(w > 0){
                      w++;
                  }else{
                        w = 1;
                  }
                  return null;
              }else{
                  output = ' ';
                  return null;
              }
          }else{
              if(input == 'rock'){
                  output = 'Win';
                  if(w > 0){
                        w++;
                  }else{
                      w = 1;
                  }
                  return null;
              }else if(input == 'paper'){
                  output = 'Lose';
                  if(l > 0){
                      l++;
                  }else{
                       l = 1;
                  }
                  return null;
              }else if(input == 'scissors'){
                  output = 'Tie';
                  if(t > 0){
                      t++;
                  }else{
                      t = 1;
                  }
                  return null;
              }else{
                  output = ' ';
                  return null;
              }
            }
            a.Finished__c = System.Today();
            UPDATE a;
        }
        
        userScore.Wins__c = w;
        userScore.Losses__c = l;
        userScore.Ties__c = t;
        userScore.Name = userInfo.getName();
        UPDATE userScore;
        
        available = null;
            return null;
    }
    
        //wrapper class for list
    public class aAsynch_RPS_Game {
        public Asynch_RPS_Game__c game {get; set;}
        public Boolean selected {get; set;}
        
        public aAsynch_RPS_Game(Asynch_RPS_Game__c g){
          game = g;
          selected = false;
        }
    }
}

 

Any help given is greatly appreciated!

Flow saves it's state such that when you hit previous, everything is as it was. However, if you hit next again, even after changing the information, nothing changed (this includes DML ops). There's a solution to this by putting the Create DML into a subflow (with other logic). There is one place I have not found a workaround. Here is my scenario:

 

I have a lookup to account that uses a SSN to search for the account.Id. It's fine the first time; but if you hit previous, change the SSN to be searched, then hit forward again, it will not change anything. The next screens are in their own subflow, and the SSN search is in it's own subflow. I added a "reset" button to the search screen (Javascript + checkbox) in the hopes that going out in the forwards direction and back into the subflow (resetting all the values) would cause the subsequent "next" into the subflow to redo the search.

 

Here's what happens:

 

I put in a SSN that i know belongs to Joe Schmoe, search it sucessfully. But I typed it wrong, and instead wanted to find Jane Doe so I hit previous, hit reset. The thing is fresh and I type Jane Doe's SSN correctly, but when I hit next, Joe Schmoe's information is still there (separate subflow like I said before).

 

If any of you have a solution, please reply. If there is nothing I can do, please let me know that as well. Thanks!

I have a flow which gives the user the option to modify an existing record. I'm having difficulty figuring out the best way to do this.

 

What I'd like is to have the flow do the record lookup and then on a screen display fields from that record and allow the user to modify those fields. So I'd have a Screen element with the appropriate fields (textbox, currency, checkbox, dropdown, etc.). The current values would be displayed and the user could make changes to those values.

 

I can't figure out how to do this, or if it's even possible.

 

What I'm doing right now is using a Display Text field to simply display the current values to the user. And then I have all of the fields needed under that display text. But there's no way that I can figure out to display the existing values as the default in each of the (choice) fields. So they basically have to go through each of the fields and re-populate them which is way less than ideal and prone to mistakes. For example, the display text would show their mailing address, but then they'd have to re-enter that address in the mailing address field.

 

While the fields allow for a default, it seems like they have to be one of the choices. And it doesn't look like the choices themselves can have a variable as a default value.

 

Am I missing something or is there a better approach to what I'm doing?

 

Thanks.