• Shruti Nigam
  • NEWBIE
  • 80 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 12
    Replies
What are the features available in Salesforce CPQ that are not available on Salesforce?
Why to use Salesforce CPQ and not Salesforce CRM?
If we can create salesforce cpq manually then why to use salesforce cpq in salesforce.
Hi all,

I had saved video in attachment obect and i want to display that video in vf page anyone know how to do it ?
Hi all,

I need to add page number from specific page  in the pdf page.
Thanks in advance
Hi all,

I need to add gif in the pdf page.
I tried to add but it is not working anyone know what is the issue ?

Thanks in advance
Hi all,

I had created ligtning button in uising lightning:button and i want to show error on it.
Anyone know how to do it?

I tried this but it dosen't work
var op = component.find("button1");
op.set("v.errors", [{message:"Select any one option"}]);

Thanks in advance
Hello Everyone I need to create dependent radiobutton just like dependent picklist using flow builder  Can anyone help me out??
Hi all,
I have created a batch class but still i am getting error "First error: Too many Email Invocations: 11" .

Can anyone solve this issue.
Below is my batch class.
global class batchexpense implements Database.Batchable<sObject> {
    
    global Database.QueryLocator start(Database.BatchableContext BC){
        
       String query = 'Select Name_of_Employee__c from Expense_Management__c where CreatedDate = LAST_N_DAYS:15';
       return Database.getQueryLocator(query);
     }
    
	global void execute(Database.BatchableContext BC, List<Expense_Management__c> scope){
   		Set<String> myset = new Set<String>();
		for(Expense_Management__c aa : scope)
		{
  			myset.add(aa.Name_of_Employee__c);  
		}    
				
		
   		 for(Expense_Management__c cc : [select id,Name_of_Employee__r.email,Name_of_Employee__c from Expense_Management__c WHERE Name_of_Employee__c =: myset ])
        {
         
            list<Messaging.SingleEmailMessage> mails =  new List<Messaging.SingleEmailMessage>();  
            Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
			Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();
            PageReference pref = page.ExpenseReport;
            pref.getParameters().put('Id',cc.Name_of_Employee__c );
            pref.setRedirect(true);
             Blob b;
             if(Test.isRunningTest()) { 
                b = blob.valueOf('Unit.Test');
            } else {
                b = pref.getContent();
            }
            attach.setFileName('Expense.pdf');
            attach.setBody(b);
            semail.setSubject('Expense details');
            semail.setSaveAsActivity(true);
         
            semail.setReplyTo('noreply@gmail.com');
            semail.setSenderDisplayName('salesforce User');
            semail.setWhatId(cc.Id);
     
            
            List<String> sendTo = new List<String>();//to string
           	sendTo.add(cc.Name_of_Employee__r.email);
            semail.setToAddresses(sendTo);
           
            mails.add(semail);
            String emailBody =' <html><body><p> Dear  ,<br><br> Please find the attached Expense details. <br><br>    Regards, <br> IT Team <br>  Sayaji Groups.</p></body></html>';
            semail.setHtmlBody(emailBody);
            semail.setFileAttachments(new Messaging.EmailFileAttachment[]{attach});
            Messaging.sendEmail(new Messaging.SingleEmailMessage[]{semail});
        }
     }
    
    	global void finish(Database.BatchableContext BC){
        
    	}
}

Thanks in advance
Hi all,
I have created lightning home page using lightning app builder and placed it on a app.

When i click on a tab it showing error.
"Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 2036862306-1598 (-965828326)"


Anyone know why i am facing this issue..??
Thanks in advance.
Hi all,

I have given my code for securtiy scan and i have following error for stored XSS.

I had solved most of the error but stuck on this.

Anyone know how to solve this ?
Object: select in file: classes/DetailTemplate.cls
L 59: Activity_Template__c acti = [Select Template_Type__c,For_Which_Object__c,All_Day_Event__c from Activity_Template__c Where Id =: ApexPages.currentPage().getParameters().get('id')];

Object: template_type__c in file: classes/DetailTemplate.cls
L 60: typestring = acti.Template_Type__c;

Object: forobjectval187 in file: pages/DetailTemplate.page
L 71: if('{!typestring}' == "Appointment"){

Object: typestring in file: classes/DetailTemplate.cls
L 4: public string typestring{get;set;}

Object: gettypestring in file: pages/DetailTemplate.page
L 71: if('{!typestring}' == "Appointment"){


Thanks in advance.
 
Hi all,

I want to stop execution in Visualforce.remoting.Manager.invokeAction after displaying alert.

Below is my code
Visualforce.remoting.Manager.invokeAction(
                            '{!$RemoteAction.demotest.checkdata}',test,d1,d2,function(result, event)
                  {
                      debugger;
                      if (event.status == true) 
                          {
                              
                          		if(result == null || result == " " || result == "")
                                    {
                                    		alert('No record found');
			                       // I want to stop execution here.
                                    }
                              
                          }
                      
                      else 
                      {
                      
                      }},
                 {escape:true});

Thanks in advance
Hi all,
in my lightning controller i want to stop execution after displaying error.
but right now after displaying error it moves further.

Anyone know how to stop execution

In below code i am comparing two dates
var fromCmp = component.find("From_date");
var fromCmpval = fromCmp.get("v.value");
var toCmp = component.find("To_date");
var toCmpval=toCmp.get("v.value");



if (fromCmpval > toCmpval) 
                {
                  
          toCmp.set("v.errors", [{message:"To Date should be Less then To Date"}]);

//here i want to stop execution after displaying error
               }


Thanks in advance.
Hi all,
Need help on this apex class getting sql governor limit.
 
public class salesprice {

    
    public static void price(Id recordsales)
    {	
     	try
     	{
        	Account ac = [Select id,percent_increase1__c,FB_NET_ARR1__c from Account where id =:  recordsales ];
     		for( Opportunity  ap : [Select id,Type from Opportunity where AccountId  =: ac.Id ])
            {
         		if(ap.Type == 'Renewal')
            	{
                	List<OpportunityLineItem> ab = [Select id,ProductCode from opportunityLineitem where opportunityId =: ap.Id ];
                	if(ab[0].ProductCode == '002')
                    {
                		ab[0].UnitPrice = ac.percent_increase1__c * ac.FB_NET_ARR1__c;
     	   				update ab;
                    }
            	}
            }     
     }
     catch(Exception e)
     {
         System.debug(e);
     }
    }
}

Trigger to call above class:
trigger updateproduct on Account (after insert,after update) {
     
    for(Account a: Trigger.new)
    {
   			 salesprice.price(a.Id);
    }
}

Thanks in advance
Hi all,

I want to write a trigger in Account to update and create opportunity product when account is created.
There is 2 field in account amount1 and amount2.
If both field is not equal to null then a new record is created  total amount=amount1*amount2 in prouct

Thanks in advance

Can anyone please help me with this situation?User-added image
Hi all,

Is there any way we can write soql query in lightning controller,js ?

Thanks in advance
Hi all i used lookup relationship and i am locking child record using this trigger.
The following trigger prevents any changes to the children while this Locked__c box is checked:
trigger DetailLockCheck on Detail__c (before delete, before insert, before update) {

     Set<Id> masterIdSet = new Set<Id>();

     for (Detail__c each : trigger.new)
          masterIdSet.add(each.Master__c);

 

     Map<String, Boolean> masterMap = new Map<String, Boolean>();

 

     for (Master__c each : [select Id, Locked__c from Master__c where Id in :masterIdSet])
          masterMap.put(each.Id, each.Locked__c);

     for (Detail__c each : trigger.new) {
          if (masterMap.get(each.Master__c))
               each.addError('Master Record is Locked. Details cannot be created, edited, or deleted.');
     }
}

What i want to do is that i need to able to edit record for some profile.


Thank you.
Hi all,

I have created a Visualforce page but not able to add in list view as lightning quick action.

Anyone know what is the problem?
trigger OrderTrigger on Order_Line_Item__c (before delete, before update) {
    Set<Id> orderIdSet=new Set<Id>();
    
    for(Order_Line_Item__c ord:Trigger.new)
        orderIdSet.add(ord.Order__c);
    
    Map<String,Boolean> orderMap= new Map<String,Boolean>();
    
    for(Order__c ord:[Select Id,Locked__c from Order__c where Id in :orderIdSet])
        orderMap.put(ord.Id,ord.Locked__c);
    
    for(Order_Line_Item__c ord:Trigger.new)
        if(orderMap.get(ord.Order__c))
        ord.addError('Master Record is Locked. Details cannot be created, edited, or deleted.');
}

Trigger to locked child record based on checkbox "Locked__c" present in Parent object
Hi all,

I need to send email to the record owner after every 7 days which contains data of last six days.

Thanks in advance
What are the features available in Salesforce CPQ that are not available on Salesforce?
Why to use Salesforce CPQ and not Salesforce CRM?
If we can create salesforce cpq manually then why to use salesforce cpq in salesforce.
Hi all,

I need to add gif in the pdf page.
I tried to add but it is not working anyone know what is the issue ?

Thanks in advance
Hi all,
I have created lightning home page using lightning app builder and placed it on a app.

When i click on a tab it showing error.
"Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 2036862306-1598 (-965828326)"


Anyone know why i am facing this issue..??
Thanks in advance.
trigger OrderTrigger on Order_Line_Item__c (before delete, before update) {
    Set<Id> orderIdSet=new Set<Id>();
    
    for(Order_Line_Item__c ord:Trigger.new)
        orderIdSet.add(ord.Order__c);
    
    Map<String,Boolean> orderMap= new Map<String,Boolean>();
    
    for(Order__c ord:[Select Id,Locked__c from Order__c where Id in :orderIdSet])
        orderMap.put(ord.Id,ord.Locked__c);
    
    for(Order_Line_Item__c ord:Trigger.new)
        if(orderMap.get(ord.Order__c))
        ord.addError('Master Record is Locked. Details cannot be created, edited, or deleted.');
}

Trigger to locked child record based on checkbox "Locked__c" present in Parent object
Hello I want to know to how to send and email notification in the particular scenario where I have create one object in which there are two fields previous owner and new Owner and the situation is that when inm updating account billing postal code Im getting previous owner the one before updating and in new owner im getting value after updating
and now I want to send email notification to both new Owner and Previous Owner telling them there respective place
Previous and new Owner are having static value stored in Users in salesforce
Can anyone help me in this scenario??
Field NameField TypeDescription
Previous OwnerLookup (User)The prior sales rep assigned to this Account
New OwnerLookup (User)The new sales rep assigned to this Account
Previous TerritoryLookup (Territory__c)The matching Territory__c record for the prior zip code
New TerritoryLookup (Territory__c)The matching Territory__c record for the new zip code
AccountMaster-Detail (Account)The related Account record
Changed ByLookup (User)The user who changed the BillingPostalCode
Hi I want to perform this scenario Multiple sales representatives can be assigned to the same zip code territory. If this is the case, use a random function to select one of the assigned sales representatives  Object is Territory__c
Inside this object : 
Records  
Zip CodeSales Representative
91000Blake
91001Blake
91002Blake
91002Jacqueline
91010Jacqueline
91020Jacqueline
92010Denise
92020Aaron
           Can anyone please help me out??