• Sean O-Connell
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 2
    Replies
I am looking to create a JavaScript Button with validation in to.  I want it to check to see if "State of Incorporation" (A picklist) is not null if null give an alert if not run the code.  Currently I am getting the below error and the code is also below thanks in advance for help


A problem with the OnClick JavaScript for this button or link was encountered:

Unexpected token {





{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")} 

if("{!Contact.State_of_Incorporation__c}" !==""{ 

var CRL='Email~VeraAuthorizedSigner@vera.com;FirstName~Vera;LastName~Authorized Signer;RoutingOrder~2;SignNow~0,Email~{!Contact.Email};Role~Signer 2;FirstName~{!Contact.FirstName};LastName~{!Contact.LastName};RoutingOrder~1;SignNow~0'; 
var DST ="AEF6F08B-B40F-4D11-A639-8B3B9604963D"; 





window.location.href = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!Contact.Id}&CRL="+CRL+"&DST="+DST; 



else{ 
Alert("must fill out State of Incorporation");
So I have created a Process Builder that when Status = Shipdate on the Order Update all Order producs Shipped = true 

Should be pretty simple as I have made many many proccess builders but I keep getting.

Maximum Depth Exceeded and I have no Idea why.  It is the only process builder in the org so why is recursion happening? 
I am trying to build a list view for our communites members so if there name is in the "Inspector" Contact Lookup field (current User ID = the id of the protal user that is also the contact)  they would show up a list view so I was tring to do something like below but i dont know how to access the portal user id.  I can access the contact id that made the protal user and I can access the owner id but not the portal user id for that contact, 


IF( portalUSER__r.Id = $User.Id, "Yes", "No")

is this possible?

Thanks

Sean
I am trtying to create a workflow that updates a date field when the prior value is a Queue ID (Owner ID) and is changed. 

i have been able to do it when there is a picklist value like this

ISPICKVAL(PRIORVALUE(  Queue__c ), "QC Review")&& ischanged ( Queue__c )

How do I write the below referencing a lookup owner filed rather then a picklist field

PRIORVALUE(ownerid =  "00G37000000heZl") && ischanged ( ownerid)

Thanks in advanced

Sean
 
I have made a trigger and a class for when a contact gets created it sends Contact information to a third party.  So when I run my normal contact test the trigger gets 100% coverage but the Class gets skipped and I get this error 'Methods defined as TestMethod do not support Web service callouts, test skipped'

How do I create a test for this?

Class
public class sendHttpPostToCV{

@future(callout=true)
    public static void sendHttpRequest(String url){

        Http h = new Http();
        
        HttpRequest req = new HttpRequest();
        req.SetEndPoint(url);
        req.setMethod('POST');
        req.setHeader('Content-Type', 'text/html');
        req.setBody(''); 
        //req.setTimeout(60000);
        
        HttpResponse res = h.send(req);
        
    
        
    }
}

Trigger

trigger HttpPostToCV on Contact (after insert) {
    List<String> leadIds = new List<String>();
    
    for (Contact c : Trigger.new){
    
        String LeadSource = c.LeadSource;
        String FirstName = c.FirstName;
        String LastName = c.LastName;
        String MailingStreet = c.MailingStreet; 
        String MailingCity = c.MailingCity;
        String MailingState =  c.MailingState;
        String MailingPostalCode = c.MailingPostalCode;
        String MailingCountry = c.MailingCountry;
        String Email = c.Email;
        String Phone = c.Phone;
        String OtherPhone = c.OtherPhone;
        String Program_Code = c.Program_Code__c;
        String Previous_Education = c.Previous_Education__c;
        String Affiliation_Code = c.Affiliation_Code__c;
        String SalesForceID = c.id;
        
        String url = 'http://eleads.lafilm.com:8088/Cmc.Integration.LeadImport.HttpPost/ImportLeadProcessor.aspx?Format=CollegeDirectories&leadsource='
               + LeadSource + '&Firstname=' + FirstName + '&Lastname=' + LastName + '&Address1=' + MailingStreet + '&Address2=&City='
               + MailingCity + '&State=' + MailingState + '&Postalcodeorzip=' + MailingPostalCode + '&Country='
               + MailingCountry + '&Email=' + Email + '&Phone=' + Phone + '&WorkPhone=' + OtherPhone + '&Program='
               + Program_Code + '&Campus=MAIN&PreviousEducation=' + Previous_Education + '&Agency='
               + Affiliation_Code + '&ZSalesForceID=' + SalesForceID;
        
    
        sendHttpPostToCV.sendHttpRequest(url);
    }
}

Current Contact object test 

@isTest
public class TestContactTriggers {
    static testmethod void test()
    {
        
        
        Account acc = New Account(Name = 'Test Account');
        insert acc;
        
        Contact con = New contact ();
        con.FirstName = 'test';
        con.LastName = 'con';
        con.AccountId = acc.Id;
        con.Event_Scheduled_Date__c = system.now();
        con.Lead_Source_Code__c = 'test';
        con.school_status__c = 'Connected';
        insert con;
        
        Contact con2 = New contact ();
        con2.FirstName = 'test';
        con2.LastName = 'con';
        insert con2;
        
        
        datetime eventscheduleddate = con.Event_Scheduled_Date__c;
        datetime newdate = eventscheduleddate.addHours(1);
        
        Test.startTest();
        
        
        
        con.Event_Scheduled_Date__c = newdate;
        con.Lead_Source_Code__c = 'test2';
        con.school_status__c = 'test';
        Update con;
        
        con.school_status__c = 'connected';
        update con;   
        
        
        Test.stopTest();
        
    }
}

Thanks

Sean
I am very new to anything Web to Lead.  We work will some affiliates and we get leads currenty posting into a different system through a URL like this

http://eleads.lafilm.com:8088/Cmc.Integration.LeadImport.HttpPost/ImportLeadProcessor.aspx?Format=Website&leadsource=INC4235&Firstname=Keith&Lastname=Hines&Address1=3777 s guest&Address2=&City=HOUSTON&State=TX&Postalcodeorzip=77063&Country=USA&Email=khines2005@yahoo.com&Phone=8325078883&WorkPhone=&Program=BSDC-O&Campus=MAIN2&PreviousEducation=GED&Agency=NON

How or what do I need to do in order to get these to post into SFDC preferably post as contacts not leads

Thanks In Advance

Sean



 
I am trtying to create a workflow that updates a date field when the prior value is a Queue ID (Owner ID) and is changed. 

i have been able to do it when there is a picklist value like this

ISPICKVAL(PRIORVALUE(  Queue__c ), "QC Review")&& ischanged ( Queue__c )

How do I write the below referencing a lookup owner filed rather then a picklist field

PRIORVALUE(ownerid =  "00G37000000heZl") && ischanged ( ownerid)

Thanks in advanced

Sean
 
So I have created a Process Builder that when Status = Shipdate on the Order Update all Order producs Shipped = true 

Should be pretty simple as I have made many many proccess builders but I keep getting.

Maximum Depth Exceeded and I have no Idea why.  It is the only process builder in the org so why is recursion happening? 
I am trying to build a list view for our communites members so if there name is in the "Inspector" Contact Lookup field (current User ID = the id of the protal user that is also the contact)  they would show up a list view so I was tring to do something like below but i dont know how to access the portal user id.  I can access the contact id that made the protal user and I can access the owner id but not the portal user id for that contact, 


IF( portalUSER__r.Id = $User.Id, "Yes", "No")

is this possible?

Thanks

Sean