-
ChatterFeed
-
1Best Answers
-
12Likes Received
-
0Likes Given
-
22Questions
-
35Replies
Map Your Workflow Actions to Process Actions - "Create contract for closed opportunity" isn't properly configured
Challenge Not yet complete... here's what's wrong: A Create a Record action for the Closed Won criteria node isn't properly configured. Make sure that it creates a draft contract according to the instructions in the ‘Create contract for closed opportunity’ task action. Make sure that Start Date is set by using a formula.
I've gone over all of the workflow tasks information to recreate the contact. If I activate the process and close an opportunity, it creates a contract with the expected information and the date is 1mo away with 12mo term. The workflow's task (which is the template for the actual contract) specifies the following:
Use the closed opportunity to create a contract for the associated account. Account: The account associated with this opportunity Status: Draft Contract Start Date: 1 month from today Contract Term: 12Here are my actions:
The Contract Start Date is set to the following formula:
DATE( YEAR(Today()) + FLOOR((1 + MONTH(Today())) / 12) - IF (MOD(MONTH(Today()) + 1, 12) = 0, 1, 0), MOD((1 + MONTH(Today()) - 1), 12) + 1, DAY(Today()) )
Again, for all practical purposes I'm passing this, as it functions and the contract is created. But I must be missing some small detail, named field, something that's tripping up the validation settings. Any help is appreciated!
-
- David Hickman 15
- March 29, 2017
- Like
- 0
- Continue reading or reply
Getting a "We can’t find 'reduceErrors' imported into contactList.js." in the Handle Server Error Trailhead
https://trailhead.salesforce.com/en/content/learn/modules/lightning-web-components-and-salesforce-data/handle-server-errors?trail_id=build-lightning-web-components
I am attempting to allow for error handling and write my code as follows
ContactList.js
import { LightningElement, wire } from 'lwc'; import { reduceErrors } from 'c/ldsUtils'; import getContactList from '@salesforce/apex/ContactController.getContactList'; export default class ContactList extends LightningElement { @wire(getContactList) contacts; handleSelect(event) { // 1. Prevent default behavior of anchor tag click which is to navigate to the href url event.preventDefault(); // 2. Create a custom event that bubbles. Read about event best practices at http://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.events_best_practices const selectEvent = new CustomEvent('contactselect', { detail: { contactId: event.currentTarget.dataset.contactId } }); // 3. Fire the custom event this.dispatchEvent(selectEvent); } get errors() { return (this.accounts.error) ? reduceErrors(this.accounts.error) : []; } }
contactList.html
<template> <template if:true={contacts.data}> <template if:true={errors}> <p>{errors}</p> </template> <template for:each={contacts.data} for:item="contact"> <a href="#" key={contact.Id} data-contact-id={contact.Id} onclick={handleSelect} > <lightning-layout> <lightning-layout-item> <img src={contact.Picture__c} alt="Profile photo" /> </lightning-layout-item> <lightning-layout-item padding="horizontal-small"> <p>{contact.Name}</p> </lightning-layout-item> </lightning-layout> </a> </template> </template> </template>
ContactController.cls
public with sharing class ContactController { @AuraEnabled(cacheable=true) public static List<Contact> getContactList() { throw new AuraHandledException('Forced error'); /*return [ SELECT Id, Name, Title, Phone, Email, Picture__c FROM Contact WHERE Picture__c != null WITH SECURITY_ENFORCED LIMIT 10 ];*/ } @AuraEnabled(cacheable=true) public static List<Contact> findContacts(String searchKey) { String key = '%' + searchKey + '%'; return [ SELECT Id, Name, Title, Phone, Email, Picture__c FROM Contact WHERE Name LIKE :key AND Picture__c != null WITH SECURITY_ENFORCED LIMIT 10 ]; } @AuraEnabled(cacheable=true) public static Contact getSingleContact() { return [ SELECT Id, Name, Title, Phone, Email, Picture__c FROM Contact WITH SECURITY_ENFORCED LIMIT 1 ]; } }
But I get this error We can’t find 'reduceErrors' imported into contactList.js. Any steps I need to take here.
-
- MedhanieHabte
- July 06, 2020
- Like
- 0
- Continue reading or reply
Einstein Analytics and Disscovery Insights Specialist - Step 3 - Trailhead Error
Challenge Not yet complete... here's what's wrong:
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: ALJNAPDO
Close errors
My Dashboard looks good but oddly It may be tied to something I might be missing with the Tenure Length, not sure.
-
- MedhanieHabte
- May 03, 2019
- Like
- 0
- Continue reading or reply
Getting to 100 percent code coverage on my trailhead module “Write Negative Tests Unit”
My code is as follows.
Calculator Class
public class Calculator { public class CalculatorException extends Exception{} public static Integer addition(Integer a, Integer b){ return a + b; } public static Integer subtraction(Integer a, Integer b){ return a - b; } public static Integer multiply(Integer a, Integer b){ if(b==0 || a==0){ throw new CalculatorException('It doesn\'t make sense to multiply by zero'); } return a * b; } public static Decimal divide(Integer numerator, Integer denominator){ if(denominator == 0){ throw new CalculatorException('you still can\'t divide by zero'); } Decimal returnValue = numerator / denominator; if(returnValue < 0){ throw new CalculatorException('Division returned a negative value.' + returnValue); } return returnValue; } }
And my test class as follows
@isTest public class Calculator_Tests { @isTest public static void addition() { Calculator.addition(1, 0); } @isTest public static void subtraction() { Calculator.subtraction(1, 0); } @isTest public static void divide_throws_exception_for_division_by_zero() { Boolean caught = false; try { Calculator.divide(1, 0); } catch (Calculator.CalculatorException e) { System.assertEquals('you still can\'t divide by zero', e.getMessage(), 'caught the right exception'); caught = true; } System.assert(caught, 'threw expected exception'); } @isTest public static void divide_throws_exception_for_division_by_two() { Boolean caught = true; try { Calculator.divide(1, 2); } catch (Calculator.CalculatorException e) { System.assertEquals('you still can\'t divide by zero', e.getMessage(), 'caught the right exception'); caught = true; } System.assert(caught, 'threw expected exception'); } @isTest public static void multiply_by_one() { Boolean caught = false; try { Calculator.multiply(1, 0); } catch (Calculator.CalculatorException e) { System.assertEquals('It doesn\'t make sense to multiply by zero', e.getMessage(), 'caught the right exception'); caught = true; } System.assert(caught, 'threw expected exception'); } @isTest public static void multiply_by_two() { Boolean caught = true; try { Calculator.multiply(1, 2); } catch (Calculator.CalculatorException e) { System.assertEquals('It doesn\'t make sense to multiply by zero', e.getMessage(), 'caught the right exception'); caught = true; } System.assert(caught, 'threw expected exception'); } }
-
- MedhanieHabte
- January 22, 2019
- Like
- 4
- Continue reading or reply
Flow to create or update multiple records
First, in the Record Lookup step, I just add the Contact Id and assign that to a sObject variable, where I get the record Id, mailing state and a custom field called Federal District.
Then I do a fast lookup where I take the fields in the sObject variable to lookup an account that has the same federal district or is a senator in that state. This is under a field called Congressional Position.
Then another Fast Lookup where we locate affiliation records where the account Id from the account (lawmaker) fast lookup and contact id from the contact fast lookup matches. The goal now is to determine if a contact already has a record with a congressperson and if not, create a new one.
For affiliation records that exist, we update those records. For those that don't, we create a new record. At the end of the flow, a contact will now be affiliated with two senators and one congress member.
However, while the flow works great, it sometimes creates duplicates senate or congressional records instead of updating them. I have the flow running on a process that checks if a contact is new or has had the congressional district field updated. Are there any steps I can take or any clarity on how I can have the flow only create records for affiliations that don't exist and just update for those that do.
-
- MedhanieHabte
- March 02, 2018
- Like
- 0
- Continue reading or reply
Stuck on the Use the Salesforce Lightning Design System to Style Visualforce Pages trailhead
-
- MedhanieHabte
- September 08, 2017
- Like
- 1
- Continue reading or reply
Using Split string to determine which words are found in a set
I tried using the .split method in my string, but get this error that such methods don't exist, any steps I should take.
triggers/CheckSecretInformation.trigger: Method does not exist or incorrect signature: void split(String) from the type Set<String>
trigger CheckSecretInformation on case (after insert, before update) { String childCaseSubject = 'Waring: Parent case may contain secret info'; // Step 1: Create a collection containing each of our secret keywords Set<String> secretKeywords = new Set<String>(); secretKeywords.add('Credit Cards'); secretKeywords.add('Social Security'); secretKeywords.add('SSN'); secretKeywords.add('Passport'); secretKeywords.add('Bodyweight'); // Step 2: Check to see if our case contains any of the secret words List<Case> casesWithSecretInfo = new List<Case>(); for(Case myCase : Trigger.new){ if (myCase.Subject != childCaseSubject) { for (String Keyword : secretKeywords) { if(myCase.Description != null && myCase.Description.containsIgnoreCase(Keyword)) { casesWithSecretInfo.add(myCase); System.debug('Case ' + myCase.Id + ' include secret keywords' + keyword); break; } } } } // Step 3: If our case contains a secret keyword, create a child case List<Case> casesToCreate = new List<Case>(); System.debug('Size of offending cases: ' + casesWithSecretInfo.size()); for (Case casesWithSecretInfo : casesWithSecretInfo) { Case childCase = new Case(); childCase.Subject = childCaseSubject; childCase.ParentId = casesWithSecretInfo.Id; childCase.IsEscalated = true; childCase.Priority = 'High'; childCase.Description = 'At least one of the following keywords were found:' + secretKeywords.split(;); casesToCreate.add(childCase); } insert casesToCreate; }
-
- MedhanieHabte
- August 12, 2017
- Like
- 0
- Continue reading or reply
Stuck on Step 7 Process Automation Superbadge
Hi all, I am so close to finishing this process automation badge but am stuck in one area in Step 7.
I've built out my process builder as follows
And my date formula as follows
Case(MOD(Date__c-DATE(1900,1,7),7),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5, "Friday",6,"Saturday", "")
Challenge Not yet complete... here's what's wrong: The Robot Setup Day of the Week formula does not seem to be working properly. The Day of the Week should not fall on Saturday or Sunday.
It works nicely but doesn't seem to pass, what could be up.
-
- MedhanieHabte
- July 28, 2017
- Like
- 2
- Continue reading or reply
Build a 3D VR App Trailhead: Building Failed - Unable to list target platforms
I am working on a 3D Virtual Reality app Trailhead and seem to be stuck with building out the app. I encounter this error.
"Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. See the Console for details."
Error:Invalid command android UnityEditor.PostprocessBuildPlayer:PrepareForBuild(BuildOptions, BuildTargetGroup, BuildTarget)
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/medhaniehabte/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" - stderr[ Error:
I have correctly set up android studio and SDK and assigned the right directory, but when I get to building, I am stuck, any steps I should take.
-
- MedhanieHabte
- April 22, 2017
- Like
- 0
- Continue reading or reply
Unable to install the Salesforce VR Toolkit on Unity
Assets/Salesforce/Components/Scripts/Trigger.cs(24,51): error CS0246: The type or namespace name `GazeInputModule' could not be found. Are you missing an assembly reference?
Anything that I am missing.
-
- MedhanieHabte
- April 03, 2017
- Like
- 2
- Continue reading or reply
Visual Workflow or Form Collection tool to prefill data from a R database
Our organization is using a Shiny R map to display data from various locations across the region. We chose the Shiny R map as it enables us to display more records than our salesforce org could handle. In essence, a customer can click a location which determines if a location exists, if so, the customer can then view data on the record. If not, a customer can create a record with the data fields prefilled to create the record. Has anyone experimented with this process, are there any suggestions, that might make sense.
-
- MedhanieHabte
- March 07, 2017
- Like
- 0
- Continue reading or reply
Stuck on Data Integration Specialist Superbage #9
-
- MedhanieHabte
- February 19, 2017
- Like
- 0
- Continue reading or reply
Test Classes Not Passing - Null pointer exception - Superbadge Data Integration Specialist (Part 3)
Anything I should add to the code. I have built the process builder as needed.
Project Callout Service
public class ProjectCalloutService { public static Id opportunityId; @InvocableMethod public static void postOpportunityToPMS(List<Id> opportunityIds){ opportunityId=opportunityIds.get(0); Opportunity opp=[Select Id,Name, closeDate,amount,Account.Name FROM Opportunity Where Id =: opportunityId]; ID jobID = System.enqueueJob(new QueueablePMSCall(opp)); } public class QueueablePMSCall implements system.Queueable,Database.AllowsCallouts { private String jsonOpp; private Opportunity opportunityObject; public QueueablePMSCall(Opportunity opp) { opportunityObject=opp; JSONGenerator gen = JSON.createGenerator(true); gen.writeStartObject(); gen.writeStringField('opportunityId', opp.Id); gen.writeStringField('opportunityName', opp.Name); gen.writeStringField('accountName', opp.account.Name); gen.writeDateField('closeDate', opp.closeDate); gen.writeNumberField('amount', opp.amount); gen.writeEndObject(); jsonOpp= gen.getAsString(); System.debug('jsonOpp: ' + jsonOpp); } public void execute(QueueableContext context) { ServiceTokens__c token= ServiceTokens__c.getValues('ProjectServiceToken'); System.debug(token.Token__c); // create an HTTPrequest object HttpRequest req = new HttpRequest(); req.setMethod('POST'); req.setEndpoint('callout:ProjectService/'+ token.Token__c); req.setHeader('Content-Type', 'application/json'); req.setBody(jsonOpp); // create a new HTTP object Http http = new Http(); HTTPResponse res = http.send(req); if (res.getStatusCode() != 201) { System.debug('Error from ' + req.getEndpoint() + ' : ' + res.getStatusCode() + ' ' + res.getStatus()); Opportunity opportunity1=[Select Id, StageName FROM Opportunity Where Id =: opportunityObject.Id]; opportunity1.StageName='Resubmit Project'; update opportunity1; } else { Opportunity opportunity2=[Select Id, StageName FROM Opportunity Where Id =: opportunityObject.Id]; opportunity2.StageName='Submitted Project'; update opportunity2; } } } }Test Class
@isTest private class ProjectCalloutServiceTest { //Implement mock callout tests here public static testMethod void testSuccess(){ Account acc = new Account(Name='Test Account'); insert acc; Opportunity opp = new Opportunity(Name='Test Opportunity', AccountId=acc.id, CloseDate=System.Today(), Amount=12480.00, Type='New Project', StageName='Qualification'); insert opp; Test.startTest(); Test.setMock(HttpCalloutMock.class, new ProjectCalloutServiceMock()); Test.stopTest(); opp.StageName='Closed Won'; update opp; } public static testMethod void testFailure(){ Account acc = new Account(Name='Test Account'); insert acc; Opportunity opp = new Opportunity(Name='Test Opportunity', AccountId=acc.id, CloseDate=System.Today(), Amount=12480.00, Type='New Project', StageNAme='Qualification'); insert opp; Test.startTest(); Test.setMock(HttpCalloutMock.class, new ProjectCalloutServiceMockFailure()); Test.stopTest(); opp.StageName='Closed Won'; update opp; } }
HTTP Callout Success
global class ProjectCalloutServiceMock implements HttpcalloutMock{ //Implement http mock callout here global HttpResponse respond(Httprequest request){ HttpResponse response = new Httpresponse(); String resBody = '[Status=Created, StatusCode=201]'; response.setHeader('Content-Type','application/json'); response.setBody(resBody); response.setStatusCode(201); return response; } }HTTP Callout Fail
//ProjectCalloutServiceMockFailure global class ProjectCalloutServiceMockFailure implements HttpcalloutMock{ //Implement http mock callout failure here //Implement http mock callout here global HttpResponse respond(Httprequest request){ HttpResponse response = new Httpresponse(); String resBody = '[Status=Created, StatusCode=501]'; response.setBody(resBody); response.setStatusCode(501); return response; } }
-
- MedhanieHabte
- February 11, 2017
- Like
- 0
- Continue reading or reply
Stuck on Unit of Work Principles test in Trailhead
@isTest public class UnitOfWorkTest { @isTest static void challengeComplete(){ fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork( new Schema.SObjectType[]{ Account.SObjectType, Contact.SObjectType, Note.SObjectType } ); for (Integer i=0 ; i<100 ; i++) { Account a = new Account(Name= 'Test' + i); uow.registerNew(a); for (Integer j=0 ; j<5 ; j++) { Contact c = new Contact(LastName = 'Test'+i + ' ' +j); uow.registerNew(c, Contact.AccountId, a); Note n = new Note(Body='Test '+i + '' + j, Title='Test'+i+j); //uow.registerRelationship(n, Note.ParentId, a); //uow.registerNew(n, Note.ParentId, a); uow.registerNew(n, Note.ParentId, c); } } uow.commitWork(); fflib_SObjectUnitOfWork uow2 = new fflib_SObjectUnitOfWork( new Schema.SObjectType[]{ Account.SObjectType, Contact.SObjectType, Note.SObjectType } ); Id oldAccountId; Account a2; for (Contact c : [SELECT Id, LastName, AccountId, Account.Name, (SELECT Id, ParentId, Title, Body FROM Notes) FROM Contact Order By AccountId, Id]) { if (oldAccountId != c.AccountId) { oldAccountId = c.AccountId; a2 = new Account(Id=c.AccountId, Name='Test'); uow2.registerDirty(a2); } c.LastName = 'Test'; uow2.registerDirty(c); c.Notes[0].Body = 'Test'; uow2.registerDirty(c.Notes[0]); } test.startTest(); uow2.commitWork(); //uow.commitWork(); test.stopTest(); System.assertEquals(100, [Select Id from Account].size()); System.assertEquals(500, [Select Id from Contact].size()); System.assertEquals(500, [Select Id from Note].size()); } }
-
- MedhanieHabte
- December 18, 2016
- Like
- 0
- Continue reading or reply
Unable to get image to display in Insecure Remote Site Trailhead
I am using this as my code
<apex:image url="{!URLFOR($Resource.Challenge_Resources,'Challenge_resources/Castle.png')}" />
Are there any steps I should take, hope it helps.
-
- MedhanieHabte
- October 23, 2016
- Like
- 1
- Continue reading or reply
Creating a test class for an Opportunity Contact Role trigger
Here is my trigger
trigger CreateContactRole on Opportunity (after insert, after update) { //get the id of all involved accounts Set<ID> accountIds = new Set<ID>(); for(Opportunity opt:Trigger.New){ accountIds.add(opt.AccountId); } //get all contacts for those accounts list<Contact> contacts = new list<Contact>(); contacts = [select id, AccountId from Contact where AccountId in: accountIds order by createddate Limit 5000]; //organize these contacts by account Map<Id,List<Contact>> contactsByAccount = new Map<ID,List<Contact>>(); for(Contact c:contacts){ if(contactsByAccount.get(c.AccountId) == null){ contactsByAccount.put(c.AccountId,new List<Contact>()); } contactsByAccount.get(c.AccountId).add(c); } // check to see if the Opportunity already has a contact role. If it does, add to a set of Ids to exclude List<OpportunityContactRole> existingOCR = new List<OpportunityContactRole>(); Set<Id> existingOCRIds = new Set<Id>(); existingOCR = [select OpportunityId from OpportunityContactRole where OpportunityId in:Trigger.newMap.keySet() limit 5000]; for(OpportunityContactRole ocr:existingOCR) if(!existingOCRIds.contains(ocr.OpportunityId)) existingOCRIds.add(ocr.OpportunityId); //create the OpportunityContactRole objects list<OpportunityContactRole> lstOCR = new list<OpportunityContactRole>(); for(Opportunity opt:Trigger.New){ if(!existingOCRIds.contains(opt.Id) && contactsByAccount.get(opt.AccountId) != null){ Boolean firstContact = true; for(Contact c: contactsByAccount.get(opt.AccountId)){ OpportunityContactRole ocr = new OpportunityContactRole(OpportunityId=opt.id, ContactId=c.id); if(firstContact) { ocr.IsPrimary = TRUE; firstContact = FALSE; } lstOCR.add(ocr); } } } insert lstOCR; }
Here are the areas that don't appear to be covered, particularly the null pointer exception.
if(contactsByAccount.get(c.AccountId) == null){ contactsByAccount.put(c.AccountId,new List<Contact>()); } contactsByAccount.get(c.AccountId).add(c);
Boolean firstContact = true; for(Contact c: contactsByAccount.get(opt.AccountId)){ OpportunityContactRole ocr = new OpportunityContactRole(OpportunityId=opt.id, ContactId=c.id); if(firstContact) { ocr.IsPrimary = TRUE; firstContact = FALSE; } lstOCR.add(ocr);
And here is my test class
@isTest public class TestCreateContactRole { static testMethod void createAccount(){ Account a = new Account(); //First create the Account a.Name = 'Test Co.'; a.BillingStreet = '298 S. Ringo Street'; a.BillingCity = 'Little Rock'; a.BillingState = 'AR'; a.BillingPostalCode = '72201'; a.BillingCountry = 'USA'; a.Phone = '501-555-5555'; a.Website = 'www.testco.com'; a.Mission_Statement__c = 'We do lots of things'; a.Facebook_URL__c = 'www.facebooktest.com'; insert a; System.debug('created account'); //Then create a primary contact Contact c = new Contact(); c.FirstName = 'Paul'; c.LastName = 'Test'; c.AccountId = a.id; c.MailingStreet = '298 S. Ringo Street'; c.MailingCity = 'Little Rock'; c.MailingState = 'AR'; c.MailingPostalCode = '72201'; c.Primary_Membership_Contact__c = TRUE; insert c; System.debug('created primary contact'); //Then create another non-primary contact Contact ci = new Contact(); ci.FirstName = 'Bob'; ci.LastName = 'Test'; ci.AccountId = a.id; ci.MailingStreet = '298 S. Ringo Street'; ci.MailingCity = 'Little Rock'; ci.MailingState = 'AR'; ci.MailingPostalCode = '72201'; ci.Primary_Membership_Contact__c = FALSE; insert ci; System.debug('created primary contact'); //Now create an opportunity Opportunity o = new Opportunity(); o.RecordType = [SELECT Id, Name, DeveloperName FROM RecordType WHERE Name = 'Membership' LIMIT 1]; o.Name = 'New Record'; o.StageName = 'Posted'; o.Special_Case_for_Amount_Due__c = 'No'; o.Special_Case_for_Membership_End_Date__c = 'No'; o.CloseDate = Date.today(); o.npe01__Membership_Start_Date__c = Date.today(); o.npe01__Member_Level__c = 'Nonprofit 1'; o.Description = 'Test Record'; insert o; System.debug('created opportunity'); //Now update the OCR for the primary contact OpportunityContactRole ocr = new OpportunityContactRole(); ocr.ContactId = c.Id; ocr.OpportunityId = o.Id; ocr.IsPrimary = TRUE; ocr.Role = 'Decision Maker'; insert ocr; System.debug('created opportunity contact role for primary'); //Now update the OCR for the non-primary contact OpportunityContactRole ocr1 = new OpportunityContactRole(); ocr1.ContactId = ci.Id; ocr1.OpportunityId = o.Id; ocr1.IsPrimary = FALSE; ocr1.Role = 'Decision Maker'; insert ocr1; System.debug('created opportunity contact role for non-primary contact'); } }
I'm fairly new to Apex, but would love to learn more. Hope it helps.
-
- MedhanieHabte
- October 08, 2016
- Like
- 0
- Continue reading or reply
Stuck on prevent SOQL injection trailhead
Hope it helps.
public class Prevent_SOQL_Injection_Challenge { public string textOne {get; set;} public string textTwo {get; set;} public string comparator {get; set;} public string numberOne {get; set;} public List<Supply__c> whereclause_records {get; set;} public PageReference stringSearchOne(){ string query = 'SELECT Id,Name,Quantity__c,Storage_Location__c,Storage_Location__r.Castle__c,Type__c FROM Supply__c'; string whereClause = ''; if(textOne != null && textOne!=''){ whereClause += 'name like \'%'+textOne+'%\' '; } if(whereClause != ''){ whereclause_records = database.query(query+' where '+whereClause+' Limit 10'); } return null; } public PageReference stringSearchTwo(){ string query = 'SELECT Id,Name,Quantity__c,Storage_Location__c,Storage_Location__r.Castle__c,Type__c FROM Supply__c'; string whereClause = ''; if(textTwo != null && textTwo!=''){ whereClause += 'Storage_Location__r.name like \'%'+textTwo+'%\' '; } if(whereClause != ''){ whereclause_records = database.query(query+' where '+whereClause+' Limit 10'); } return null; } public PageReference numberSearchOne(){ string query = 'SELECT Id,Name,Quantity__c,Storage_Location__c,Storage_Location__r.Castle__c,Type__c FROM Supply__c'; string whereClause = ''; if(numberOne != null && comparator != null){ whereClause += 'Quantity__c '+comparator+' '+numberOne+' '; } if(whereClause != ''){ whereclause_records = database.query(query+' where '+whereClause+' Limit 10'); } return null; } }
-
- MedhanieHabte
- October 08, 2016
- Like
- 1
- Continue reading or reply
Prevent XSS is Force.com Application
<apex:page controller="XSS_Mitigations_Challenge" sidebar="false" tabStyle="XSS_Mitigations_Challenge__tab"> <apex:sectionHeader title="XSS Mitigations Challenge" /> <apex:form > <apex:pageBlock > <apex:pageMessages /> <apex:pageBlockSection title="Demo" columns="1" id="tableBlock"> <c:codeLink type="Visualforce" namespace="" edit="true" name="XSS_Mitigations_Challenge" description="Edit this Visualforce page to perform the challenge."/> <apex:outputText value="{!JSENCODE(sampleMergeField1)}"/> <apex:outputText value="{!HTMLENCODE(sampleMergeField2)}" escape="false"/> <apex:outputText > {!sampleMergeField3} </apex:outputText> <script> document.write('{!JSENCODE(sampleMergeField4)}'); </script> {!sampleMergeField5} <script> var x = '{!JSENCODE(sampleMergeField6)}'; </script> <apex:outputLabel value="{!sampleMergeField7}" escape="false"/> </apex:pageBlockSection> <apex:pageBlockSection title="Code links" columns="1"> <apex:outputPanel > <ul> <li><c:codeLink type="Visualforce" namespace="" name="XSS_Mitigations_Challenge" description="Visualforce Page"/></li> <li><c:codeLink type="Apex" namespace="" name="XSS_Mitigations_Challenge" description="Apex Controller"/></li> </ul> </apex:outputPanel> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
-
- MedhanieHabte
- October 04, 2016
- Like
- 0
- Continue reading or reply
Superbadge - Reports & Dashboards - Step 3 - Challenge Check Error
Challenge Not yet complete... here's what's wrong:
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: LELXAKDE
-
- MedhanieHabte
- September 22, 2016
- Like
- 0
- Continue reading or reply
Trigger for Opportunity ContactRole to notify Contact Owner of a new Opportunity
I am wondering if there is a way to create an Apex Trigger to notify a contact owner, when an opportunity is created with a primary contact populated in the contact role. We have a template available too, but worst case scenario, I can incorporate the message in Salesforce.
Hope it helps.
-
- MedhanieHabte
- June 03, 2016
- Like
- 0
- Continue reading or reply
Unable to close visualforce popup after record has been created
One of the initial issue we have encountered is the inability to look up or add contact records with quotes (') in their first or last name as part of the query. This returns an exception error. A step I took to address was to escapesinglequote, which allows for looking up contacts with ('). Now with Single Quote escaped, I am unable to close the popup when I create new records or select a record with a (') in the result. I'm certain this may have to do with the code in the VF page. I am wondering what steps I need to take.
Are there any steps, I can take to address. Class and Page attached below.
Class
public class ContactLookupControl { public Contact contact {get;set;} // new contact to create public List<Contact> results{get;set;} // search results public string searchString{get;set;} // search keyword public ContactLookupControl() { contact = new Contact(); // get the current search string searchString = System.currentPageReference().getParameters().get('lksrch'); runSearch(); } // performs the keyword search public PageReference search() { runSearch(); return null; } // prepare the query and issue the search command private void runSearch() { // TODO prepare query string for complex serarches & prevent injections results = performSearch(searchString); } // run the search and return the records found. private List<Contact> performSearch(string searchString) { String soql = 'select id, name,account.Name,MailingStreet,MailingCity,MailingState,MailingPostalCode,MailingCountry,Phone,Email from contact'; if(searchString != '' && searchString != null) soql = soql + ' where name LIKE \'%' + searchString +'%\''; soql = soql + ' limit 25'; System.debug(soql); return database.query(soql); } // save the new contact record public PageReference saveContact() { insert contact; contact=[select id,name,FirstName,LastName,AccountId,MailingStreet,MailingCity,MailingState,MailingPostalCode,MailingCountry,Phone,Email from contact where id=:contact.id]; // reset the contact //contact = new Contact(); return null; } // used by the visualforce page to send the link to the right dom element public string getFormTag() { return System.currentPageReference().getParameters().get('frm'); } // used by the visualforce page to send the link to the right dom element for the text box public string getTextBox() { return System.currentPageReference().getParameters().get('txt'); } }
Page
<apex:page controller="ContactLookupControl" title="Search" showHeader="false" sideBar="false" tabStyle="Contact" id="pg"> <apex:form > <apex:outputPanel id="page" layout="block" style="margin:5px;padding:10px;padding-top:2px;"> <apex:tabPanel switchType="client" selectedTab="name1" id="tabbedPanel"> <!-- SEARCH TAB --> <apex:tab label="Search" name="tab1" id="tabOne"> <apex:actionRegion > <apex:outputPanel id="top" layout="block" style="margin:5px;padding:10px;padding-top:2px;"> <apex:outputLabel value="Search" style="font-weight:Bold;padding-right:10px;" for="txtSearch"/> <apex:inputText id="txtSearch" value="{!searchString}" /> <span style="padding-left:5px"><apex:commandButton id="btnGo" value="Go" action="{!Search}" rerender="searchResults"></apex:commandButton></span> </apex:outputPanel> <apex:outputPanel id="pnlSearchResults" style="margin:10px;height:350px;overflow-Y:auto;" layout="block"> <apex:pageBlock id="searchResults"> <apex:pageBlockTable value="{!results}" var="a" id="tblResults"> <apex:column > <apex:facet name="header"> <apex:outputPanel >Name</apex:outputPanel> </apex:facet> <apex:outputLink value="javascript:top.window.opener.lookupPick2('{!FormTag}','{!TextBox}_lkid','{!TextBox}','{!a.Id}','{!a.Name}', false);self.close();" rendered="{!NOT(ISNULL(a.Id))}">{!a.Name}</apex:outputLink> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputPanel >Account Name</apex:outputPanel> </apex:facet> {!a.Account.Name} </apex:column> <apex:column > <apex:facet name="header"> <apex:outputPanel >Street</apex:outputPanel> </apex:facet> {!a.MailingStreet} </apex:column> <apex:column > <apex:facet name="header"> <apex:outputPanel >City</apex:outputPanel> </apex:facet> {!a.MailingCity} </apex:column> <apex:column > <apex:facet name="header"> <apex:outputPanel >State</apex:outputPanel> </apex:facet> {!a.MailingState} </apex:column> <apex:column > <apex:facet name="header"> <apex:outputPanel >Postal Code</apex:outputPanel> </apex:facet> {!a.MailingPostalCode} </apex:column> <apex:column > <apex:facet name="header"> <apex:outputPanel >Phone</apex:outputPanel> </apex:facet> {!a.Phone} </apex:column> <apex:column > <apex:facet name="header"> <apex:outputPanel >Email</apex:outputPanel> </apex:facet> {!a.Email} </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:outputPanel> </apex:actionRegion> </apex:tab> <!-- NEW CONTACT TAB --> <apex:tab label="New Contact" name="tab2" id="tabTwo"> <apex:pageBlock id="newContact" title="New Contact" > <apex:pageBlockButtons > <apex:commandButton action="{!saveContact}" value="Save & Close"/> </apex:pageBlockButtons> <apex:pageMessages /> <apex:pageBlockSection columns="2"> <apex:inputField value="{!Contact.FirstName}"/> <apex:inputField value="{!Contact.LastName}"/> <apex:inputField value="{!Contact.AccountId}"/> <apex:inputField value="{!Contact.MailingStreet}"/> <apex:inputField value="{!Contact.MailingCity}"/> <apex:inputField value="{!Contact.MailingState}"/> <apex:inputField value="{!Contact.MailingPostalCode}"/> <apex:inputField value="{!Contact.MailingCountry}"/> <apex:inputField value="{!Contact.Phone}"/> <apex:inputField value="{!Contact.Email}"/> </apex:pageBlockSection> </apex:pageBlock> <script> if({!Contact.id!=null}){ //alert('{!Contact.Name} {!Contact.id}'); top.window.opener.lookupPick2('{!FormTag}','{!TextBox}_lkid','{!TextBox}','{!Contact.Id}','{!Contact.Name}', false);self.close(); } </script> </apex:tab> </apex:tabPanel> </apex:outputPanel> </apex:form> </apex:page>
Hope it helps.
-
- MedhanieHabte
- October 09, 2015
- Like
- 0
- Continue reading or reply
Getting to 100 percent code coverage on my trailhead module “Write Negative Tests Unit”
My code is as follows.
Calculator Class
public class Calculator { public class CalculatorException extends Exception{} public static Integer addition(Integer a, Integer b){ return a + b; } public static Integer subtraction(Integer a, Integer b){ return a - b; } public static Integer multiply(Integer a, Integer b){ if(b==0 || a==0){ throw new CalculatorException('It doesn\'t make sense to multiply by zero'); } return a * b; } public static Decimal divide(Integer numerator, Integer denominator){ if(denominator == 0){ throw new CalculatorException('you still can\'t divide by zero'); } Decimal returnValue = numerator / denominator; if(returnValue < 0){ throw new CalculatorException('Division returned a negative value.' + returnValue); } return returnValue; } }
And my test class as follows
@isTest public class Calculator_Tests { @isTest public static void addition() { Calculator.addition(1, 0); } @isTest public static void subtraction() { Calculator.subtraction(1, 0); } @isTest public static void divide_throws_exception_for_division_by_zero() { Boolean caught = false; try { Calculator.divide(1, 0); } catch (Calculator.CalculatorException e) { System.assertEquals('you still can\'t divide by zero', e.getMessage(), 'caught the right exception'); caught = true; } System.assert(caught, 'threw expected exception'); } @isTest public static void divide_throws_exception_for_division_by_two() { Boolean caught = true; try { Calculator.divide(1, 2); } catch (Calculator.CalculatorException e) { System.assertEquals('you still can\'t divide by zero', e.getMessage(), 'caught the right exception'); caught = true; } System.assert(caught, 'threw expected exception'); } @isTest public static void multiply_by_one() { Boolean caught = false; try { Calculator.multiply(1, 0); } catch (Calculator.CalculatorException e) { System.assertEquals('It doesn\'t make sense to multiply by zero', e.getMessage(), 'caught the right exception'); caught = true; } System.assert(caught, 'threw expected exception'); } @isTest public static void multiply_by_two() { Boolean caught = true; try { Calculator.multiply(1, 2); } catch (Calculator.CalculatorException e) { System.assertEquals('It doesn\'t make sense to multiply by zero', e.getMessage(), 'caught the right exception'); caught = true; } System.assert(caught, 'threw expected exception'); } }
-
- MedhanieHabte
- January 22, 2019
- Like
- 4
- Continue reading or reply
Stuck on the Use the Salesforce Lightning Design System to Style Visualforce Pages trailhead
-
- MedhanieHabte
- September 08, 2017
- Like
- 1
- Continue reading or reply
Stuck on Step 7 Process Automation Superbadge
Hi all, I am so close to finishing this process automation badge but am stuck in one area in Step 7.
I've built out my process builder as follows
And my date formula as follows
Case(MOD(Date__c-DATE(1900,1,7),7),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5, "Friday",6,"Saturday", "")
Challenge Not yet complete... here's what's wrong: The Robot Setup Day of the Week formula does not seem to be working properly. The Day of the Week should not fall on Saturday or Sunday.
It works nicely but doesn't seem to pass, what could be up.
-
- MedhanieHabte
- July 28, 2017
- Like
- 2
- Continue reading or reply
Unable to install the Salesforce VR Toolkit on Unity
Assets/Salesforce/Components/Scripts/Trigger.cs(24,51): error CS0246: The type or namespace name `GazeInputModule' could not be found. Are you missing an assembly reference?
Anything that I am missing.
-
- MedhanieHabte
- April 03, 2017
- Like
- 2
- Continue reading or reply
Unable to get image to display in Insecure Remote Site Trailhead
I am using this as my code
<apex:image url="{!URLFOR($Resource.Challenge_Resources,'Challenge_resources/Castle.png')}" />
Are there any steps I should take, hope it helps.
-
- MedhanieHabte
- October 23, 2016
- Like
- 1
- Continue reading or reply
Stuck on prevent SOQL injection trailhead
Hope it helps.
public class Prevent_SOQL_Injection_Challenge { public string textOne {get; set;} public string textTwo {get; set;} public string comparator {get; set;} public string numberOne {get; set;} public List<Supply__c> whereclause_records {get; set;} public PageReference stringSearchOne(){ string query = 'SELECT Id,Name,Quantity__c,Storage_Location__c,Storage_Location__r.Castle__c,Type__c FROM Supply__c'; string whereClause = ''; if(textOne != null && textOne!=''){ whereClause += 'name like \'%'+textOne+'%\' '; } if(whereClause != ''){ whereclause_records = database.query(query+' where '+whereClause+' Limit 10'); } return null; } public PageReference stringSearchTwo(){ string query = 'SELECT Id,Name,Quantity__c,Storage_Location__c,Storage_Location__r.Castle__c,Type__c FROM Supply__c'; string whereClause = ''; if(textTwo != null && textTwo!=''){ whereClause += 'Storage_Location__r.name like \'%'+textTwo+'%\' '; } if(whereClause != ''){ whereclause_records = database.query(query+' where '+whereClause+' Limit 10'); } return null; } public PageReference numberSearchOne(){ string query = 'SELECT Id,Name,Quantity__c,Storage_Location__c,Storage_Location__r.Castle__c,Type__c FROM Supply__c'; string whereClause = ''; if(numberOne != null && comparator != null){ whereClause += 'Quantity__c '+comparator+' '+numberOne+' '; } if(whereClause != ''){ whereclause_records = database.query(query+' where '+whereClause+' Limit 10'); } return null; } }
-
- MedhanieHabte
- October 08, 2016
- Like
- 1
- Continue reading or reply
Creating & Using Custom Controllers Trailhead Challenge Issue?
<apex:page controller="NewCaseListController">
<apex:form >
<apex:pageBlock title="Case List" id="Case_list">
<apex:repeat value="{!NewCases}" var="cs">
<table style="width:1000px;">
<tr>
<apex:repeat value="{!NewCases}" var="cs">
<apex:outputLink value="https://na16.salesforce.com/{!cs.Id}">{!cs.CaseNumber}</apex:outputLink>
<apex:outputLink value="{!cs.CaseNumber}">{!cs.CaseNumber}</apex:outputLink>
</apex:repeat>
</tr>
</table>
</apex:repeat>
</apex:pageBlock>
</apex:form>
</apex:page>
-
- MedhanieHabte
- April 27, 2015
- Like
- 1
- Continue reading or reply
Getting a "We can’t find 'reduceErrors' imported into contactList.js." in the Handle Server Error Trailhead
https://trailhead.salesforce.com/en/content/learn/modules/lightning-web-components-and-salesforce-data/handle-server-errors?trail_id=build-lightning-web-components
I am attempting to allow for error handling and write my code as follows
ContactList.js
import { LightningElement, wire } from 'lwc'; import { reduceErrors } from 'c/ldsUtils'; import getContactList from '@salesforce/apex/ContactController.getContactList'; export default class ContactList extends LightningElement { @wire(getContactList) contacts; handleSelect(event) { // 1. Prevent default behavior of anchor tag click which is to navigate to the href url event.preventDefault(); // 2. Create a custom event that bubbles. Read about event best practices at http://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.events_best_practices const selectEvent = new CustomEvent('contactselect', { detail: { contactId: event.currentTarget.dataset.contactId } }); // 3. Fire the custom event this.dispatchEvent(selectEvent); } get errors() { return (this.accounts.error) ? reduceErrors(this.accounts.error) : []; } }
contactList.html
<template> <template if:true={contacts.data}> <template if:true={errors}> <p>{errors}</p> </template> <template for:each={contacts.data} for:item="contact"> <a href="#" key={contact.Id} data-contact-id={contact.Id} onclick={handleSelect} > <lightning-layout> <lightning-layout-item> <img src={contact.Picture__c} alt="Profile photo" /> </lightning-layout-item> <lightning-layout-item padding="horizontal-small"> <p>{contact.Name}</p> </lightning-layout-item> </lightning-layout> </a> </template> </template> </template>
ContactController.cls
public with sharing class ContactController { @AuraEnabled(cacheable=true) public static List<Contact> getContactList() { throw new AuraHandledException('Forced error'); /*return [ SELECT Id, Name, Title, Phone, Email, Picture__c FROM Contact WHERE Picture__c != null WITH SECURITY_ENFORCED LIMIT 10 ];*/ } @AuraEnabled(cacheable=true) public static List<Contact> findContacts(String searchKey) { String key = '%' + searchKey + '%'; return [ SELECT Id, Name, Title, Phone, Email, Picture__c FROM Contact WHERE Name LIKE :key AND Picture__c != null WITH SECURITY_ENFORCED LIMIT 10 ]; } @AuraEnabled(cacheable=true) public static Contact getSingleContact() { return [ SELECT Id, Name, Title, Phone, Email, Picture__c FROM Contact WITH SECURITY_ENFORCED LIMIT 1 ]; } }
But I get this error We can’t find 'reduceErrors' imported into contactList.js. Any steps I need to take here.
- MedhanieHabte
- July 06, 2020
- Like
- 0
- Continue reading or reply
Einstein Analytics and Disscovery Insights Specialist - Step 3 - Trailhead Error
Challenge Not yet complete... here's what's wrong:
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: ALJNAPDO
Close errors
My Dashboard looks good but oddly It may be tied to something I might be missing with the Tenure Length, not sure.
- MedhanieHabte
- May 03, 2019
- Like
- 0
- Continue reading or reply
Lightning Experience Rollout Challenge 7 : Component 'Report Chart' has an invalid value for property 'Report'.
- swati marda
- September 07, 2017
- Like
- 0
- Continue reading or reply
Superbadge: Lightning Experience Rollout Specialist #10
- Cody Enboden 5
- September 06, 2017
- Like
- 0
- Continue reading or reply
Superbadge: Lightning Experience Rollout Specialist (Challenge 10)
The Campaign Influence Lightning report must have the correct 1. Aggregate, 2. Columns, 3. Groupings, and 4. Filter.
The requirements have no mention about what fields, groupings, filters, aggregates to include in the report. What am I missing?
- Samy.Saied
- September 06, 2017
- Like
- 4
- Continue reading or reply
Can't share document with group via trigger
I'm fairly new to coding and I want to create a trigger where I share a document with a certain chatter group automatically and give them contributer rights when I upload a file via the chatter feed.This is how my trigger looks like:
trigger publishFileToGroup on ContentDocumentLink (after insert) {
List<CollaborationGroup> chattergroup = [SELECT Id FROM CollaborationGroup WHERE Name = 'Apex Trigger Group'];
List<ContentDocument> documents = [SELECT Id, Title, LatestPublishedVersionId FROM ContentDocument];
ContentDocumentLink cdl = New ContentDocumentLink(
LinkedEntityId = chattergroup[0].Id, ContentDocumentId = documents[0].Id, shareType = 'C');
insert cdl;
}
This doesn't work and the following error message appears:
"Apex trigger publishFileToGroup caused an unexpected exception, contact your administrator: publishFileToGroup: execution of AfterInsert
caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, publishFileToGroup: execution of AfterInsert
caused by: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Document with ID: 06958000000Aejh is already linked with the entity with ID: 0F9580000005tul: Linked Entity ID: [LinkedEntityId]
From my understanding it says that the document is already linked with the chatter group, which is not true. Any ideas?
- Bernd Bretzelmann
- August 11, 2017
- Like
- 0
- Continue reading or reply
Modifying the Confirm Email Address Message
Does anyone know of a way to modify this flag message? For example if i wanted to say 'Invalid Email Address' rather than 'Confirm Email Address'
Best,
Grant Ongstad
- Grant Ongstad 3
- August 10, 2017
- Like
- 0
- Continue reading or reply
Stuck on Step 7 Process Automation Superbadge
Hi all, I am so close to finishing this process automation badge but am stuck in one area in Step 7.
I've built out my process builder as follows
And my date formula as follows
Case(MOD(Date__c-DATE(1900,1,7),7),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5, "Friday",6,"Saturday", "")
Challenge Not yet complete... here's what's wrong: The Robot Setup Day of the Week formula does not seem to be working properly. The Day of the Week should not fall on Saturday or Sunday.
It works nicely but doesn't seem to pass, what could be up.
- MedhanieHabte
- July 28, 2017
- Like
- 2
- Continue reading or reply
process automation specialist step 6 - Error: Faraday::ClientError. Message: MALFORMED_QUERY
There was an unhandled exception. Please reference ID: KLNTXAZY. Error: Faraday::ClientError. Message: MALFORMED_QUERY: When retrieving results with Metadata or FullName fields, the query qualifications must specify no more than one row for retrieval. Result size: 2
I have a flow that allows you to choose the product type, then the product, which creates the product, then asks if you want to add more products and goes back to the start. Seems to work perfectly. Not sure what this error is.
- wcraig
- July 28, 2017
- Like
- 0
- Continue reading or reply
Process Automation Specialist Step 2
- Elie.Rodrigue
- July 27, 2017
- Like
- 0
- Continue reading or reply
Build a Cat Rescue App That Recognizes Cat Breeds - Create and Train the Dataset error
I am stuck at the Create and Train the Dataset step on the Build a Cat Rescue App That Recognizes Cat Breeds Trailhead module.
I have successfully created the lightning component, uploaded the zip file and clicked on the train button but when I try to Verifiy I get the following error message:
"Challenge Not yet complete... here's what's wrong:
Could not find a successful cat dataset training. The training may take a couple of minutes after the model is created."
Could you please advise ?
Thanks for your help.
- Emilien Guichard 40
- June 16, 2017
- Like
- 0
- Continue reading or reply
Unable to install the Salesforce VR Toolkit on Unity
Assets/Salesforce/Components/Scripts/Trigger.cs(24,51): error CS0246: The type or namespace name `GazeInputModule' could not be found. Are you missing an assembly reference?
Anything that I am missing.
- MedhanieHabte
- April 03, 2017
- Like
- 2
- Continue reading or reply
Automate Your Business Processes>Workflow Rule Migration>Map Your Workflow Actions to Process Actions
Hep me for this Problem!
- Alap Mistry
- March 30, 2017
- Like
- 1
- Continue reading or reply
Map Your Workflow Actions to Process Actions - "Create contract for closed opportunity" isn't properly configured
Challenge Not yet complete... here's what's wrong: A Create a Record action for the Closed Won criteria node isn't properly configured. Make sure that it creates a draft contract according to the instructions in the ‘Create contract for closed opportunity’ task action. Make sure that Start Date is set by using a formula.
I've gone over all of the workflow tasks information to recreate the contact. If I activate the process and close an opportunity, it creates a contract with the expected information and the date is 1mo away with 12mo term. The workflow's task (which is the template for the actual contract) specifies the following:
Use the closed opportunity to create a contract for the associated account. Account: The account associated with this opportunity Status: Draft Contract Start Date: 1 month from today Contract Term: 12Here are my actions:
The Contract Start Date is set to the following formula:
DATE( YEAR(Today()) + FLOOR((1 + MONTH(Today())) / 12) - IF (MOD(MONTH(Today()) + 1, 12) = 0, 1, 0), MOD((1 + MONTH(Today()) - 1), 12) + 1, DAY(Today()) )
Again, for all practical purposes I'm passing this, as it functions and the contract is created. But I must be missing some small detail, named field, something that's tripping up the validation settings. Any help is appreciated!
- David Hickman 15
- March 29, 2017
- Like
- 0
- Continue reading or reply