• John Lewis 29
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 2
    Questions
  • 2
    Replies
We have a Visualforce Page which lists the QuoteLineItem records for a particular Quote record using the apex:pageBlockTable component. It also proves buttons (apex:commandButton) to access the standard ‘Add Products’ and ‘Edit Products’ pages by redirecting to the relative URLs for those pages, i.e.

/_ui/sales/quote/SelectSearch?addTo=XXX
/quoteitm/multilinelitem.jsp?quoteId=XXX
where XXX is the salesforce Id of the Quote.

This works fine in Salesforce Classic and also in Lightning Experience, although in the latter it still redirects to the ‘classic’ pages rather than the equivalent Lightning dialogs so the user experiences a switch from Lightning to Classic and back again when finished.
Question: is there a way to make the buttons load the Lightning Dialogs for ‘Add Products’ and ‘Edit Products’ either by modifying the VF Page or by replacing it with a Lightning Component or some other method?
Thanks in advance
John Lewis
When a Case is created by Email-to-Case, we find that the CreatedById is set to a special UserId which seems to refer to the Automated Case User 'System' which is configured at Customize > Cases > Support Settings.

I've found that in Apex Trigger code, running for the 'before insert' event on the Case object, this User can be identified by statements such as:

    if (UserInfo.getName() == 'System')
    if (UserInfo.getUserName().startsWith('automatedcase@'))
    if (UserInfo.getUserType() == 'AutomatedProcess')
    
However, I think that if changes are later made to the Case > Support Settings so that the Automated Case User is an actual User then the above code will no longer give the same result.

Is there, therefore, a reliable way to identify during trigger execution that the Case is being created by Email-to-Case rather than by some other method (manual entry, clone, visualforce, etc.)?

Thanks in advance for any suggestions.

Regards
John Lewis
When a Case is created by Email-to-Case, we find that the CreatedById is set to a special UserId which seems to refer to the Automated Case User 'System' which is configured at Customize > Cases > Support Settings.

I've found that in Apex Trigger code, running for the 'before insert' event on the Case object, this User can be identified by statements such as:

    if (UserInfo.getName() == 'System')
    if (UserInfo.getUserName().startsWith('automatedcase@'))
    if (UserInfo.getUserType() == 'AutomatedProcess')
    
However, I think that if changes are later made to the Case > Support Settings so that the Automated Case User is an actual User then the above code will no longer give the same result.

Is there, therefore, a reliable way to identify during trigger execution that the Case is being created by Email-to-Case rather than by some other method (manual entry, clone, visualforce, etc.)?

Thanks in advance for any suggestions.

Regards
John Lewis
Hi All, 

I started to develop a mobile application using Flutter. 
Now I need to integrate this app with salesforce, and in particular with salesforce community login.
What I'd like to do is to have salesforce username-password authentication integrated in the app.
What is the best approach to this problem?

Thanks.

Hi All,

during my work with apex, I had issue with searching data in maps of maps of maps... or combinations in lists. Sometimes I want to run a debug log and I want to see all values in fields. Salesforce put debug log into long string only, so it's hard to read. After time, I desided to create a new tool, which parse salesforce log into nice format for easy reading. Try it, and say if you like it. Feel free to request some improvements and ideas for implementing

 

 

http://www.cassacloud.com/nice-salesforce-debug/

 

enjoy!

 

PS: if you do not have any debug try this one:

16:55:49:253 USER_DEBUG [59]|DEBUG|{Best Case=(), Closed=(OppInfoTotal:[OppCategory=Closed, OppId=MyId, OppName=TestOPP1, OppProjectType=null, OppV2Practice=null, sumTotals=(sumQuarterRow:[RevenueType=Deposit, SumOfRow=null, month1=1.0, month2=0, month3=3.6], sumQuarterRow:[RevenueType=Milestone, SumOfRow=null, month1=3.0, month2=0, month3=0])]), Commit=(OppInfoTotal:[OppCategory=Commit, OppId=myId, OppName=TestOPP2, OppProjectType=null, OppV2Practice=null, sumTotals=(sumQuarterRow:[RevenueType=Final, SumOfRow=null, month1=1.0, month2=2.5, month3=1.9])]), Pipeline=()}