• Dev_Arya
  • SMARTIE
  • 715 Points
  • Member since 2017
  • Senior CRM Consultant/Architect
  • Adesso SE


  • Chatter
    Feed
  • 19
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 12
    Questions
  • 173
    Replies

Hi,

Related to: Products & Pricebook

By default, Salesforce does not provide sharing visibility control on Products, but we can limit the product access using the Pricebook assignment and users will only have access to the products added to the accessible pricebook. I tried implementing the above scenario, buy my users can still see all the products via a global search and products tab. Any idea why this could happen or otherwise how can I achieve the above-stated scenario? Thanks.

In Custom Object picklists, we have an option to check/uncheck, 'Restrict picklist to values defined in the value set'. If I have this unchecked, the user should be able to add free text, but that is not the behavior I have seen, then what is the use of this setting? 
If it is different then how can we get ClientID for the authorized client?
Hello Everyone,

I've been trying to do a test Method for a callOut class that invokes a Callout in a future Method, but this is returning System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out only in the test Execution, When running in the normal flow, it responses with no problem.

I've understood that this error is produced when doing a DML statement before a CallOut. However there's no operation besides the createData in the TestSetUp.

I've read some posts and the most likely was this one:  https://developer.salesforce.com/forums?id=906F0000000927CIAQ  .But the proposed solution of Test.StartTest();  Test.SetMock(); ... Test.EndTest()  is already developed.

This is the code returning the error
@isTest
global class RPP_SyncOportunidad_ws_tst {
    
    @testSetup
    static void createData()
    {
        Account acc = new Account();
        acc = new Account();
 		acc.Name='AVX_cuentaPrueba ';
        acc.RPP_NombreComercial__c='NombreComercial '; 
        insert acc;
        
        Contract contrato =  RPP_DataGenerator_cls.crearContrato(true, acc.Id);
        Opportunity objOpp = RPP_DataGenerator_cls.crearOpportunity(false,acc.Id);
        objOpp.RPP_Acuerdo__c= contrato.Id;

        insert objOpp;
    }
    
    public static testMethod void successTest()
    {
        List<Opportunity> lstOpps = [SELECT Id FROM Opportunity];
        Test.startTest();
        Test.setMock(HttpCalloutMock.class, new MockSuccessResponse());
        RPP_SyncOportunidad_ws mci = new RPP_SyncOportunidad_ws(lstOpps);
        Id jobId = System.enqueueJob(mci);
        Test.stopTest();
        
        System.assertNotEquals(mci, null, 'Test error: Cannot create invocacion ws');
    }
    
    global class MockSuccessResponse implements HttpCalloutMock
    {
        global HTTPResponse respond(HTTPRequest req)
        {
            HttpResponse res = new HttpResponse();
            res.setHeader('Content-Type', 'application/json');
            String strJSON ='[\n' +
                '{\n' +
                ' "CodigoError": null, \n' +
                ' "EntidadComercialId": "32201", \n' +
                ' "Estado": "S", \n' +
                ' "Mensaje": "Cliente registrado con éxito", \n' +
                ' "SalesForceGuid": "D58B1521-BAC2-4279" \n' +
                '}\n' +
                ']';                          
            res.setBody(strJSON);
            res.setStatus('OK');
            res.setStatusCode(200);
            return res;
        }
    }
}
It also happens that I have developed other CallOut classes with their own TestClasses and they work just fine.

Has anyone being in this issue?
Hi community!

I am having an interesting issue. Our Salesforce instance is integrated with our company website. We are a subscription-model company selling content, so we sync contacts up to our website to determine which contacts have web accounts and also what these contacts have access to. 

I am seeing a weird thing where I am getting errors for leads regarding the state in the state/country codes for leads only. So contacts are syncing all right, but leads seem to be erroring out. 

But, I thought the state/country picklist was universal for the instance so that does not make much sense to me. Am I wrong in that assumption? 

Any thoughts would be greatly appreciated. 

Thanks,
Tasia
I’m finding that (sales) users are able to edit accounts owned by other users.  The two profiles I tested are Sales team and Development Team.  I was able to login as Sam and edit / david, and I was able to login as david and edit an account I own, and logged in as Roger and was able to edit an account I own.  Is there a reason for this ability?  We are finding that certain groups are making edits to accounts regardless of who owns the account. 

 
Right now, messages are overwritten each time a new Contact Us form is submitted on our website. I would like to have a list view of previous messages in the same area and the SF Help Desk sent me to this forum. 
Hi, 
we have (like other people I think) an issue with the storage of EmailMessage.
Therefore, we develop an apex class that will store each EmailMessage (and attachments) within a single document and retrieve if we need to restore the EmailMessage

As we have around 3 millions email, we will create around 3millions documents and I was wondering if there was a limit or recommandation regarding the number of object within a single folder.
This folder will never be directly access , we will only work with the id of the related document.

Thanks for your help
Hi, I'm new to triggers.
can someone help me with the below trigger.

NCT Object
  1. if field (Process 8a case) Court process field is NCT 
  2. Change case/query owner to NCT queue
  3. Open an NCT object
  4. Complete client full name in NCT object from case field

this is the where the  field is query owner(owner) located
query owner(owner) which is a lookup field.
should be Queue (1) and the next field should be NCT queque (2)  Below:
User-added image

This is what I did to change the Owner to NCT queue and got an ErrorUser-added image
 
I have 3 fields in a section.
I have to write a validation rule when a value is entered in one field in a section enforce the user to key in values for all other fields in that section.
AND( 

OR(
AND(
(x__c> 0), 
OR(
ISBLANK(y__c),
ISBLANK(z__c)
)
),


AND((y__c > 0), 
OR(
ISBLANK(x__c ),
ISBLANK(z__c)
)
),


AND((z__c > 0), 
OR(
ISBLANK(x__c ),
ISBLANK(y__c )
)
)
),
(RecordType.Name = "abc") 
)

Here is my VR.... Any help would be appreciated.. thanks, 
trigger AfterHoursTrigger on Service_Call__c (after insert) {
    //Get the default business hours
    BusinessHours bh = [Select Id From BusinessHours Where isDefault = true];
    
    Datetime CreatedTime = System.Today();
    
    //Find whether CreatedDate is whithin those business hours
    for (Service_Call__C Calls : Trigger.new){

    Boolean isWithin = BusinessHours.isWithin(bh.id, CreatedTime);
        if (isWithin = FALSE)
        Calls.After_Hours__c = True;
    }

}

So this is my very first attempt to write a trigger in Salesforce so be patient with me. Basically I want something that will check a checkbox called "After Hours" if the created date of the record doesn't fall within the business hours set up in Salesforce. It's not working, and I have no idea why. Any help is appreciated. Thanks
Hi guys, so, I have Salesforce Service Cloud, and on it, I made a settings to receives cases on social (Facebook & twitter) and on Email. on a daily basis, my organization receives 10K complaints  I once created a reply macro for email and it worked. the reason for this if for my team to reply email in a massive amount. this is what I have on email mass reply macro:

1. Select Active Case Tab
2. Select Close Case Action
3. Set Status: Process
4. Submit Action
5. Select Email Action
6. Set From Address: cs@company.com
7. Apply Email Template: [template name]
8. Submit Action

==============

Then, I tried to do similar thing on the social case, and it didn't work. This is what I have on social case macro:

1. Select Active Case Tab
2. Select Social Action
3. Set Message Type: Reply
4. Insert into Message: [quick text]
5. Submit Action
6. Select Create Activity Action
7. Set Group: [issue code group]
8. Set Issue Code: [issue code number]
9. Submit Action
10. Select Close Case Action
11. Set Status: Process
12. Submit Action

It is has different accordance, since it has different business process, but I'm sure every step is correct, yet, it still didn't work. Is macro only work for email? Is there any social case macro best practice example?

Hi guys, 

I am trying to create a PDF file just like Quotes work. However im doing this from a Custom Object. 

I found this link that answers it in some way :

https://developer.salesforce.com/forums/?id=9060G000000I7qhQAC

However im looking to create a pdf with some info from the record that is being created and the Line Items on the quote will come from data on records which this main record is related to.

Better explaining, i have Object A which will have the button to create the PDF, some of the main data will be pulled from the record on Object A, the line items(which may be just one or many, based on a criteria that i also want to specify) will pull from Object B, which has a lookup field to Object A on every record on the org. 

So the PDF will generate with info from OBject A and every Object B that has object A related and meeting the criteria. 

 

Lastly i want a second button that will create the PDF but will attach the PDF to an email with a preselected templated(email template created on salesforce) and automatically send it to the email on a contact lookup field on Object A.

 

Please advise the best way to create this procedures. 

 

I really appreciate your help!

I have used Process Builder quite a bit in the past, however, this problem has stumped me.

I have a process that when a subscription record is changed, depending on which fields changed will push values from the subscription to the account record.  

The subscription records are controlled and updated by Recurly ( our billing system).  They have a batch job that runs every 5 minutes and pushes changes to SFDC.  When a subscription changes, I use Process Builder to update the Account with the changed information.    

I keep getting the following:  Error Occurred: recurly_v2:Too many SOQL queries: 201
In fact, the email I get will reference about 45 records.  

What is odd is following:
I received the email with the failure at 2:49 pm on 2/27/2016

The email failure reports record: ACCOUNT:  0010a00001MWEBt
That account record was last modified at 2/27/2018 4:29 AM
The subscription record that could have triggered this was last modified at 2/27/2018 4:43 AM

When I looked at the users record in Recurly there were no changes to that record at all?  
When I try to dig through the Debug Logs I can not find any references to this WF at all?

Any help would be greatly appreciated.
 

User-added image


 



 

Hello, 

I am wondering is anyone else has had this problem. When we are refreshing the dashboards, the dashboard just turns to code. It isn't anymore complicated than that. Literally, it is just html tags and styling. Does anyone know why this might be? 

Thanks.
In the following piece of code:
List<String> necessaryColumns = new List<String> {'columnA', 'columnB', 'columnC', 'columnD', 'columnE', 'columnF','columnG'};    
Set<String> columnsInFile = new Set<String>(necessaryColumns);
            System.debug('columnsInFile' + columnsInFile);
            // Get all column names from the CSV file
            List<String> columnNames = csvRecords.get(0);
            for(String columnName :columnNames) {
                System.debug('columnName: ' + columnName);
                if(!columnsInFile.contains(columnName)) {
                    System.debug('clmnName: ' + columnName);
                    ApexPages.Message myMessage = new ApexPages.Message(ApexPages.Severity.FATAL, 'The uploaded file is invalid');
                    ApexPages.addMessage(myMessage);
                    return;      
                }
            }
The issue I have is that the names of the columns in the set are in strict order.
|DEBUG|columnsInFile{columnA, columnB, columnC, columnD, columnE, columnF, columnG}
and if the order of the columns in the CSV file is changed for instance:
columnG, columnF, columnD, columnC, columnA, columnB
The algorithm is entering the if block and is showing the message, which is totally wrong.
What I'm trying to achieve is to show the message only if one of the columns in the CSV file is missing.
If there are 20 columns in the CSV file but for instance columnA is missing in the file only then the ApexPages.Message has to be displayed for the users.
Please advise how this can be achieved with apex?


 
Can we create a picklist field where can pick the value from dropdown as well as type the text and save?

Thanks1!