• SwarnaSankhaSingh
  • NEWBIE
  • 315 Points
  • Member since 2016
  • Manager - CRM Applications
  • Avid


  • Chatter
    Feed
  • 10
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 68
    Replies
In my project, I have noted the bugs in an excel sheet and through it I am tracking it. Is there any better of tracking the bugs apart from excel sheet.

Thank you!
  • October 13, 2016
  • Like
  • 0
Hello all,
While at Dreamforce a very helpful developer showed me how to create a VF page, then a button that will display in Lightning.  I took copious notes, and tried to replicate another button I need to display in Lightning.  When I go to page layout and attempt to place the button, it is "not allowed".  I don't appear to have any issues with my APEX.  it is essentially a hyperlink that goes to a different system.  Any assistance is appreciated.

here's the code if that helps:

<apex:page standardController="Opportunity">
    <script>

http://MAGICDEV/magicxpi4_1/MGrqispi.dll?appname=IFSSF_JDE&prgname=HTTP&arguments=-AJDE_INT%23TS&OppID={!Opportunity.Id}

    </script>
</apex:page>
When Users are creating a new Case record, I want to prevent the user from saving the Case record if they select 'Re-Open' in the Status field.
Can I use the (ISNEW) function to indicate that a new record is being created. Help with syntax would be appreciated! 

 AND
(ISNEW(),
(ISPICKVAL(Status, "Re-Open"))
NOT(IsClosed)
I am trying to get a count of the number of contacts on an account, I am getting Error: Compile Error: Incompatible types in ternary operator: Integer, String at line 72 column 42. 
 
trigger NumberofContacts on Contact (after insert, after update, after delete, after undelete) {
    Map<Id, List<Contact>> mapAcctIdContactList = new Map<Id, List<Contact>>();
    Map<Id, List<Contact>> mapAcctIdDelContactList = new Map<Id, List<Contact>>();
    Set<Id> AcctIds = new Set<Id>();    
    List<Account> listAcct = new List<Account>();
    
    if(trigger.isInsert) {
        for(Contact Con : trigger.New) {
            if(String.isNotBlank(Con.AccountId)) {
                if(!mapAcctIdContactList.containsKey(Con.AccountId)) {
                    mapAcctIdContactList.put(Con.AccountId, new List<Contact>());
                }
                mapAcctIdContactList.get(Con.AccountId).add(Con); 
                AcctIds.add(Con.AccountId);
            }   
        }  
    }
    
    if(trigger.isUpdate) {
        for(Contact Con : trigger.New) {
            if(String.isNotBlank(Con.AccountId) && Con.AccountId != trigger.oldMap.get(Con.Id).AccountId) {
                if(!mapAcctIdContactList.containsKey(Con.AccountId)){
                    mapAcctIdContactList.put(Con.AccountId, new List<Contact>());
                }
                mapAcctIdContactList.get(Con.AccountId).add(Con); 
                AcctIds.add(Con.AccountId);
            } else if(String.isBlank(Con.AccountId) && String.isNotBlank(trigger.oldMap.get(Con.Id).AccountId)) {
                if(!mapAcctIdDelContactList.containsKey(Con.AccountId)){
                    mapAcctIdDelContactList.put(Con.AccountId, new List<Contact>());
                }
                mapAcctIdDelContactList.get(Con.AccountId).add(Con);   
                AcctIds.add(trigger.oldMap.get(Con.Id).AccountId);
            }
        }  
    }
    
    if(trigger.isUndelete) {
        for(Contact Con : trigger.new) {
            if(String.isNotBlank(Con.AccountId)){
                if(!mapAcctIdContactList.containsKey(Con.AccountId)){
                    mapAcctIdContactList.put(Con.AccountId, new List<Contact>());
                }
                mapAcctIdContactList.get(Con.AccountId).add(Con);     
                AcctIds.add(Con.AccountId);
            }
        }  
    }      

    if(trigger.isDelete) {
        for(Contact Con : trigger.Old) {
            if(String.isNotBlank(Con.AccountId)){
                if(!mapAcctIdDelContactList.containsKey(Con.AccountId)){
                    mapAcctIdDelContactList.put(Con.AccountId, new List<Contact>());
                }
                mapAcctIdDelContactList.get(Con.AccountId).add(Con);    
                AcctIds.add(Con.AccountId); 
            }
        }  
    }   
    
    if(AcctIds.size() > 0) {
        listAcct = [SELECT Id, Number_of_Contacts__c FROM Account WHERE Id IN : AcctIds];
        
        for(Account acct : listAcct) {
            Integer noOfConts = 0;
            if(mapAcctIdContactList.containsKey(acct.Id)) {
                noOfConts += mapAcctIdContactList.get(acct.Id).size();
            }
            if(mapAcctIdDelContactList.containsKey(acct.Id)) {
                noOfConts -= mapAcctIdDelContactList.get(acct.Id).size();
            }
            acct.Number_of_Contacts__c = acct.Number_of_Contacts__c == null ? noOfConts : (acct.Number_of_Contacts__c + noOfConts);
        }
        
        update listAcct;    
    }
}

Thanks in advance!
Hi,
I have created a Picklist field(Application) which is depndent on another picklist (Vertical) . I have provided the values using dependency matrix.values in Picklist are showing in Preview Format.
Here is the snapshot.
User-added image

But one thing i could not figer out values are showing correctly in preview format but not when I am creating an object and choosing picklist field value. values are not appearing.
User-added image
Please help me out.
thanks in advance
 
Hi Developemnt,

I am new to Selasforce and I want to create a button that send email of an opportunity to an approver.
After creating an opportunity, some details like Name of Opportunity, Start and end date needs to be emailed to be entered in another system.

Regards,
Cassim
Hi there. Struggling with the limits of SOQL .... if looking for a way to retrieve the most recent case for all accounts. In SQL such would be very simple ...

SELECT ID FROM Case U1
WHERE CreatedDate = (SELECT MAX(CreatedDate) FROM Case WHERE AccountID= U1.AccountID)

But SOQL does not allow me to due to the bind variable. Would anyone be able to support ?
Can somebody help with a formula field called "status" as follows

if field "requested" is ticked, then "status"  equals "ongoing"
if field "date approved" contains a date, then "status" equals "approved"
if field "date rejected" contains a date, then the "status" equals "rejected"

many thanks!
Can I make some certain fileds invisible in one object using validations?? The logic should be if OwnerID<>userID then some fields will not be visible for others. Is that possible without using apex class and triggers??
Let me know please as soon as possible
H iall

Aware this is a bit of an odd request but I was wondering if anyone can help.  I use salesforc ein a primary school so we can't afford the developer costs associated with normal salesforce use case development but was hoping that someone might be able to help me do something.  Basically I (a certified admin) need to create someway of scanning information from a template which lists students in a class and denotes whether they are present or not (morning attendance).  The sheets list all the studenmts names and their student ID along with a box filled in for absent or present.  If its left black they are present.  This sheet is fully typed and printed but the penciling in denotes if theres an absense.  Basically I want to find a way to scan these attendance sheets into salesforce and have a record created for each student to record their attendance situation for the day.  The sheet is the same each day for each class.  it just needs to record the date, student idf and the attendance for each student once a day. 

I am aware there is a 3rd party system that can do this but its so expensive per year.  I see that there are APIs that can help with this and set areas for partial recognition areas but I have no idea how to do this at all.  I was looking at http://ocrsdk.com/documentation/apireference/ and http://www.online-code.net/ocr.html.

If anyone thinks they can help or make this process kind of idiot proof for me I'd really appreciate it.  I know what I need to do once the data is collected in salesforce but its just getting it from the sheet into tthe system.  Its seriously just for kids attednance to be recorded so we can find out where they are or why they are not somewhere as quickly as possible and maki ng alerts using workflows etc.  The impact of this would be huge.  any help or expertise much appreciated.  I do believe for someone who knows what they are doing this might not be super hard.  
Hi all,
We have lead inserts being done using data import wizard and we choose the lead assignment rule that needs to be assigned.
This is inturn updating the owner on the lead and calling ALL workflows (even though they do not meet the criteria) under lead object which is causing a limit exception - time out.

Is there a way out for this?

Regards
Nitty
Hi,

I am trying to complete the trailhead module Apex Basics & Database / Writing SOQL Queries. When I am checking the challenge I got the bllow eerror:

Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Delete failed. First exception on row 0 with id 0032400000nIEIpAAO; first error: DELETE_FAILED, Your attempt to delete Joe Doe could not be completed because it is associated with the following cases.: 00001136 : []

I have not clue how to solve it, since there is not any contact named Joe Doe and any case 00001136. My code seems to be fine:
 
public class ContactSearch {

    public static List<Contact> searchForContacts (String lastName, String postalCode){
    	List<Contact> con = new List<Contact>(); 
        con = [SELECT Id FROM Contact WHERE (LastName =: lastName AND MailingPostalCode =: postalCode )];
        
        return con;
    }
}

Thanks in advance.




 
Hi Guys,

Need some help !!

I'm new to Apex Developing. I'm trying to create the opportunities count in the Product object. 
Note: Account object is not Master Details (A read-only field that displays the sum, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list.)

So guide me in other way to create opportunity count in product object field.
  • October 13, 2016
  • Like
  • 0
Hi All,

I'm my code I have a aggregate SOQL on currecny field, which always provides me the result in Organization default currecny(in USD). After some reaching I found there is a manual way to solve the issue ( https://developer.salesforce.com/forums?id=906F00000008y4vIAA ). In my application there are many places where we are having this issue.

So, is it possible to use "convertCurrency" function to restrict the conversion to org default?
 
Hello was wondering if anyone is experiencing a issue when deploying Security Settings into a org. I receive the following message:
All Component Failures:
1.  settings/Security.settings -- Error: An unexpected error occurred. Please include this ErrorId if you contact support: 1561807314-628096 (-2122813023) 
Hello,

I do not have "Enable communities" option, but we already have a domain name. I do not have Manage Communities as well. I am new here, can anyone help me?
User-added image
We are implementing Live Agent with a pre-chat form to capture and display information from the customer.  The pre-chat form works great but we also want capture the URL the customer was on when they clicked the chat button.

I added some JavaScript to pass in this detail from the webpage.

`liveagent.addCustomDetail('URL', window.location.href);`

This works fine from a test HTML page on my desktop, but when we put the code on our testing website the URL doesn't get passed through.

On the webpage the code is in the `<body>` tag and looks like this.
<script type="text/javascript">
        if (!window._laq) { window._laq = []; }
        window._laq.push(function(){
            liveagent.showWhenOnline('573XXXXXXXXXXXX', document.getElementById('liveagent_button_online_573XXXXXXXXXXXX'));
            liveagent.showWhenOffline('573XXXXXXXXXXXX', document.getElementById('liveagent_button_offline_573XXXXXXXXXXXX'));
        });
    </script>
    <script type='text/javascript' src='https://c.la3-c2cs-chi.salesforceliveagent.com/content/g/js/37.0/deployment.js'></script>
    
    <script>
        // liveagent.addCustomDetail('URL', window.location.href); Doesn't work either
        window.onload=liveagent.addCustomDetail('URL', window.location.href);
    </script>
    
    <script type='text/javascript'>
        liveagent.init('https://d.la3-c2cs-chi.salesforceliveagent.com/chat', '572XXXXXXXXXXXX', '00DXXXXXXXXXXXX');
    </script>
I'm not JavaScript wiz so I'm not sure if/how much placement matters.

Also using FireFox firebug I see this error when I refresh the page

> ReferenceError: liveagent is not defined

I suspect this is caused by the `addCustomDetail` function but I'm not sure exactly how to find exactly where it is happening.

User-added image
How can I write a SOQL query to ID the opportunity contact roles where the contact account doesn't equal the opportunity account?  I'm trying to clean up the opportunity contact roles that were migrated in from another CRM and associated to the wrong opportunity.
Hello all,
While at Dreamforce a very helpful developer showed me how to create a VF page, then a button that will display in Lightning.  I took copious notes, and tried to replicate another button I need to display in Lightning.  When I go to page layout and attempt to place the button, it is "not allowed".  I don't appear to have any issues with my APEX.  it is essentially a hyperlink that goes to a different system.  Any assistance is appreciated.

here's the code if that helps:

<apex:page standardController="Opportunity">
    <script>

http://MAGICDEV/magicxpi4_1/MGrqispi.dll?appname=IFSSF_JDE&prgname=HTTP&arguments=-AJDE_INT%23TS&OppID={!Opportunity.Id}

    </script>
</apex:page>
I'm developing a Class Registration App for my school. I've started by trying to adapt standard objects before creating custom objects. I want to use the standard Product Object to store Class information and made a custom Registration object to store the students who have signed up for each class. I'm trying to create a rollup summary field on Product (relabled Class) from the custom Registration object.

Since I couldn't create a master detail relationship between the two, I went looking for another way count what what we call "Seats Taken". I ran across a video and some documentation on doing this using Process Builder and Flow Designer. I worked through those modules on Trailhead and decided to give it a shot.

I Created a Flow:
User-added image
And a built a process:
whole process
 Then updated my Profile with permissions to Manage and Run Flows  - updated a record.... and got this error message. 
error message
I made sure I activated the right version of the Flow:
flow page
But it's still not working. I tried logging out closing, my browser, everything short of rebooting the computer. I'm stumped. Help!
 
Instead of using a percentage discount I want to be able to apply a currency discount to each Opportunity Product.
How can I replace the % Discount field with a Currency Discount field?
  • October 09, 2016
  • Like
  • 0
Hi Developemnt,

I am new to Selasforce and I want to create a button that send email of an opportunity to an approver.
After creating an opportunity, some details like Name of Opportunity, Start and end date needs to be emailed to be entered in another system.

Regards,
Cassim
I am looking to get a list of accounts that do not have any contacts who are members of a specific campaign.

Here is the code I have, but I cannot figure the way to get the list.
public class AccountListController6 {
    
    private String sortOrder = 'Name';
    public List<Account> getAccounts() {
        String strEt6 = '701220000001Q1GAAU';
        List<Account> results = Database.query(
            'SELECT Id,Name ' +
            'FROM Account ' +
            'WHERE ID ' +
            'NOT IN ' +
            '(SELECT Contact.AccountId ' +
            'FROM CampaignMember ' +
            'WHERE CampaignId = :strEt6) ' +
            'ORDER BY ' + sortOrder + ' ASC ' +
            'LIMIT 10'
        );
        return results;
    }
}

 
Hello,

I am looking to create a formula field simlar to 2 we already have in our instance under the Account & Opportunity object for Leads. Basically what the field does in a nutshell is, narrow results in reports and dashboards to the region or geo the user's alignment is set to here is the syntax for the  formula fields under Accounts and Objects :

Account Object:
Field 1:
IF (OwnerId = $User.Id, "Y", "N")

Field 2:
IF(OR(Account_Owner_Region__c="",Account_Owner_Geo__c =""),"N",
if(OR
(Is_Mine__c = 'Y',$User.Align__c="Global",
CONTAINS($User.Align__c ,Acct_OwnerName__c),
CONTAINS($User.Align__c ,Account_Owner_Region__c),
CONTAINS($User.Align__c, Account_Owner_Geo__c)
),"Y","N"))

Opportunity Object: 
Field 1: 
IF (OwnerId = $User.Id, "Y", "N")

Field 2:
IF(OR(Owner_Region__c="",Owner_GEO__c =""),"N", 
if(OR 
(Is_Mine__c = 'Y',$User.Align__c="Global", 
CONTAINS($User.Align__c ,OwnerName__c), 
CONTAINS($User.Align__c ,Owner_Region__c), 
CONTAINS($User.Align__c, Owner_GEO__c) 
),"Y","N"))

What I want to do is use a similar logic for leads, EXCEPT instead of the lead owner use another field which is manually maintained called, "Generalist_Sales_Rep__c" :

What is the syntax I need to put in when I create the new Formula field on the Lead object? Thanks for the help in advance! 

Field 1?

Field 2?