• Daniel Retaleato
  • NEWBIE
  • 20 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 3
    Replies
I'm running into a problem where my APEX code is firing too many API calls in the span of 100ms, so simply, is there a way to delay the code from firing for 101ms. 

As I understand there may be a few 'Bad Code' workarounds such as home brew sleep methods and running for loops until certain conditions have been met, but I would rather avoid these for obvoius reasons.

Thanks for any advice!
Hey all!

Basically, I have a component that displays different information depending on which App the user is currently in. For some reason, we have one user that returns an incorrect AppName 100% of the time.

For some reason this user always gets 'Sales' as an AppName, no matter what App they use.

The issue is only with this one user and only in production.

Anybody have any ideas why this may be happening? 


This is the code that I've been using to get the current App name:
UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId = :UserInfo.getUserId() LIMIT 1];

AppDefinition appDefinition = [SELECT DurableId, Label FROM AppDefinition Where DurableId = :userAppInfo.AppDefinitionId LIMIT 1];

return appDefinition.Label;
Hey all!

So I have a field called 'MSE Department' which is a Lookup to another object, but when I include this field in a field set it defaults to a basic text input field instead of a lookup search box.

Is there anyway to change this to a lookup?
Thanks!
So I'm working on a legacy file at my new job and I'm getting this error:
Custom Script Eval error in the resource loaded using 'ltng:require' [[object Event]]
when a custom aura application is loaded for the first time. As I'm rooting around in the files, I came across this chunk of code:
<ltng:require 
    styles="{!join(',', 
    $Resource.bootstrap411 + '/css/bootstrap.min.css', 
    $Resource.bootstrapjqueryui, 
    $Resource.bootstrap411 + '/css/bootstrap-reboot.min.css',
    $Resource.datatables + '/datatables.min.css')}"
    scripts="{!join(',', 
    $Resource.jquery224, $Resource.bootstrap411 + '/js/bootstrap.min.js',
    $Resource.jqueryui + '/jquery-ui.min.js',
    $Resource.datatables + '/datatables.min.js',
    $Resource.moment)}"
    afterScriptsLoaded="{!c.scriptsLoaded}" />
which is what I'm assuming is throwing the error.
After changing the version of $Resource.jquery224 to $Resource.jquery340, I now get
Custom Script Eval error in the resource loaded using 'ltng:require' [SecureDOMEvent: [object Event]{ key: {"namespace":"c"} }]
Can anyone provide any insight as to why I might be getting these errors?
Thanks in advance
 
Hi all!

When I use force:navigateToURL, it opens the URL in a new tab. Is there anyway to force this to open in a new browser window instead?
Thanks in advance, code pictured below
var urlEvent = $A.get("e.force:navigateToURL");
 urlEvent.setParams({
            "url": "https://xxxxxx.pss.koresoftware.com/sfdc/ticketing/Activity/PhoneCallSave.aspx"
        });
 urlEvent.fire();

 
When I add "Billing Street" to a field set it displays 2 separate input boxes both labeled "Billing Street". One is a text input field and the other is text input box.

User-added image

Additionally, when I go to type anything in either box I receive this error message:
Uncaught Action failed: c:Form$controller$bindValue [input.get is not a function]
bindValue()@https://mse--qa.lightning.force.com/lightning/o/Account/components/c/Form.js:33:27
I need to get the name of the current app in the controller. So far I'm trying:
public static String getAppName() {
         UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId = :UserInfo.getUserId() LIMIT 1];
        AppDefinition appDefinition = [SELECT DurableId, Label FROM AppDefinition Where DurableId = :userAppInfo.AppDefinitionId LIMIT 1];
       return appDefinition.Label;
    }
But Im getting 3 errors:

Line 1: No such column 'AppDefinitionId' on entity 'UserAppInfo'
Line 2: Invalid type: AppDefinition
Line 3: Variable does not exist: appDefinition

Can anyone provide some insight as to what I may be doing wrong? Thanks!
I'm relatively new to Salesforce development and I'm wondering if someone would be able to provide some insight to a dilemma I'm having.

Backstory: 
I currently have one component that is used to add a contact to an account. On load, the component tests for a user's ProfileID and displays only relevant information to that department (not every department in my org needs to add a contact birthday for example).

My director would like me to create separate components for each profile so that as a system admin, he can have control while I'm out of town (I'm the only dev), and so that he can have an additional layer of customization over who sees what.

So my question is, is this a valid request? Are there any reasons this would be unfeasible or have any legitimate reasons not to do it this way moving forward?
Obviously creating 4-5 components for each profile would be more work on me (which I'm not worried about), I'm moreso worried that having 4-5 components would take up system storage and create unnecessary clutter.

Thanks in advance for any insight.
I need to get the name of the current app in the controller. So far I'm trying:
public static String getAppName() {
         UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId = :UserInfo.getUserId() LIMIT 1];
        AppDefinition appDefinition = [SELECT DurableId, Label FROM AppDefinition Where DurableId = :userAppInfo.AppDefinitionId LIMIT 1];
       return appDefinition.Label;
    }
But Im getting 3 errors:

Line 1: No such column 'AppDefinitionId' on entity 'UserAppInfo'
Line 2: Invalid type: AppDefinition
Line 3: Variable does not exist: appDefinition

Can anyone provide some insight as to what I may be doing wrong? Thanks!
I'm running into a problem where my APEX code is firing too many API calls in the span of 100ms, so simply, is there a way to delay the code from firing for 101ms. 

As I understand there may be a few 'Bad Code' workarounds such as home brew sleep methods and running for loops until certain conditions have been met, but I would rather avoid these for obvoius reasons.

Thanks for any advice!
I need to get the name of the current app in the controller. So far I'm trying:
public static String getAppName() {
         UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId = :UserInfo.getUserId() LIMIT 1];
        AppDefinition appDefinition = [SELECT DurableId, Label FROM AppDefinition Where DurableId = :userAppInfo.AppDefinitionId LIMIT 1];
       return appDefinition.Label;
    }
But Im getting 3 errors:

Line 1: No such column 'AppDefinitionId' on entity 'UserAppInfo'
Line 2: Invalid type: AppDefinition
Line 3: Variable does not exist: appDefinition

Can anyone provide some insight as to what I may be doing wrong? Thanks!