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

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
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
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