• Adelchi Pelizzo
  • NEWBIE
  • 95 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 29
    Questions
  • 49
    Replies
Custom button displays a lightning component for record edit. 
 
Note: Custom button displays a modal for record edit. 

Inside a lightning component, I make an API call to "/services/data/v46.0/sobjects/ ..."

Lightning requires authorization even if the call is done internally. (Sounds weird to me).

I want to have this OAuth process run silewntly in the back ground.

 

<!--            <ui:scrollerWrapper  class="scroll" >-->
    <aura:iteration items="{!v.commentsData}" var="comment" indexVar="key">
        <lightning:card class="{!comment.Color == 'grey' ? 'grey' : 'blue'}" aura:id="{!comment.Color}+{!key}">
            {!comment.text}
        </lightning:card>
    </aura:iteration>
    <!--    </ui:scrollerWrapper>-->
If ui:scrollerWrapper is uncommented, the class in card element does not work.
 
If third party cookies are disabled in Chrome, the central panel does not show?User-added image
No output returned after scratch org has been created using Jenkinsfile:
 
stage('Create Scratch Org') {
            rmsg = bat returnStdout: true, script: "${toolbelt} sfdx force:org:create --definitionfile config/project-scratch-def.json --json --setdefaultusername"
           // rmsg is: null
            println("Returned>>" + printf(rmsg))
           // log : Returned >> null
            printf rmsg
            def jsonSlurper = new JsonSlurperClassic()
            def robj = jsonSlurper.parseText(rmsg)
            if (robj.status != "ok") { error 'org creation failed: ' + robj.message }
            SFDC_USERNAME=robj.result.username
            robj = null

        }

The scratch org is created ok.

Thank you for any comment.
Adelchi
After submitting my challenge, I get this error:
 
Challenge Not yet complete... here's what's wrong: 
The ProjectRESTService class did not achieve at least 90% code coverage via your test methods. Make sure that you chose 'Run All' tests in the Developer Console at least once before attempting to verify this challenge.

While the Code Coverage shown in Dev Console is 94% and lines covered 16/17 .

Please help.
public class CaseListCtrl {
    public String s1 {get;set;}
    public String s2 {get;set;}
    public String s3 {get;set;}
    public String s4 {get;set;}
    public String s5 {get;set;}
    public String s6 {get;set;}
    public String s7 {get;set;}
    
    /*List<Case> caseList = [SELECT Id, Labels2__c FROM Case Limit 20];
    
    ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(caseList);*/
    
    private final Case c;
    
    public CaseListCtrl(ApexPages.StandardSetController controller) {
        this.c = (Case)controller.getRecord();
    }
    
    public List <Case> getCases(){
        return [SELECT Id, Labels2__c FROM  Case];
    }
    
    public List<Case> caseRecords {
        get {
            return [SELECT Id, Labels2__c FROM Case];
        }
        private set;
    }
    
    /*public List<Case> getCaseListCtrl() {
        return (List<Case>) caseRecords.getRecords();
    }*/
    
    Public ApexPages.Action getIt(){
        List<List<String>> lstS = new List<List<String>>();
        String[] setS = new List<String>();
        for (integer i = 0; i < 20; i++){
            Case cR = caseRecords[i];
        	lstS.add(cr.Labels2__c.split(';'));
        }
        if (lstS != null){
            for (integer i = 1; i < lstS.size(); i++){
                s1 = lstS.get(i)[0];
                s2 = lstS.get(i)[1];
                s1 = lstS.get(i)[2];
                s2 = lstS.get(i)[3];
                s1 = lstS.get(i)[4];
                s2 = lstS.get(i)[5];
                s1 = lstS.get(i)[6];
                s2 = lstS.get(i)[7];
            }
        }
		return null;
    }
}
<apex:page standardController="Case" recordSetVar="cases" sidebar="true" standardstylesheets="false" showheader="true" extensions="CaseListCtrl" action="{!getIt}">
<apex:form >
    {!s1}
    {!s2}
    {!s3}
    {!s4}
    {!s5}
    {!s6}
    {!s7}

</apex:form>
</apex:page>

My intent is to grab values from a multi-picklist field "labels2__c" and display it as a single value in a visualforce page.

This is the error: 

 

System.NullPointerException: Attempt to de-reference a null object
Error is in expression '{!getIt}' in component <apex:page> in page testctrlcase: Class.CaseListCtrl.getIt: line 40, column 1
Class.CaseListCtrl.getIt: line 40, column 1

Thanks,
Adelchi

I am trying to generate Enterprise WSDL file, it hangs and I get this and NOT the file:

User-added image
I want to show two fields value in a flow screen, but at the moment it gives me null. I use an Invocable method to retrieve a json file, indetify and store only those two values in a subclass containing two invocablevariable. After executing it in dev console, I can print out in system.debug at line 21 and 26 but not at line 33.
 
global class par{
@InvocableMethod(label='Get Map' description='Returns the values of Maps')
    global static List<adel.par.VarWrap> CallMap(){
        List<adel.par.VarWrap> wraps = new List<adel.par.VarWrap>();
        HttpRequest req = new HttpRequest();
        req.setEndpoint('https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=AIzaSyBOyIQi54LMykmzSOvCuQ2naVvVQEsEfHw');
        req.setMethod('GET');
        Http http = new Http();
        HTTPResponse res = http.send(req);
        JSONParser parser = JSON.createParser(res.getBody());
        while (parser.nextToken()!= null)
        {  
            adel.par.VarWrap wrap = new adel.par.VarWrap();
            if (parser.getCurrentToken() == JSONToken.FIELD_NAME)
             {
                string fieldName = parser.getText();
                parser.nextToken();
                if(fieldName == 'place_id')
                {
                    wrap.placeRet = parser.getText();
                    system.debug(wrap.placeRet);
                    parser.nextToken();
                }else if(fieldName == 'status')
                    {
                    wrap.statusRet = parser.getText();
                    system.debug(wrap.statusRet);
                    }
                    
            }
            wraps.add(wrap);
        }
        
        system.debug(wraps);
        return wraps;  
    }
    global class VarWrap{
        @InvocableVariable(label='Place')
        public String placeRet;
        @InvocableVariable(label='Status')
        public String statusRet;       
    } 
}
I understand InvocableMethods can return only lists. It would work if the sObject VarWrap contained only one field value.
 
I am getting this error: The number of results does not match the number of interviews that were executed in a single bulk execution request.
Here is the apex class I am using, I want to store list<string> data from a json file into a flow variable:
global class par{

    global static List<string> l = new list<string>();
    
@InvocableMethod(label='Get Map' description='Returns the values of Maps')
    global static List<String> CallMap(){
        HttpRequest req = new HttpRequest();
        req.setEndpoint('https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=AIzaSyBOyIQi54LMykmzSOvCuQ2naVvVQEsEfHw');
        req.setMethod('GET');
        Http http = new Http();
        HTTPResponse res = http.send(req);
        JSONParser parser = JSON.createParser(res.getBody());
        while (parser.nextToken()!= null)
        {
            if ((parser.getCurrentToken() == JSONToken.FIELD_NAME))
            {
                    string fieldName = parser.getText();
                    parser.nextToken();
                if(fieldName == 'place_id')
                {
                    string place = parser.getText();
                    system.debug(place);
                    l.add(place);
                	parser.nextToken();
                }else if(fieldName == 'status')
                	{
                    string status = parser.getText();
                    system.debug(status);
                    l.add(status);
                    }
        	}
    	}
        return l;
    }
}



 

 
Is string unsupported for @InvocableMethod ?
I cannot find any doc about this.

User-added image
In the instruction there is a phrase I do not understand: It beats sliced bread hands down! Can you use English language to explain this?
Thanks.........
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: OVSPKDKP

https://developer.salesforce.com/trailhead/lightning_components/lightning_components_expressions
I am trying to get a handle on this Ajax Toolkit.

I am referring to this example https://developer.salesforce.com/docs/atlas.en-us.ajax.meta/ajax/sforce_api_ajax_vf_sample.htm 
I do not understand where GETSESSIONID() is coming from here, can someone point me in the right direction?
 
<apex:page >
    <script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>

 
global class getipController {


    global static String ipAddress {get; set;}
    
    global InfoForm__c  Info = new InfoForm__c();
    
    
    global getipController(ApexPages.StandardController controller) {
    
        this.Info = (InfoForm__c)controller.getRecord();
        
        ipAddress = ApexPages.currentPage().getHeaders().get('X-Salesforce-SIP');
        
        Info.Ip__c = IpAddress;


    }
 }
I am struggling to make sense with testing this visualforce controller extension. Any help to build a test clas will be very much appreaciated.
Thank you.
Seems that Salesforce uses a default "Under Construction" VisualForce page. This page is displayed when a specific page isn't available from Site.com. I want to customize this page OR assing a different one when user wants to load an no-existing page. I have found a page called "Under Construction" and tried to eliminate most part of it, but the final result remain unchanged.
Seems that Salesforce uses a default "Under Construction" VisualForce page.
This page is displayed when a specific page isn't available from Site.com.
I want to customize this page OR assing a different one when user wants to load an no-existing page.
I have found a page called "Under Construction" and tried to eliminate most part of it, but the final result remain unchanged.
I would like to create a validation rule to check if one specific field is checked together with others group of fields: If field A is checked and any other fields of group B or C are empty. If I use the following formula it says: a parthesis is missing.
AND
(
	( Web_Application_Security_Checkup__c = true),
	(OR
		(OR
			(
					
				X1_Web_Application_IP__c = "",
				ISPICKVAL(X1_Technology__c , ""),
				ISPICKVAL(X1_Would_Test_Account_be_Provided__c, ""),
				(ISBLANK(Number_of_Web_Application_and_Servers__c)),
				(ISBLANK(X1_URL_of_Application__c))
			)	
		),
		(OR
			(	
				X2_Web_Application_IP__c = "",
				ISPICKVAL(X2_Technology__c , ""),
				ISPICKVAL(X2_Would_Test_Account_be_Provided__c, ""),
				(ISBLANK(Number_of_Web_Application_and_Servers__c)),
				(ISBLANK(X2_URL_of_Application__c)) 
			)	
		)	
	)
			
)

 
I would like to show or hide different <apex:pageblocksection>'s depending if a checkbox is selected or not.
I am thinking to use <apex:actionSupport> to add a listener functionality to the <apex:inputfield>  checkbox.
So when the box gets ticked the "onchange" attribute will trigger a java script:
<script type="text/javascript">;
    function ShowSection() {
         document.getElementById("pageid:formid:pageblockId").style.display ='block';
    }
</script>
I have got stuck here, can anybody point me in the right direction please?
Thanks
I'm (very) new to Salesforce. I'm using it with a nonprofit. We don't have Leads (most common example I found online), we have Members. My Setup does not have a Build > Leads(Members) > Fields option. I can see something similar to what other users have described by going to Platform Tools > Objects and Fields > Picklist Value Sets (or going through Object Manager to Fields & Relationships). Both lead me to the picklist I want.

I created a new picklist. It did not have an option to select which record types to apply to, but did have a box to apply to all record types. I selected it. Saved and applied. Still doesn't show for any member in that picklist category.

My picklist still doesn't show. I have set it as the default value and unset it. Neither works. 

Any other suggestions?
<!--            <ui:scrollerWrapper  class="scroll" >-->
    <aura:iteration items="{!v.commentsData}" var="comment" indexVar="key">
        <lightning:card class="{!comment.Color == 'grey' ? 'grey' : 'blue'}" aura:id="{!comment.Color}+{!key}">
            {!comment.text}
        </lightning:card>
    </aura:iteration>
    <!--    </ui:scrollerWrapper>-->
If ui:scrollerWrapper is uncommented, the class in card element does not work.
 
If third party cookies are disabled in Chrome, the central panel does not show?User-added image
How we can write test class for folowing lines


f(ISstarrating != '' && ISstarrating == 'StarOptions')
                    {
                        component.Apex.selectRadio theselectlist = new Component.Apex.selectradio();
                        //component.Apex.selectlist theselectlist = new Component.Apex.selectlist();
                        theselectlist.expressions.value = '{!lstLeadGenFollowup['+counter+'].VW_Answer1__c}';
                        theselectlist.id = 'Answer_'+counter;
                        theselectlist.styleClass = 'Answer_'+counter;
                        //theselectlist.size = 1;
                        
                       // AddSelectOption(theselectlist, '', '--None--');
                        for(string s : lstStrSelectOpps)
                        {
                            AddSelectRadioOption(theselectlist, s, s);
                        }
                        fieldDiv.styleClass = 'fieldSubDiv star-rating';
                        fieldDiv.childComponents.add(theselectlist);
                    }


Regards
Pranav Shah
No output returned after scratch org has been created using Jenkinsfile:
 
stage('Create Scratch Org') {
            rmsg = bat returnStdout: true, script: "${toolbelt} sfdx force:org:create --definitionfile config/project-scratch-def.json --json --setdefaultusername"
           // rmsg is: null
            println("Returned>>" + printf(rmsg))
           // log : Returned >> null
            printf rmsg
            def jsonSlurper = new JsonSlurperClassic()
            def robj = jsonSlurper.parseText(rmsg)
            if (robj.status != "ok") { error 'org creation failed: ' + robj.message }
            SFDC_USERNAME=robj.result.username
            robj = null

        }

The scratch org is created ok.

Thank you for any comment.
Adelchi
I can't find Dev Hub in my org's Setup search.
Hi

I am working on Communities, where I wanted to replace the Salesforce Standard title tag's text: Home with my custom text. 
I have made changes to "Head Markup" from Advanced settings in Community Builder by adding title tag with Custom text, but even, I am getting Home as Browser's tab.

I can see, the tab loads with my custom text, but after completion of the loading, it is changing back to Home text.
Where can I remove or change preference to not to use this Head title?

Please respond to me with even a question, that way I can move forward with my progress.

Thanks
I'm noticing when I use the Lightning Design System it's tacking on a aura class and a 'data-aura-rendered-by' attribute. What does this do?

Thanks.

These links have dissapeared overnight....
I cannot find any new links, only PDF downloads.

http://www.salesforce.com/us/developer/docs/apexcode/

http://www.salesforce.com/us/developer/docs/pages/index.htm

Does anyone else use the HTML Guides?
Or do you use the PDF Downloadable Guides?
If you use the PDF guides, why do you prefer them?
I have preferred the HTML due to the search returning more relevant results. But maybe I could use the PDF search better?