• Arut Jothi
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies
Does Salesforce security review reject a package/ lightning component if the following are used in lightning component code?
(a) let keyword, instead of var
(b) JS fat arrow (=>) within the controller/ helper functions (this is esp. useful for cleaner coding when used with .then or .catch contructs)
(c) JS functional programming contructs such as array.map(), array.forEach(), array.filter() etc.

I've used this in my component and it works fine, but PMD check throws an error. While I was able to confirm that PMD check throws an error because it might not have JS rules defined to specifically check for 'let' keyword and it views them defined as without 'var'. Eventually, it considers them as global variable while they aren't (they are local scoped and initialized with 'let'). Salesforce documentation doesn't specifically indicate whether these can be used or not , esp. with regards to security review of the package.

I did see Salesforce using let keywords in the Salesforce Inspector code which tells me that they might allow but not sure.

Does anyone know if this could cause security review failure??
I have a COMPONENT event that I'm registering in a child component and handling it in the parent component i.e., 
(a) Child Component registers the event and fires it upon a button click.
(b) Parent Component has a handler defined for the same event and executes when the child fires the event. 
I'm displaying the child component using lightning:overlay as modal dialog. The parent component uses $A.createComponent to instantiate the child component and passes it to the lightning:overlay. As per the salesforce documentation (given here: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_component_bubbling.htm), my parent component is the owner of the child component and should be able to handle the event.

"For programmatically created components, the owner component is the component that invoked $A.createComponent to create it."

However, the handler never seems to get invoked. Any idea why?

I've verified that there is no syntax or typo mistakes in my code or markup and the same code works find as long as there is not modal dialog. But, as soon as I launch the child component thru modal, the event handling fails.
1) What are some of scenarios where $A.getCallback can be used other than using setTimeout function??
2) Does it make sense to place $A.getCallback inside a Promise constructor while calling a server side controller action? For example, see below
     return new Promise($A.getCallback(function(resolve, reject){
         // Implement the code logic here to call a server side controller
     }));
What is the best way to effectively migrate user before using ANT to migrate the entire org?
Consider the following scenario:
(a) In my current Org, there are roughly 70+ users, with some of them having account based partner profile. So, unless I have accounts moved and have them enabled as partner account, I cannot have those specific profiles migrated (due to dependency issues).
(b) Lot of flows have references to users and groups and hence, I cannot migrate flows (without editing their XML to replace the users references with admin user or standard partner user). 
(c) In addition to the above, some of the code (VF Pages, Lightning components) have references to the flow and hence, flow and code migration has to happen together. Otherwise, I'm looking at endless ending of the retrieved files and manually deleting or replacing the dependencies.

You can see there would be circular dependency issue with users vs all other in migrating this org. So, I'm wondering what is the most efficient way to migrate such an org. 

Don't ask me how I got into migrating such as org. It was already there built by lof ot people and I'm now trying to create a copy (whilst cleaning it up).
When creating a lighting action (with action type as Custom Visualforce or Lightning Component), there is no provision to specify the width (of the modal pop-up). While this can be achived by including custom CSS to the class 'slds-modal__container', I'm not sure if that's the right way to go. Im assuming here that Salesforce or Lightning platform first defines width of the modal pop-up and then resizes contents within according the to the outer HTML element width. If we apply custom CSS, then it will most possibly act on the Outer HTML but not on all of the inner content. is my assumption correct? If yes, then what is the right way to achieve modifying the modal pop-up width?
How does Salesforce platform isolate the unit test data from org data (esp. when we have same the object in both org as well as test)??
Map values are not guaranteed to be unique (but their keys are) and this implies that (unlike Set) maps may contain duplicates. However, will a map of SObject ever have duplicates??

Consider map<Id, SObject> and let us assume that this map collection is obtained from a trigger context variable (such as newMap or oldMap). For example, let us take the example of a trigger over Account object: 
Map<Id, Account> accountMap = trigger.newMap;

Now let us further make an assumption that it was really a bulk trigger and there were roughly greater than 50 records. Specifically, containing two updates over the same record. Now, when the trigger context variables are populated by the salesforce platform, how does it handle these duplicate records (or 2 instances of same record)? Per my understanding is that Map keyset is guaranteed to be unique.
Does Salesforce security review reject a package/ lightning component if the following are used in lightning component code?
(a) let keyword, instead of var
(b) JS fat arrow (=>) within the controller/ helper functions (this is esp. useful for cleaner coding when used with .then or .catch contructs)
(c) JS functional programming contructs such as array.map(), array.forEach(), array.filter() etc.

I've used this in my component and it works fine, but PMD check throws an error. While I was able to confirm that PMD check throws an error because it might not have JS rules defined to specifically check for 'let' keyword and it views them defined as without 'var'. Eventually, it considers them as global variable while they aren't (they are local scoped and initialized with 'let'). Salesforce documentation doesn't specifically indicate whether these can be used or not , esp. with regards to security review of the package.

I did see Salesforce using let keywords in the Salesforce Inspector code which tells me that they might allow but not sure.

Does anyone know if this could cause security review failure??
I have a COMPONENT event that I'm registering in a child component and handling it in the parent component i.e., 
(a) Child Component registers the event and fires it upon a button click.
(b) Parent Component has a handler defined for the same event and executes when the child fires the event. 
I'm displaying the child component using lightning:overlay as modal dialog. The parent component uses $A.createComponent to instantiate the child component and passes it to the lightning:overlay. As per the salesforce documentation (given here: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_component_bubbling.htm), my parent component is the owner of the child component and should be able to handle the event.

"For programmatically created components, the owner component is the component that invoked $A.createComponent to create it."

However, the handler never seems to get invoked. Any idea why?

I've verified that there is no syntax or typo mistakes in my code or markup and the same code works find as long as there is not modal dialog. But, as soon as I launch the child component thru modal, the event handling fails.
1) What are some of scenarios where $A.getCallback can be used other than using setTimeout function??
2) Does it make sense to place $A.getCallback inside a Promise constructor while calling a server side controller action? For example, see below
     return new Promise($A.getCallback(function(resolve, reject){
         // Implement the code logic here to call a server side controller
     }));
When creating a lighting action (with action type as Custom Visualforce or Lightning Component), there is no provision to specify the width (of the modal pop-up). While this can be achived by including custom CSS to the class 'slds-modal__container', I'm not sure if that's the right way to go. Im assuming here that Salesforce or Lightning platform first defines width of the modal pop-up and then resizes contents within according the to the outer HTML element width. If we apply custom CSS, then it will most possibly act on the Outer HTML but not on all of the inner content. is my assumption correct? If yes, then what is the right way to achieve modifying the modal pop-up width?
How does Salesforce platform isolate the unit test data from org data (esp. when we have same the object in both org as well as test)??