• SEKAR RAJ 19
  • NEWBIE
  • 202 Points
  • Member since 2019
  • Sr.Salesforce Developer
  • Zen Cloud Technologies

  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 48
    Replies
Hello,

I have a usecase for docusign, where a marketing guy/girl clicks on a doc and once the doc is opened a customer signs it and once signed, an email is sent.

What are various bricks or what is solution in decomposed maner.

Thank you for suggestion
global class ABI_SFA_TAC_Removal_Batch implements Database.batchable<sObject>
{    
    // variable decleration.
    public String Query;
               
     /* 
     Method Name: Start
     Description: This method is used to collect the TAC records ready for deletion.     
    */
    global Database.QueryLocator Start(Database.BatchableContext info)
    { 
       // fetch TAC records ready for removal.
        
		String Query = 'SELECT ABI_SFA_Account_Removal__c,ABI_SFA_Account__c,ABI_SFA_RecordID__c,ABI_SFA_SHAREID__c, ABI_SFA_Type__c,ABI_SFA_User__c,ABI_SFA_Valid_Till__c,CreatedById,CreatedDate,CurrencyIsoCode,Id,IsDeleted,LastModifiedById,LastModifiedDate,Name,OwnerId,SystemModstamp FROM ABI_SFA_TerritoryAccountChange__c WHERE ABI_SFA_Account__r.name like '%Europromotion%' LIMIT 50000';
       
       return Database.getQueryLocator(query);  
    }
      
    /*
     Method Name: Execute
     Description: This method is used to process the TAC records that are passed from Start method.   
    */     
    global void Execute(Database.BatchableContext info, List<ABI_SFA_TerritoryAccountChange__c> tacList)
    {
	    if(tacList!=Null && tacList!=Empty){
			System.debug('@@@inside IF block');
			try {
				System.debug('@@@inside TRY block');
				Database.DeleteResult[] TAC_Dels = Database.delete(tacList);
			}
			catch (DmlException e) {
				System.debug('@@@ The following exception has occurred: ' + e.getMessage());
				ApexPages.addMessage(myMsg);
				ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,<strong>string.valueof(e)</strong>); 
			}
	    }
    }
	
	
    /*
     Method Name: Finish
     Description: This method is used to notify all relevant stakeholders via Email.      
    */       
    global void Finish(Database.BatchableContext info){ 

		String Email;
		List<ID> tacERId = new List<ID>();
		public void SendEmail() {
		for(TACEmailRecipients__c tacER: TACEmailRecipients__c.getAll().values());{
			tacERId.add(tacER.Id);
		}
		
		EmailTemplate et=[Select id from EmailTemplate where name = 'TAC_Notification' limit 1];

		Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
		mail.setTargetObjectIds(tacERId);
		mail.setSenderDisplayName('Acenture Support Team');
		mail.setTemplateId(et.id);
		Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
}
                 
    }   
}

 
Error:Apex trigger Test caused an unexpected exception, contact your administrator: Test: execution of AfterUpdate caused by: System.StringException: Invalid id: Dickenson Mobile Generators: Trigger.Test: line 8, column 1
Scenario: whenever the stage field changed to Close won in opportunities , a new object record (Litrack__c)should be created.
Code:
trigger Test on Opportunity (after update) {
    Map<Id,Litrack__c> LitInsert= new Map<Id,Litrack__c>();
    for(Opportunity opNew: Trigger.new){
        for(Opportunity opOld: Trigger.old){
            if(opNew.StageName!=opOld.StageName && opNew.StageName=='Closed Won'){
                Litrack__c Record = new Litrack__c();
                Record.Name=opNew.id;
                Record.Opportunity_Lookup__c=opNew.Name;
                LitInsert.put(Record.id,Record);
            }
        }
      
                insert LitInsert.values();
             
}
}
I have an end user who is asking me to create a formula to do the following and I'm not even sure this is possible, so I'm asking for some input from the community if this formula can even be created

The formula she is requesting is this:

If Ground Break Photos Upload Date >/= -14 days from Ground Break Date then Ground Break Report Due = Ground Break Date -7 days. 

I've tried using the >= - 14  but I get an error message. I think it because of the Ground Break Photos Upload Date is a Date/Time field. So I'm not sure how to create a formula to handle that. 

Any help is greatly appreciated. 

Thanks,

Glenn
Hi All,
My test class is given below:-
// Test class for BatchResellerPartnerToResellerCustomer
@isTest
private class BatchResellerCustomerTest {
static testmethod void TestResellerCustomer(){
// Check the API Name
Id recId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Time Rack').getRecordTypeId();
Account acc =new Account( Name = 'test' ,Customer_Type__c ='Reseller' ,recordtypeid = recId );
insert acc;
//List<Opportunity> oppList = new List<Opportunity>();
// Opportunity Name with '-'
Opportunity opp = new Opportunity();
opp.StageName = 'Sourcing Demand';
opp.AccountId = acc.id;
opp.CloseDate = System.today();
opp.Name = 'test -ExPay';
insert opp;
// Opportunity Name with ':'
Opportunity oppt = new Opportunity();
oppt.StageName = 'Sourcing Demand';
oppt.AccountId = acc.id;
oppt.CloseDate = System.today();
oppt.Name = 'test :RePay';
insert oppt;
//opportunity Name other than '-' and ':'
Opportunity oppty = new Opportunity();
oppty.StageName = 'Sourcing Demand';
oppty.AccountId = acc.id;
oppty.CloseDate = System.today();
oppty.Name = 'test Pay';
insert oppty;
test.startTest();
BatchResellerPartnerToResellerCustomer obj = new BatchResellerPartnerToResellerCustomer();
database.executeBatch(obj);
Set<Id> OppIds = new Set<Id>();
OppIds.add(opp.Id);
BatchResellerPartnerToResellerCustomer.run(OppIds);
test.stopTest();
}
}
how to put Asserts in this test class to make it better?
Any suggestions?
I recently started using related contacts and I have been setting up contacts that related to multiple accounts, but I want to easily be able to see a list of the accounts they are related to.  Ideally I would love to click on the contact name and have them listed on the contact card or something similar.
I have to query and update a remote site setting after sandbox refresh. Is anyone know how to query remote site settings records?
I have been messing around with the LWC OSS Components (https://lwc.dev/)... 

But I am a little lost, I assumed there would have been a straight forward way of retrieving data from a DB or even from Salesforce...

I wanted to use something like Passport along with Mongoose (NodeJS modules), to authenticate then to retrieve data from a MongoDB, to then display stuff out there... but I can't seem to get this to work and I can't find any info online about this yet either :/
Hello,

I have a usecase for docusign, where a marketing guy/girl clicks on a doc and once the doc is opened a customer signs it and once signed, an email is sent.

What are various bricks or what is solution in decomposed maner.

Thank you for suggestion
Hi,

I am in Lightning and I am currently using Salesforce's standard functionality of adding products on an opportunity.

As we have different types of products, when the users are selecting the products from the Add Products page and click the button Next, I want to be able to hide a Lookup field to a custom object I have created on the OLI - depending on the type of product selected. 

Also, when the Lookup field is showing on the OLI for some of the products, I want to prepoluate another two fields from the OLI with the values of the records from the Lookup field.

Is it possible to achieve this only by creating an Apex code? Without having to create a Visualforce page?


Thanks a lot.
can i pass variables of one ampscript to another, i want to set value for a variable in one ampscript and want to use the same variable in another ampscript.
Hello,

I have the contract standard object which has several record types.
in case i have the record type vendor purchases the user will need to insert another contract code. So contract standard obejct has a look up field to itself.
I would like in case i have the record type vendor-purchases, when i insert the contract code it is related with, to automatically insert the Account id.
This is what i've dove done but i get error " A non foreign key field cannot be referenced in a path expression: Maintenance_Contract__c at line 8 column 27"
trigger Vendor on Contract (before insert,before update) {
    
    for (Contract c : Trigger.new)
    {
        
        if (c.RecordTypeId=='0120Q0000004gQO')
        {
            c.AccountId=c.Maintenance_Contract__c.AccountID;
        }
        
        
    }
}

An example of the layout
User-added image
Hello Developer,

My  Http callouts in batch class not working.

But normal class working fine 

I converted my lightning:combobox into slds combobox to use data attributes, now, dropdown is not showing. Please help me.

And also, how to put the selected item into input textbox?

<aura:attribute name="myObject" type="List"/>
<aura:attribute name="myCustomSettings" type="MyCustomSettings__c[]"/>

<aura:iteration items="{!v.myCustomSettings}" var="obj" indexVar="index">
	<tr class="slds-hint-parent">
		<td role="gridcell" data-label="Object">
			<div class="slds-form-element slds-form-element__control">
				<div class="slds-combobox_container">
					<div aura:id="open" class="slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click" aria-expanded="true" aria-haspopup="listbox" role="combobox">
						<div class="slds-combobox__form-element slds-input-has-icon slds-input-has-icon_right" role="none">
							<input type="text" class="cellField slds-input slds-combobox__input" role="textbox" autocomplete="off" readonly="true"
									aura:id="allObjects"
									placeholder="-Select-"
									data-id="{!'index-' + index + 1}"
									data-value="{!index + 1}"
									value="{!obj.Object__c}"
									onfocus="{!focus}"/>
							<span class="slds-icon_container slds-icon-utility-down slds-input__icon slds-input__icon_right">
								<lightning:icon class="slds-icon slds-icon-text-default slds-icon_xx-small" iconName="utility:down" size="xx-small" variant="brand" />
							</span>
						</div>
						<div aura:id="options" class="slds-dropdown slds-dropdown_length-5 slds-dropdown_fluid" role="listbox">
							<ul class="slds-listbox slds-listbox_vertical" role="presentation">
								<aura:iteration items="{!v.myObject}" var="myLst" indexVar="i">
									<li aura:id="selectObj" role="presentation" class="slds-listbox__item" onclick="{!c.itemSelected}" data-id="{!'index-' + i + 1}" data-value="{!i + 1}">
										<div id="{!i + 1 + '-item'}" aura:id="is-selected" class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="option">
											<span class="slds-media__figure slds-listbox__option-icon"></span>
											<span class="slds-media__body">
												<span class="slds-truncate" title="{!myLst.label}">{!myLst.label}</span>
											</span>
										</div>
									</li>
								</aura:iteration>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</td>
	<tr>
<aura:iteration/>
 
focus : function (component, event, helper) {
	var open = component.find("open");
	$A.util.toggleClass(open, 'slds-is-open');
},
 
itemSelected : function(component, event, helper) {
        var selectedItem = event.currentTarget;
        var id = selectedItem.dataset.id;
        var elements = component.find('selectObj');
        for (var i = 0; i < elements.length; i++) {
            var val = elements[i].getElement().getAttribute('data-id');
            if(val == id) {
                console.log(val);
                //put the selected item to input textbox
            }
        }
    },
I have to query and update a remote site setting after sandbox refresh. Is anyone know how to query remote site settings records?
Hi every one,

i have one scenario we wont to write trigger account and contact will have lookup relation ship if contacts will added automatically in the account object one custom field count will be increse (like lookup relation ship)

how can we acchive this if any one know please help me.
Thank you
Surender Reddy
9603757105
 
Good morning folks,

I was wondering if its is possible to have a trigger on attachment whereas it would check if the record already has an attached file, and if so it would give an error and would not allow anymore files to be attached on said record.

And if the latter is indeed possible what should the trigger be counting? Attachments or Contentdocument?

Thanks in advanced for the help.
Hi All,

I want to include a button to create new contact in lightning component, Could some one provide the logic for it.

Thanks in Advance.
I have added a custom button to Quote object including an IF conditional statement , when the statement is true it functions correctly however if false instead of showing error message statement I get URL No Longer Exists error - please see code below. What can I do to fix this?
{!IF( ISPICKVAL( Quote.Status , 'Approved') , 

URLFOR('/apex/dsfs__DocuSign_CreateEnvelope', null, [SourceID = Quote.Id, 
LF='1', 
CRL='Email~'+Quote.Email+';LastName~'+Quote.Full_Name__c+';Role~Signer 1,LoadDefaultContacts~0', 
OCO='Send' 
]), "Quote must be submitted for approval") 
}

 
I have an end user who is asking me to create a formula to do the following and I'm not even sure this is possible, so I'm asking for some input from the community if this formula can even be created

The formula she is requesting is this:

If Ground Break Photos Upload Date >/= -14 days from Ground Break Date then Ground Break Report Due = Ground Break Date -7 days. 

I've tried using the >= - 14  but I get an error message. I think it because of the Ground Break Photos Upload Date is a Date/Time field. So I'm not sure how to create a formula to handle that. 

Any help is greatly appreciated. 

Thanks,

Glenn
Hello, I am trying to create a custom list buttom to call a Visualforce Page, but I can't see the VF on the list when creating the button. I've checked out other similar questions in the developers Forums and I made sure the standardController for the object is already created. What else am I missing to call this VF page from the custom button? How can I can add this action/button to each record on the Master related list?
User-added image
I want the new custom button to apper in the related list for each record. See image below.

User-added image
in advance for your help!
Hi, 

I am relatively new to lightning and front-end development in general. I am trying to use lightning:fileUpload in a case creation form instead of a custom solution implemented before (the old one has the same design as described here: http://peterknolle.com/file-upload-lightning-component/), but I have encountered some issues.

We have a custom lightning component which opens inside a modal when "Create New Case" button is clicked. The form is the one in the picture, encircled in red there is lightnind:fileUpload file selector and this one below is the tag-related code:
<fieldset class="slds-form--compound">
                <legend class="slds-form-element__label">Attachments</legend>   
                <div class="form-element__group">
                       <lightning:fileUpload label="Add attachment" 
                                             multiple="{!v.multiple}" 
                                             recordId="{!v.recordId}" 
                                             onuploadfinished="{!c.handleUploadFinished}" />
                </div>
 </fieldset>


Custom Case Creation Form

The main issue is that when I choose the file to upload, this modal shows up behind the case modal:
Lightning:fileUpload Modal
 
I couldn't find a way to change this behavior using CSS (z-index) and I am not even sure it is the right way to go.
Is there any way to control lightning:fileUpload behaviour, maybe auto-closing the modal after the file has been uploaded?
Thanks!
 
Dear All,
 Users need to enter data in a report column so that data will be entered all at once in the table of the underlining object that is used to create the report. Report is built with many filters.
Can we convert report to list view using Salesforce Classic View ?
Thanks a lot