• Gonzalo Quevedo 15
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Salesforce technical consultant

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hi!, 

I'm populating a configuration picklist using DynamicPickList class in lightning component app builder page, but it seems that getDefaultValue() method is not working. I even copied/pasted Salesforce example and it didn`t work either! :(

This is salesforce example: (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_VisualEditor_DynamicPickList.htm#apex_class_VisualEditor_DynamicPickList)
global class MyCustomPickList extends VisualEditor.DynamicPickList{
    
    global override VisualEditor.DataRow getDefaultValue(){
        VisualEditor.DataRow defaultValue = new VisualEditor.DataRow('red', 'RED');
        return defaultValue;
    }
    global override VisualEditor.DynamicPickListRows getValues() {
        VisualEditor.DataRow value1 = new VisualEditor.DataRow('red', 'RED');
        VisualEditor.DataRow value2 = new VisualEditor.DataRow('yellow', 'YELLOW');
        VisualEditor.DynamicPickListRows  myValues = new VisualEditor.DynamicPickListRows();
        myValues.addRow(value1);
        myValues.addRow(value2);
        return myValues;
    }
}

And this is the picklist output in lightning app builder:
User-added image

User-added image

Anyone is having the same issue? Is something that I missed here?

Thanks!









 
Hi!

I am working in a lighning component. This component will be displayed in lightning app builder interface, so users will be able to put it in ANY object record page.

I use some attributes (for component configuration) in the design file. Some of them are picklist that I populate in an apex class. This picklist values should change depending on the object that use my component. Is there any way to know in which object the component is running? I know I can use {!v.objectName}  in component markup but I don't know if is possible to do something similar at design file or the apex class that I use to show my custom picklist values for my picklist attribute.

Thanks! :)
Hi!, 

Salesforce is encountering problems parsing XML response from a WS, all indicates that is a problem with something relative to namespace. Response looks like:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header />
   <soapenv:Body>
      <p788:altaCuentaResponse xmlns:p788="http://urlgoeshere">
         <altaCuentaReturn>
            <codigoError>2001</codigoError>
            <mensajeError>error.</mensajeError>
            <resultadoOperacion>ERROR</resultadoOperacion>
            <codigoCuenta xsi:nil="true" />
         </altaCuentaReturn>
      </p788:altaCuentaResponse>
   </soapenv:Body>
</soapenv:Envelope>

Salesforce can't parse this strange prefix "788" .

Is there any way to modify wsdl2apex generated class to solve this problem?  Any idea? I've tried to import wsdl using fuse app and I'm able to parse response body but I think it's not the best solution. 

Thank you!



 
Hi!, 

I'm populating a configuration picklist using DynamicPickList class in lightning component app builder page, but it seems that getDefaultValue() method is not working. I even copied/pasted Salesforce example and it didn`t work either! :(

This is salesforce example: (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_VisualEditor_DynamicPickList.htm#apex_class_VisualEditor_DynamicPickList)
global class MyCustomPickList extends VisualEditor.DynamicPickList{
    
    global override VisualEditor.DataRow getDefaultValue(){
        VisualEditor.DataRow defaultValue = new VisualEditor.DataRow('red', 'RED');
        return defaultValue;
    }
    global override VisualEditor.DynamicPickListRows getValues() {
        VisualEditor.DataRow value1 = new VisualEditor.DataRow('red', 'RED');
        VisualEditor.DataRow value2 = new VisualEditor.DataRow('yellow', 'YELLOW');
        VisualEditor.DynamicPickListRows  myValues = new VisualEditor.DynamicPickListRows();
        myValues.addRow(value1);
        myValues.addRow(value2);
        return myValues;
    }
}

And this is the picklist output in lightning app builder:
User-added image

User-added image

Anyone is having the same issue? Is something that I missed here?

Thanks!









 
Hi!

I am working in a lighning component. This component will be displayed in lightning app builder interface, so users will be able to put it in ANY object record page.

I use some attributes (for component configuration) in the design file. Some of them are picklist that I populate in an apex class. This picklist values should change depending on the object that use my component. Is there any way to know in which object the component is running? I know I can use {!v.objectName}  in component markup but I don't know if is possible to do something similar at design file or the apex class that I use to show my custom picklist values for my picklist attribute.

Thanks! :)
Hi!

I am working in a lighning component. This component will be displayed in lightning app builder interface, so users will be able to put it in ANY object record page.

I use some attributes (for component configuration) in the design file. Some of them are picklist that I populate in an apex class. This picklist values should change depending on the object that use my component. Is there any way to know in which object the component is running? I know I can use {!v.objectName}  in component markup but I don't know if is possible to do something similar at design file or the apex class that I use to show my custom picklist values for my picklist attribute.

Thanks! :)