• chris thomas 65
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
If you are a music lover but haven’t found a good music app, download Spotify Premium AP (https://gbplus.org/spotify-premium-apk/)K (MOD Unlocked) now.
  • September 01, 2021
  • Like
  • 1
Hi All,

I am tring to authorize an org on visual studio code but when I am trying authorize it, I am getting the below error.

SFDX: Authorize an Org failed to run
Try this:
Kill the process running on port 1717 or use a custom connected app and update OauthLocalPort in the sfdx-project.json file.
19:31:13.241 sfdx force:auth:web:login --setalias VSCodePlayground --instanceurl https://login.salesforce.com --setdefaultusername ended with exit code 1

I have Killed the Process on port 1717 and tried it again then I am not getting any error but it is running for infinite time. 

Please help.

Thanks,
Parteek
Hi -- 
I am receiving this error: Invalid field Restaurant__ID__c for SObject Account

Here is a partial copy of the critical lines of code in my controller:

 public ObjectStructureMap[] formatObjectStructure( String currentId ){
    
        List<ObjectStructureMap> asm = new List<ObjectStructureMap>{};
        masm.clear();

        //Change below
        List<Account> al            = new List<Account>{};
        List<ID> currentParent      = new List<ID>{};
        Map<ID, String> nodeList    = new Map<ID, String>{};
        List<String> nodeSortList   = new List<String>{};
        List<Boolean> levelFlag     = new List<Boolean>{};
        List<Boolean> closeFlag     = new List<Boolean>{};
        String nodeId               = '0';
        String nodeType             = 'child';
        Integer count               = 0;
        Integer level               = 0;
        Boolean endOfStructure      = false;
        
        //Find highest level obejct in the structure
        currentParent.add( GetTopElement( currentId ) );

        //Loop though all children
        while ( !endOfStructure ){

            if( level == 0 ){
                //Change below     
                al = [ SELECT a.Type, a.Site, a.ParentId, a.OwnerId,a.Restaurant_ID__c,a.Name,a.Deck_Rank__c, a.Market_Area__c,a.Lead_List__c,a.Phone,a.GPV_30_days__c,a.LastActivityDate,a.Account_Type__c,a.Lead_Type__c,a.Owner.Alias, a.Id FROM Account a WHERE a.id IN : CurrentParent ORDER BY a.Name ];
            } 
            else {
                //Change below      
                al = [ SELECT a.Type, a.Site, a.ParentId, a.OwnerId,  a.Restaurant_ID__c,a.Name,a.Deck_Rank__c, a.Market_Area__c,a.Lead_List__c,a.Phone,a.GPV_30_days__c,a.LastActivityDate,a.Account_Type__c,a.Lead_Type__c,a.Owner.Alias, a.Id FROM Account a WHERE a.ParentID IN : CurrentParent ORDER BY a.Name ];
            }

            if( al.size() == 0 ){
                endOfStructure = true;
            }
            else{
                currentParent.clear();
                for ( Integer i = 0 ; i < al.size(); i++ ){
                    //Change below
                    Account a = al[i];
                    nodeId = ( level > 0 ) ? NodeList.get( a.ParentId )+'.'+String.valueOf( i ) : String.valueOf( i );
                    masm.put( NodeID, new ObjectStructureMap( nodeID, levelFlag, closeFlag, nodeType, false, false, a ) );
                    currentParent.add( a.id );
                    nodeList.put( a.id,nodeId );
                    nodeSortList.add( nodeId );
                }
                
                maxLevel.add( level );                
                level++;
            }
        }
        
        //Account structure must now be formatted
        NodeSortList.sort();
        for( Integer i = 0; i < NodeSortList.size(); i++ ){
            List<String> pnl = new List<String> {};
            List<String> cnl = new List<String> {};
            List<String> nnl = new List<String> {};
            
            if ( i > 0 ){
                String pn     = NodeSortList[i-1];
                pnl         = pn.split( '\\.', -1 );
            }

            String cn     = NodeSortList[i];
            cnl         = cn.split( '\\.', -1 );

            if( i < NodeSortList.size()-1 ){
                String nn = NodeSortList[i+1];
                nnl = nn.split( '\\.', -1 );
            }
            
            ObjectStructureMap tasm = masm.get( cn );
            if ( cnl.size() < nnl.size() ){
                //Parent
                tasm.nodeType = ( isLastNode( cnl ) ) ? 'parent_end' : 'parent';
            }
            else if( cnl.size() > nnl.size() ){
                tasm.nodeType     = 'child_end';
                tasm.closeFlag     = setcloseFlag( cnl, nnl, tasm.nodeType );
            }
            else{
                tasm.nodeType = 'child';
            }
            
            tasm.levelFlag = setlevelFlag( cnl, tasm.nodeType ); 
            
            //Change below
            if ( tasm.account.id == currentId ) {
                tasm.currentNode = true;
            }
            asm.add( tasm );
        }
        
        asm[0].nodeType             = 'start';
        asm[asm.size()-1].nodeType     = 'end';
        
        return asm;
    }
    

and here is the relevant chunk of my visualforce page:

  <apex:outputLink value="/{!pos.account.id}" style="{!IF(pos.currentNode,'font-weight: bold;','')}" styleClass="columnHeadActiveBlack" target="_top">{!pos.account.name}</apex:outputLink>

<!-- Include the following if you uses sites with accounts -->
            <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.account.Restaurant__ID__c}"/>
            <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.account.Deck_Rank__c}"rendered="{!IF(pos.account.Deck_Rank__c!= '', true, false)}"/>
            <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.account.Lead_List__c}" rendered="{!IF(pos.Lead_List__c!= '', true, false)}"/>
            <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.Phone}" rendered="{!IF(pos.Phone!= '', true, false)}"/>
            <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.GPV_30_days__c}" rendered="{!IF(pos.GPV_30_days__c!= '', true, false)}"/>
            <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.LastActivityDate}" rendered="{!IF(pos.LastActivityDate!= '', true, false)}"/>
            <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.Account_Type__c}" rendered="{!IF(pos.Account_Type__c!= '', true, false)}"/>
            <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.Lead_Type__c}" rendered="{!IF(pos.Lead_Type__c!= '', true, false)}"/>
            <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.Owner.Alias}" rendered="{!IF(pos.Owner.Alias!= '', true, false)}"/>&nbsp;
<!-- Stop -->
            </span>
            <div> </div>
            <apex:outputText rendered="{!IF(OR(pos.nodeType=='child_end',pos.nodeType=='child'),false,true)}">
                <div id='{!pos.nodeId}'>
            </apex:outputText>
            <apex:outputText rendered="{!IF(OR(pos.nodeType=='child_end',pos.nodeType=='child'),true,false)}">
                <div id='{!pos.nodeId}'><apex:image url="/s.gif" alt="" width="1" height="1"/></div>
            </apex:outputText>
            <apex:repeat value="{!pos.closeFlag}" var="close">
                </div>
            </apex:repeat>            


Can someone help me here?
I am a board member of the company and we are trying to raise funds. 
It seems that a simple GA event should be able to generate a sequencial number that could be used for a "raffle " ticket. 
Does anyone have any experience with this, or know of a way that we can set this up?
Thank you
Deb