• prateek jain
  • NEWBIE
  • 81 Points
  • Member since 2017

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 1
    Questions
  • 57
    Replies
Hi

I just recently started working with Big Objects. I sucessfully added my first BigObject to the sandbox, but as is most oftent the case in development, I need to modify one of the index fields.

the first error meesage I am getting is we change length of a text field in an index.
So I decided to leave the original text field as is and I add a new one with the required length. Now I am getting an error message saying that we can't modify an index. 

We are in development.... change is constant. If we cant modify an object regardless of type, then what is the object is the first place
I tried doing some administrative cleanup, to get rid of some fields that were required and now aren't, and now we can't save changes in opportunities due to a Flow Trigger error ID 301U00000000ha5... now none of my team can update their opportunities
I want to create visual workflow to create multiple records for an object like below table.Can Anyone help it is urgent please

I want to create visual workflow to create multiple records for an object like below table.Can Anyone help it is urgent please
There are 3 fields on account object f1 f2 f3. f1 is inserted manually and f2 and f3 will update automatically on what event we write trigger for f2 & f3?
So, in my web-to-lead form code, I have an org id which is unique to my organization. But, can we add leads to multiple org using a single web-to-lead form? Does this mean that for every org, web-to-lead forms are unique? 
What is the best method for populating a scratch org with custom objects and their fields from a sandbox? I have tried the following process and have been unsucessful- am I missing a step or doing something incorrectly?
  1. Within the sandbox, I've created an unmanaged package containing the custom object. I noticed that the package also automatically pulls in dependent classes, pages, etc. 
  2. I've pulled the package to my local environment using:
    sfdx force:mdapi:retrieve -s -r packages -u Sandbox -p objectexport
    
  3. I've unzipped the downloaded package.
  4. I've converted the package to DX format using:
    sfdx force:mdapi:convert -r packages\objectexportunzipped
  5. I then try pushing the converted object to the scratch org:
    sfdx force:source:push
The attempt errors out with dozens of "variable does not exist" and "invalid type" errors. From what I can see, it looks like the order the objects and classes are being pushed is causing the system to not see the dependent fields.

My end goal is to have a repeatable process to replicate custom objects from my sandbox to scratch orgs. 
Hi 
I have scheduled scheduler class everyday at 1pm(through UI). It seems to be woeking in my staging sanbox. but when i see in the apex job . it is status as queued  and  it should have one staus at 1pm as completed if it was woring at 1 pm.  but as queued.
but i production i can see the status as failed and  staus detail as Scheduler: failed to execute scheduled job: jobId:456778999X class: common.apex.async.AsyncApexJobObject, reason: Apex CPU time limit exceeded.
My question  is It failed in production because cpu time exceeded but in staging why there isno staus as completed or failed but looks like it is working.

 
  • December 03, 2017
  • Like
  • 0
Hi Guys,

On Campagin objects i have 3 custom fields like 
open           :
contacted    :
progress     :

Now we need to get all leads which are associated to that campagin records.
Suppose, I have  marketing campagin, which contact 10 leads . in them 5 leads in open status,3 is in contacted and 2 is in progress.
So now on marketing campagin record, i need to be output as
open : 5
contacted : 3
progress : 2

Thanks for advance

 
Hello,
When executing a flow, I am getting a flow error on an opportunity record lookup. All the criteria are met but I'm still getting an error "Failed to find record". Can you please help us understand why this would be happening? 

User-added image

Thanks. 
Hi

I just recently started working with Big Objects. I sucessfully added my first BigObject to the sandbox, but as is most oftent the case in development, I need to modify one of the index fields.

the first error meesage I am getting is we change length of a text field in an index.
So I decided to leave the original text field as is and I add a new one with the required length. Now I am getting an error message saying that we can't modify an index. 

We are in development.... change is constant. If we cant modify an object regardless of type, then what is the object is the first place
Has anyone created a visualforce page that helps users manage tasks by priority? 
Example:
Section for Low Priority                                Section for Normal Priority                                                 Section for High Priority

Can this be done? 
Unable to configure an Apex Trigger/Code to update a field after insert. When the data of one field is integrated from the Website into the Salesforce Lead record, I neeed a trigger that will update the Region field from the data entered in the Country field.
I tried doing some administrative cleanup, to get rid of some fields that were required and now aren't, and now we can't save changes in opportunities due to a Flow Trigger error ID 301U00000000ha5... now none of my team can update their opportunities
We have an Apex Trigger set up so that Intake Records generate and populate new Participant Records (Contacts) given certain criteria. Lately, the newly created Contact Records have been also overwriting other Contacts Records when generated, sometimes 3 or 4 at a time! Help?
  1. @isTest
  2. public class alu_Internship_ControllerTest{
  3.     
  4.     Id OppRecordTypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Internship Opportunity').getRecordTypeId();
  5.     
  6.     public static testMethod void testaluController(){
  7.         
  8.          Account testAccount = new Account();
  9.          testAccount.Name = 'Test Account' ;
  10.          insert testAccount;
  11.          
  12.          alu_Internship_Cycle__c ic = new alu_Internship_Cycle__c();
  13.          ic.Name = 'Test Cycle';
  14.          ic.Start_Date__c = System.Today();
  15.          ic.End_Date__c    = System.Today() + 60;
  16.          insert ic;
  17.          
  18.          Opportunity opp = new Opportunity();
  19.          opp.RecordTypeId = '0120Y000000QELh';
  20.          opp.Name = 'Test Opportunity';
  21.          opp.StageName = 'Under Discussion';
  22.          opp.CloseDate = System.Today();
  23.          opp.AccountId = testAccount.Id;
  24.          opp.Internship_Cycle__c = ic.Id;
  25.          opp.Number_of_Internships_Committed__c = 1;
  26.          opp.Opportunity_Countries__c = 'Algeria';
  27.          insert opp;
  28.          
  29.          PageReference pageRef = Page.alu_Internship_form;
  30.          Test.setCurrentPage(pageRef);
  31.            alu_Internship_Controller testIntCyc = new alu_Internship_Controller();
  32.          testIntCyc.doInsert();
  33.  
  34.                   
  35.     }
  36. }
  37. public class alu_Internship_Controller {
  38.     
  39.     Id OppRecordTypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Internship Opportunity').getRecordTypeId();
  40.     public final static String STAGE_NAME_UD = 'Under Discussion';
  41.     
  42.     public Opportunity opps {get;set;}
  43.     public string str {get;set;}
  44.     public string counName {get;set;}
  45.     public String oppdes {get; set;}
  46.     public String names {get; set;}
  47.     public string cycleName { get; set;}
  48.     public Id Idc {get; set;}
  49.     public string cmpweb { get; set;}
  50.     public string oppcitiesofOper{get;set;}
  51.     public string oppPotPro{get;set;}
  52.     public List<string> couName { get; set;}
  53.     public List<String> listOfCompany {get; set;}
  54.     public Map<Id,String> mapIdStr {get; set;} 
  55.     public Id Ids {get; set;}
  56.     public Id opIds {get; set;}
  57.     public String acc {get; set;}
  58.     public Decimal noOfPosition {get;set;}
  59.     
  60.     public alu_Internship_Controller() {
  61.         opps = new Opportunity();
  62.         opps.RecordTypeId = OppRecordTypeId;
  63.         
  64.         mapIdStr = new Map<Id,String>();
  65.         listOfCompany = new List<String>();
  66.         for(Account a: [SELECT Id, Name From Account]) {
  67.             mapIdStr.put(a.Id, a.Name);
  68.             listOfCompany.add(a.name);
  69.         }
  70.     } 
  71.     public list<SelectOption> listCycleName {
  72.         get{
  73.             list<SelectOption> listSO = new list<SelectOption>();
  74.             listSO.add(new SelectOption('', 'Select Internship Cycle'));
  75.             for (alu_Internship_Cycle__c cyc : [select Id, Name from alu_Internship_Cycle__c]) {
  76.                 if(cyc != null) {
  77.                     listSO.add(new SelectOption(cyc.Id, cyc.Name));
  78.                 }
  79.             }
  80.             return listSO;
  81.         }
  82.        set;
  83.     }
  84.     public List<SelectOption> getCountries() {
  85.  
  86.         List<SelectOption> options = new List<SelectOption>();
  87.         Schema.DescribeFieldResult fieldResult = Opportunity.Opportunity_Countries__c.getDescribe();
  88.         List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();   
  89.         for( Schema.PicklistEntry f : ple) {
  90.             options.add(new SelectOption(f.getLabel(), f.getValue()));
  91.         }
  92.         return options;
  93.     }
  94.     public List<SelectOption> getStages() {
  95.  
  96.         List<SelectOption> options = new List<SelectOption>();
  97.         Schema.DescribeFieldResult fieldResult = Opportunity.StageName.getDescribe();
  98.         List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
  99.         for(Schema.PicklistEntry f : ple){
  100.             options.add(new SelectOption(f.getLabel(), f.getValue()));
  101.         }
  102.         return options;
  103.     }
  104.     
  105.     // Logic for Save Button.
  106.     public PageReference doInsert() {
  107.        
  108.         // Storing Id and Acccount Name If acc contains same name.
  109.         Map<Id,String> mapString = new Map<Id,String>();    
  110.         for(Id tmp : mapIdStr.KeySet()) {
  111.             String name = mapIdStr.get(tmp);
  112.             if(acc.Contains(name)){
  113.                 mapString.put(tmp,acc);
  114.             }          
  115.         }
  116.         for(Id Accid: mapString.KeySet()){
  117.             Ids = Accid;
  118.         }
  119.         System.debug('Ids'+Ids);
  120.         
  121.         
  122.         // validation Logic Start
  123.         if (acc == ''){
  124.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select a Company Name'));
  125.         return null;
  126.         }
  127.         if (cmpweb == ''){
  128.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please enter an Company Website'));
  129.         return null;
  130.         }
  131.         if (cycleName == null){
  132.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please enter an Preffered Internship Cycle'));
  133.         return null;
  134.         }
  135.         if (noOfPosition == null){
  136.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select a Number of Position'));
  137.         return null;
  138.         }    
  139.              
  140.         // Iterating OpportunityId from List Of Opportunity
  141.         for(Opportunity opps : opportunitylists(Ids, cycleName)) {
  142.             opIds = opps.Id;
  143.         }
  144.         for(string s : couName) {
  145.             if(counName != null){
  146.                 counName= counName+';'+s;
  147.             }else{
  148.                 counName = s;
  149.             }            
  150.         }
  151.         if (counName == null){
  152.         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select a Countries Operation'));
  153.         return null;
  154.         } 
  155.     
  156.         Account ac = new Account();        
  157.         if(opIds != null) {
  158.             Opportunity opp = new Opportunity();
  159.             opp.Id = opIds;
  160.             opp.Opportunity_Countries__c = '';
  161.             opp.Opportunity_Description__c = oppdes;
  162.             opp.AccountId = Ids;
  163.             opp.Internship_Cycle__c = cycleName;
  164.             opp.Number_of_Internships_Committed__c = noOfPosition;
  165.             opp.Opportunity_Countries__c = counName;
  166.             update opp;
  167.             system.debug('Opp Update'+ opp);
  168.             
  169.             ac.Id= opp.AccountId;
  170.             ac.Website = cmpweb;
  171.             update ac;
  172.             system.debug('ACC Update'+ ac);
  173.             
  174.         } else {
  175.             Opportunity opp = new Opportunity();
  176.             opp.RecordTypeId = OppRecordTypeId;
  177.             opp.name = '-UG Internship-';
  178.             opp.Opportunity_Description__c = oppdes;
  179.             opp.CloseDate = System.today();
  180.             opp.AccountId = Ids;
  181.             opp.StageName = STAGE_NAME_UD;
  182.             opp.Internship_Cycle__c = cycleName;
  183.             opp.Opportunity_Countries__c = counName;
  184.             opp.Number_of_Internships_Committed__c = noOfPosition;
  185.             insert opp;
  186.             system.debug('Opp Insert'+ opp);
  187.             
  188.             ac.Id= opp.AccountId;
  189.             ac.Website = cmpweb;
  190.             update ac; 
  191.             system.debug('ACC Update'+ ac);
  192.         }      
  193.         pagereference ref = new pagereference('/apex/alu_Internship_Thanks_Msg');
  194.         ref.setredirect(true);
  195.         return ref;
  196.     }  
  197.      
  198.     // getting list of Opportunity    
  199.     public List<Opportunity> opportunitylists (Id Ids, String cycleName) {
  200.         return [SELECT Id, AccountId, Internship_Cycle__c 
  201.                 FROM Opportunity 
  202.                 WHERE AccountId =:Ids 
  203.                 AND Internship_Cycle__c = : cycleName 
  204.                 AND Stagename=: STAGE_NAME_UD
  205.                 ];
  206.     }
  207. }
  208.  
Hello! I am looking for advice on if and how we can build some workflows in Salesforce to collect some information we need. We had some in place but they rarely fired as I believe that because of the nature of what we are trying to do, Salesforce was confused. Out of 700 instances, they only fired 120 times so I deleted them all and want to start new. I am open to suggestions and your thoughts as to if we can even accomplish our goals.
Here are the details:
I created a custom object called Legal Support, it is where the sales team must go anytime they need to request our legal teams assistance with contracts, amendments, terms, etc. Once they fill out the deals of the Legal Support Object, there is a custom button that submits the request over to our legal team so that they may work on the request. While each request is in legal, the request will move through a series of statuses I have listed below. The legal team will change the phase in the Legal Support object in Salesforce each time the request goes to a different status in their control.
  • Unassigned
  • Working
  • Waiting
  • Backlog
  • Blocked
  • Done
  • Lost

The statuses are not linear events as they do not have a natural directional progression. For example, a request may go from unassigned to working, then to waiting, then back to working, then into blocked and back to working, etc. This can happen many times and legal makes redline changed to documents for our clients and they go back and forth many times until an agreement is reached. Our legal team wants to track how long the request is in each status. That means the workflows would need to in essence remember every time a request went back to each status (which could be three, four, five times) and add the times together to give us a total time the request was in each status. The goal is to analyze how long each legal status takes for our deals, I have tried several variations of flows but nothing I know of works and I believe it’s because this is not a linear process and due to the fact that the status can be changed back to the same status many times on one request. As of now I simply have Salesforce timestamping when we enter and leave each stage and providing the time in the status. Easy and simple but not telling us what we want as we want the sum of all the times that request went into each status. As it is now, each time it goes back into that status it overwrites the fields and starts counting again.
 
I have exhausted all avenues and I think this is not possible, but wanted to ask those who are much smarter than I and have much more Salesforce experience. I am happy to provide more details if need be. Thank you!
 
Best Practice : When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.

User-added image


      That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it. 

Thanks #Copy_Steve Molis
I tried doing some administrative cleanup, to get rid of some fields that were required and now aren't, and now we can't save changes in opportunities due to a Flow Trigger error ID 301U00000000ha5... now none of my team can update their opportunities