• Sachin30
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Salesforce Architect

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
Strange behavior while calculating code coverage:

if I mention method call with parameters in different lines, salesforce consider it as different lines while calculating code coverage e.g
myMethod(p1,
p2,
p3,
p4);
Test coverage consider it as 4 lines. Instead it should be only one line as it is nothing but representation of one method call.
myMethod(p1,p2,p3,p4);
This makes the code writing highly inefficient as unwrapped long lines in editor are very difficult to manage for a developer. 
 
What is the difference between using a system.runas() method with a user without inserting the user or with inserting user. E.g:

User u = new User(...);
system.runAs(u){}

Vs

User u = new User(...);
insert u;
system.runAs(u){}

And which one is preferred as best practice?

TIA
I have two lightning components. One for create new record and other one for edit record. I am overriding the standard new and edit actions with these components. 

The new action is working fine and user is getting redirected to CreateComponent which is firing standard e.force:CreateRecord event and the form shows up correctly.

However when I am trying to edit the record it is being redirected to EditComponent but then the browser hangs. On debugging I found that it is causing an infinite loop because of the standard e.force:EditRecord event being called in js controller for the component which seems to be logically correct.

But my question is why it is not behaving the same for CreateComponent. What is the difference between the two? or Am I missing something here?
Hi

I have created a lightning component in which I have added two lookup fields using <lightning:recordeditform> and <lightning:inputfield>. The component shows up as model box when a button is clicked on lightning record detail page.

Whenever the component shows up and the lookup field is blank, on selecting the lookup field throws error:

"cannot read property "color" of undefined

Please let me know if anybody has experienced similar error and able to resolve it.

TIA
Hi All

Has anybody integrated JIRA as canvas app in salesforce? I need to do a POC on JIRA app so that we can integrate a similar app in salesforce after than.

TIA
S
Strange behavior while calculating code coverage:

if I mention method call with parameters in different lines, salesforce consider it as different lines while calculating code coverage e.g
myMethod(p1,
p2,
p3,
p4);
Test coverage consider it as 4 lines. Instead it should be only one line as it is nothing but representation of one method call.
myMethod(p1,p2,p3,p4);
This makes the code writing highly inefficient as unwrapped long lines in editor are very difficult to manage for a developer. 
 
I have two lightning components. One for create new record and other one for edit record. I am overriding the standard new and edit actions with these components. 

The new action is working fine and user is getting redirected to CreateComponent which is firing standard e.force:CreateRecord event and the form shows up correctly.

However when I am trying to edit the record it is being redirected to EditComponent but then the browser hangs. On debugging I found that it is causing an infinite loop because of the standard e.force:EditRecord event being called in js controller for the component which seems to be logically correct.

But my question is why it is not behaving the same for CreateComponent. What is the difference between the two? or Am I missing something here?
What is the difference between using a system.runas() method with a user without inserting the user or with inserting user. E.g:

User u = new User(...);
system.runAs(u){}

Vs

User u = new User(...);
insert u;
system.runAs(u){}

And which one is preferred as best practice?

TIA
Hi Everyone,

I have LWC component wrapped in aura component. My LWC component is using gerRecord to get the recordType info of the record. 
The problem I'm facing is when i first time click the button, wire method is not called and on refresh of the screen it's working as expected.

Note: Two scenarios @wire is not getting called are below,
1) on first time load of screen
2) when screen is left ideal for few minutes.

Please let me know if anyone has any suggestions on this.

Thanks