• Mary Fields
  • NEWBIE
  • 5 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 10
    Replies

I am trying to create a field dependency where the Opportunity field: Sector has drop down options that are dependent on the Account field: Industry (Group). We attach Opportunities to Accounts so this would be helpful.

On the Account Object, I have 2 fields:

  • Industry - Picklist
  • Industry (Group) - Picklist with field dependency controlled by Industry

On the Opportunity Object, I have 1 field:

  • Sector - Multipicklist
I would like the Sector multipicklist on the Opportunity Object to display options depending on what the Industry (Group) field on the Account Object is.

Can anyone help me with this?
I need to send some data to the accounting system that my company uses. It has a public API and endpoint where I can ping it with an XML message. 

If I was just going to send Opportunities, then I could just use Outbound Message in a simple way. 

However, I need to send Opportunities and some LineItems. I need to bundle this data together. 

I'm wondering how should I handle this? Should I write custom Apex code? Or can I do this as a Flow? Is there a simple way to do this using Outbound Message? 
Controller Code:
public with sharing class ExportTemplateController {
    
    public String xlsHeader{
        get{
            String strHeader = '';
            strHeader += '<?xml version="1.0"?>';
            strHeader += '<?mso-application progid="Excel.Sheet"?>';
            return strHeader;
        }
    }
    
    public String filterNameData{
        get{
            String selectedFilterId = this.controller.getFilterId();
            return selectedFilterId;
        }
    }
    
    ApexPages.StandardSetController controller;    
    public ExportCSVController(ApexPages.StandardSetController controller) {
        
        this.controller = controller;   
        if (controller.getResultSize() < 2000 ) {
            controller.setPageSize(controller.getResultSize());
        } else {
            controller.setPageSize(2000);
        }
   }

Test Class (so far I've researched and written)
 
@isTest
private static void ExportTemplateTest() {

    //Try insert a list of accounts to use Account Controller

    List<Account> testAccs = new List<Account>();
    for (Integer i = 0; i < 200; i++) {
        Account a = new Account(Name='TestAccount' + i);
        testAccs.add(a);
    }
    insert testAccs;
    
    Test.startTest();
    PageReference pageRef = Page.OpenAccountPage;
    Test.setCurrentPage(pageRef);
    ApexPages.StandardSetController stdSetController = new 
    ApexPages.StandardSetController(testAccs);
    stdSetController.setSelected(testAccs);
    ExportCSVController ext = new ExportCSVController(stdSetController);
    System.assertEquals(200, 200);
    Test.stopTest();
}

The code coverage is now 30%. Please help me with writing methods to cover public String xlsHeader & public String filterNameData.

The Controller was written by another Developer that is no longer working in my company. I'm taking his task now. 

As I've researched, Get is a Read-only variable. How do we call/invoke/access it in Test Class?

Thank you so much.

Hi,

I have a trigger that,amongst other things, adds a User to a Public Group. To achieve this, and not get a 'Mixed DML' error, the code to add the User to the Public Group is wrapped up in an @future method, so it executes in its own transaction.

Now, a new requirement has come along that requires a lot of records to be updated, and so this trigger - and the @future method - will get called thousands of times. I've wrapped all this up in a Batch class to achieve this.

But, calling an @future method from a Batch (effectively, calling an Async method from another Async method) is not permitted.

I tried, in the Trigger, detecting the process was being called from a batch and then using a not-@future method - but, of course, that fails again with a 'Mixed DML' error.

Any suggestions as to how I can get around this? Please don't get too focussed on this particular scenario, as I have a few similar ones, and what I'd really like is a general solution to this.

Thanks for your suggestions!

  • February 06, 2023
  • Like
  • 0

Hi Team

I have use-case like that I want map all standard product with one account record and vice-versa is a product have map all account record.
How can we achieve that I have tried create a junction but am I not able to achieve it.
Is this possible with product objcet or any link refrence which can help me this case?

Thank you

Greetings,

       I created a Flow and looking to connect the flow to a Quick Action.  I created the Quick Action on the object and dragged it onto the Page Layout that is assigned by record type.  I notice the quick Action or a button representing it does not appear.

       What am I missing?

Thank You
An electric heating blanket is ideal for physiotherapists who want to provide their patients with effective treatment. Buy electric heating blanket physiotherapy; it has been specifically designed to be used as part of a physiotherapy session, assisting in the reduction of pain and discomfort during recovery.

Buy Avanche Mini Electric Fruit Mixer
Hi All,

I am creating one opportunity report that will show the percentage to complete the next stage. And the report is having group by Stage field.
Formula - (Next stage record count/Current stage record count)*100.

I tried with existing function “PREVGROUPVAL” working fine but it’s not suitable for my requirement. However do we have the same kind function or any solution to get Next Group Value (means Next stage record count). Anyone who has worked related to such issue can expedite their help.

Regards,
Ragavendr Kolli
  • December 28, 2022
  • Like
  • 0
Hello everyone,

We have a custom LWC component using on the Salesforce mobile app.

When we are trying to access the component on the iOS device it is working fine for the first time. But if we do the same without properly closing the app it is throwing some random error.

Properly closing the app I mean, not clearing it off from the recent apps.

Could anyone please help us provide with a solution if you are aware.

Thanks!