• MoreThanWYSIWYG
  • NEWBIE
  • 20 Points
  • Member since 2014
  • Developer
  • Savant Systems

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 7
    Replies
I have an overarchng zipped static resource that defines an entire part of our site (Static Resource A). I also have another static resource with our comapny's font information (Static Resource B - GothamFontSet).

How can I dynamically reference Static Resource B from A?

Here is an example within Static Resource A:
Working:
@font-face {
	font-family: Gotham-Book;
	src: url("/DefaultStore/resource/1496327996000/GothamFontSet/Gotham-Book.otf") format("opentype");
}

Not working;
@font-face {
	font-family: Gotham-Book;
	src: url("{!URLFOR($Resource.GothamFontSet, 'Gotham-Book.otf'") format("opentype");
}

What I want to do is avoid having that hardcoded datetime stamp as shown in the "working" version.
Any suggestions?

 
My organization just implimented Live Agent Chat.
When a file is uploaded via the chat from the customer, it's added to the Notes and Attachments object which lives on the Account. This will not work for our business model. What I want to do is create a way for the end user to upload a file through chat, but direct the file to an AWS S3 file server for storage, rather than storing on the Notes and Attachments object.


We want to keep the functionality that the agent sees (clicking a button in the chat to initialize a file transfer), but direct the file to an S3 bucket. Any idea how I could do that?
 
Is it possible to query all knowledge articles through the rest API without needing an ID, versionid, FIND, or anything like that? I am setting up a site that needs to pull in all online public articles within a specific data category.

This SOSL query works, but it needs a "Find":
FIND {"faq"} IN ALL FIELDS 
RETURNING Support_Article__kav(id, articlenumber, Title, Summary, Full_Description__c, FirstPublishedDate,LastPublishedDate, VersionNumber,IsDeleted, IsVisibleInPkb
 where PublishStatus='Online' and Language='en_US' )
WITH Data Category Savant_Knowledge__c below Savant_Consumers__c
I also got this working, but still, it needs a search term:
/services/data/v34.0/search/?q=FIND+%7B%22faq%22%7D+IN+ALL+FIELDS+RETURNING+Support_Article__kav%28id%2carticlenumber%2cTitle%2cSummary%2cFull_Description__c%2cFirstPublishedDate,LastPublishedDate%2cVersionNumber,IsDeleted%2cIsVisibleInPkb+where+isVisibleinPKB+%3D+True+and+PublishStatus%3D%27ONLINE%27+and+Language%3D%27en_US%27%29+WITH+Data+Category+Savant_Knowledge__c+below+Savant_Consumers__c


I need to be able to run an API call that just returns all articles that meet the specific criteria. Is it possible?
 
It's Rule #1 in the case assignment rule list. It is letting emails with the subject containing "Automatic reply" attach the email to the case. It should be just dumping these into the spam queue and closing them.

Is there something wrong with my logic?
and 
(isNew(), 
	or 
	(isPickVal(Origin, "Email"), 
		isPickVal(Origin, "ReplyEmail") 
		), 
	or 
	(contains($Label.Spam_Email_Addresses, SuppliedEmail), 
		contains(SuppliedEmail, "No Reply"), 
		contains(SuppliedEmail, "NoReply"), 
		contains(SuppliedEmail, "No-Reply"), 
		contains(Subject, "Out of Office"), 
		contains(Subject, "OutofOffice"), 
		contains(Subject, "Out-of-Office"), 
		contains(Subject, "Automatic reply"), 
		contains(Subject, "Delayed Mail") 
		) 
	)

 
The following rule works to track the time a case has been opened when the status = new. However, sometimes we run into the situation where the case is new then changed to another status, then changed back to new. What I want to do is reset the timer every time the case status = new. 
 Here is the code I use to start the initial timer, I need to create or modify this so that the timer is reset every time the case status = new:
and(
    not(IsClosed), isNull(Start_Time_Wait_Savant__c ),
    	    or(
    	          and(
    	           not(isNew()), isChanged(Status)),       
    	          and(isNew(), Owner_Type__c <> "Queue")), not( Is_Waiting_For_Customer__c ), not( Is_Soft_Closed__c )
    )
Any help would be apprecieated, as I am new to writing these rules.
 
So, using the following code, I am able to get this working in my Sandbox, but not in my production org
<apex:outputPanel >
<div style="padding-top:25px; padding-left:25px;">
  <h3>Most Recent Articles</h3>
  <ol>
    <knowledge:articleList articleVar="article"
    categories="Savant_Knowledge:All_Knowledge_Articles"
    sortBy="lastUpdated"
    pageSize="10">
          <li class="folderView"><a target = "_top" class="hyperlink" href="{!URLFOR($Action.KnowledgeArticle.View, article.id)}">{!article.title}</a></li>
        </knowledge:articleList>
  </ol>  
</div>
</apex:outputPanel >

The classes and sytling and such are all identical in the sandbox as they are to the production org.

Any suggestions on what I can look at to see why this is not populating?
We do have many knowledge articles in our KB, so that is not the issue.
Hi,
I am trying to get SSO working from my local machine as the IdP to Salesforce Sandbox as the SP. Following the guide from https://simplesamlphp.org/docs/stable/simplesamlphp-idp, I get the following error: "Your login attempt using single sign-on with an identity provider certificate has failed".

When I run the SAML response through the parser in SF I get the following:
11. Validating the Signature
  Is the response signed? true
  Is the assertion signed? true
  The reference in the response signature is valid
  The signature in the assertion is not valid
  The reference in the assertion signature is valid
  Is the correct certificate supplied in the keyinfo? true
  Signature or certificate problems
  The signature in the response is not valid
Subject: 
Unable to map the subject to a Salesforce.com user

AssertionId: _5f11fcc6eef666fbd579d04d62725fac88f6b5628a

I've been banging my head against the wall, I've looked at other posts and have not gotten anywhere.

Any suggestions?
So, I have a class that is called by a URL and based on the information provided in the parameters, it runs it through a query and returns results as XML in a VisualForce page.

Here's the Class:
public without sharing class Five9Query {

    public string cid { get;set; }
    public string phone { get;set; }
    public boolean accAccess { get;set; }
    public boolean access { get;set; }
    public string priority { get;set; }
    public string id { get;set; }
    public string pin { get;set; }
    public string tempCid { get;set; }
    public Integer errorCode { get;set; }
    private string secPin = '11111111';

    public Five9Query() {
        string pin = ApexPages.currentPage().getParameters().get('pin');
        if (pin == secPin){
            system.debug('Pin:  ' + pin);
            string tempCid = ApexPages.currentPage().getParameters().get('cid');
            system.debug('tempCID:  ' +tempCid);
            Integer cidLength = tempCid.length();

            if (cidLength == 10){
                cid = '(' + tempCid.substring(0,3) + ') ' + tempCid.substring(3,6) + '-' + tempCid.substring(6,10);
                system.debug('cid:  ' +cid);
            }
     
            else if (cidLength > 10){
                cid = tempCid;
            }

            List<Contact> conMobile = [SELECT id, MobilePhone, Dealer_Portal_Account_Created__c, Account.PortalLoginCreatedEmailed__c , account.discount_tier__c FROM Contact WHERE MobilePhone = :cid limit 1];
            List<Contact> conPhone = [SELECT id, Phone,Dealer_Portal_Account_Created__c, account.portalLoginCreatedEmailed__c, account.discount_tier__c FROM Contact WHERE Phone = :cid limit 1];
            List<Account> accPhone = [SELECT id, Phone, portalLoginCreatedEmailed__c, discount_tier__c FROM Account WHERE Phone = :cid limit 1];
            List<Account> accFax = [SELECT id, Fax, portalLoginCreatedEmailed__c, discount_tier__c FROM Account WHERE Fax = :cid  limit 1];
            List<Contact> conFax = [SELECT id, Fax,Dealer_Portal_Account_Created__c, account.portalLoginCreatedEmailed__c, account.discount_tier__c FROM Contact WHERE Fax = :cid  limit 1];
            List<Account> accBillingPhone = [SELECT id, Billing_Contact_Phone__c, portalLoginCreatedEmailed__c, discount_tier__c FROM Account WHERE Billing_Contact_Phone__c = :cid limit 1];

            //Checking Contact Mobile Phone
            if (!conMobile.isEmpty()){
                if(conMobile[0].account.portalLoginCreatedEmailed__c == true){
                    errorCode = 0;
                    id = conMobile[0].Id;
                    phone = conMobile[0].MobilePhone;
                    access = conMobile[0].Dealer_Portal_Account_Created__c;
                    priority = conMobile[0].account.discount_tier__c;                  
                }
                else{
                    errorCode = 3;
                    id = conMobile[0].Id;
                    phone = conMobile[0].MobilePhone;
                    access = conMobile[0].account.portalLoginCreatedEmailed__c ;
                    priority = conMobile[0].account.discount_tier__c;
                }
            }

            //Checking Contact Phone
            else if (!conPhone.isEmpty()){
                if(conPhone[0].account.portalLoginCreatedEmailed__c == true){
                    errorCode = 0;
                    id = conPhone[0].Id;
                    phone = conPhone[0].Phone;
                    access = conPhone[0].Dealer_Portal_Account_Created__c;
                    priority = conPhone[0].account.discount_tier__c;                  
                 }
                else{
                    errorCode = 3;
                    id = conPhone[0].Id;
                    phone = conPhone[0].Phone;
                    access = conPhone[0].account.portalLoginCreatedEmailed__c;
                    priority = conPhone[0].account.discount_tier__c;
                }
            }

            //Checking Account Phone
            else if (!accPhone.isEmpty()){
                errorCode = 0;
                id = accPhone[0].Id;
                phone = accPhone[0].Phone;
                access = accPhone[0].portalLoginCreatedEmailed__c;
                priority = accPhone[0].discount_tier__c;                        
            } 

            //Checking Account Billing Phone
            else if (!accBillingPhone.isEmpty()){
                errorCode = 0;
                id = accBillingPhone[0].Id;
                phone = accBillingPhone[0].Billing_Contact_Phone__c;
                access = accBillingPhone[0].portalLoginCreatedEmailed__c;
                priority = accBillingPhone[0].discount_tier__c;                  
            }

            //Checking Account Fax
            else if (!accFax.isEmpty()){  
                errorCode = 0;
                id = accFax[0].Id;
                phone = accFax[0].Fax;
                access = accFax[0].portalLoginCreatedEmailed__c;
                priority = accFax[0].discount_tier__c;           
            }

            //Checking Contact Fax
            else if (!conFax.isEmpty()){
                if(conFax[0].account.portalLoginCreatedEmailed__c == true){
                    errorCode = 0;
                    id = conFax[0].Id;
                    phone = conFax[0].Fax;
                    access = conFax[0].Dealer_Portal_Account_Created__c;
                    priority = conFax[0].account.discount_tier__c;
               
                }
                else{
                    errorCode = 3;
                    id = conFax[0].Id;
                    phone = conFax[0].Fax;
                    access = conFax[0].account.portalLoginCreatedEmailed__c;
                    priority = conFax[0].account.discount_tier__c;
                }           
            }

            else{
             System.debug('No Match');
             errorCode = 1; 
            }
        }
  
        else {
            system.debug('invalid pin');
            errorCode = 2;
        }      
    } 
}


Here's the VF page:
<apex:page Controller="Five9Query" contentType="text/xml" showHeader="false" sidebar="false" cache="false">
<?xml version="1.0" encoding="UTF-8" ?>
<response>
    <id>{!id}</id>
    <access>{!access}</access>
    <priority>{!priority}</priority>
<errorcode>{!errorCode}</errorcode>
</response>
</apex:page>


So, what i need to do is write a test class that:
1. Creates an account - done
1.1 verifies creation - done
2. Creates a contact - done
2.1 verifies creation - done
3. Calls a URL with a variable from the account and/or contact
4. Parses the XML results to ensure results match (or don't)


1 and 2 are done, 3 and 4 are where I am stuck. What do I need to do to get 3 and 4 working?


So, I have a created a controller that queries a phone number and spits data out on a  VF page XML format. This works find behind the wall.

I published it to a site, however the query does not run. It looks against the Contact and Account tables. Is there something special I need to do?
I need to replace a 10 digit string - a phone number with a format like (123) 456-7890 because unforutnately, the DB a total mess.

I can do it in PHP like this:
$data = '1234567890';

if(  preg_match( '/^\d(\d{3})(\d{3})(\d{4})$/', $data,  $matches ) )
{
    $result = '('.$matches[1] . ') ' .$matches[2] . '-' . $matches[3];
    return $result;
}
Which works fine in PHP, but't I can't seem to translate it to APEX. Any help would be apprecieated.
 
So, here is what I am trying to do:
1. Create public page that Five9 can post a Caller ID number to via a URL.
2. Parse through the DB based on the Caller ID passed in the URL
3. Return first result with a couple other fields as XML so Five9 can pick it up

I have the SOQL query defined, but I don't know how to do the rest. Any help would be apprecieated.
Hi, this is my first coding project with SF. I'm a n00b when it comes to programming in general.
The code below is just running through different areas where a phone number can be stored. On Checking billing__contact__phone__c and Checking Contact Fax, I get the error in the title of this post. The other ifs work fine. I can run the queries against the DB with no problem. What is going on here.

String CID = '(555) 555-5555';

List<Contact> conMobile = [SELECT MobilePhone, Dealer_Portal_Account_Created__c FROM Contact WHERE MobilePhone = :CID limit 1];

//Checking Contact Mobile Phone
if (!conMobile.isEmpty()){
    System.debug('Contact Mobile Phone: ' + conMobile);
}   
//Checking Contact Phone
else if (conMobile.isEmpty()){
     List<Contact> conPhone = [SELECT Phone, Dealer_Portal_Account_Created__c FROM Contact WHERE Phone = :CID limit 1];
     System.debug('Contact Phone: ' + conPhone);
    
     //Checking Account Phone
     if (conPhone.isEmpty() && conMobile.isEmpty()){
         List<Account> accPhone = [SELECT Phone FROM Account WHERE Phone = :CID limit 1];
         System.debug('Accout Phone  : ' + accPhone);
    
     //Checking Account FAX
     if (conPhone.isEmpty() && conMobile.isEmpty() && accPhone.isEmpty()){
         List<Account> accFax = [SELECT Fax FROM Account WHERE Fax = :CID limit 1];
         System.debug('Accout Fax  : ' + accFax); 

         //Checking billing__contact__phone__c
         if (conPhone.isEmpty() && conMobile.isEmpty() && accPhone.isEmpty && accFax.isEmpty()){
         List<Account> accBillingPhone = [SELECT Billing_Contact_Phone__c FROM Account WHERE Billing_Contact_Phone__c = :CID limit 1];
         System.debug('Account Billing Phone  : ' + accBillingPhone);
    
         //Checking Contact Fax
         if (conPhone.isEmpty() && conMobile.isEmpty() && accPhone.isEmpty && accFax.isEmpty() && accBillingPhone.isEmpty()){
         List<Contact> conFax = [SELECT Fax FROM Contact WHERE Fax = :CID  limit 1];
         System.debug('Contact Fax  : ' + conFax); 

     }
}
}
}
}

    else{
System.debug('Nothing');  
}

//account portalLoginCreatedEmailed__c
 
It's Rule #1 in the case assignment rule list. It is letting emails with the subject containing "Automatic reply" attach the email to the case. It should be just dumping these into the spam queue and closing them.

Is there something wrong with my logic?
and 
(isNew(), 
	or 
	(isPickVal(Origin, "Email"), 
		isPickVal(Origin, "ReplyEmail") 
		), 
	or 
	(contains($Label.Spam_Email_Addresses, SuppliedEmail), 
		contains(SuppliedEmail, "No Reply"), 
		contains(SuppliedEmail, "NoReply"), 
		contains(SuppliedEmail, "No-Reply"), 
		contains(Subject, "Out of Office"), 
		contains(Subject, "OutofOffice"), 
		contains(Subject, "Out-of-Office"), 
		contains(Subject, "Automatic reply"), 
		contains(Subject, "Delayed Mail") 
		) 
	)

 
So, using the following code, I am able to get this working in my Sandbox, but not in my production org
<apex:outputPanel >
<div style="padding-top:25px; padding-left:25px;">
  <h3>Most Recent Articles</h3>
  <ol>
    <knowledge:articleList articleVar="article"
    categories="Savant_Knowledge:All_Knowledge_Articles"
    sortBy="lastUpdated"
    pageSize="10">
          <li class="folderView"><a target = "_top" class="hyperlink" href="{!URLFOR($Action.KnowledgeArticle.View, article.id)}">{!article.title}</a></li>
        </knowledge:articleList>
  </ol>  
</div>
</apex:outputPanel >

The classes and sytling and such are all identical in the sandbox as they are to the production org.

Any suggestions on what I can look at to see why this is not populating?
We do have many knowledge articles in our KB, so that is not the issue.
So, I have a created a controller that queries a phone number and spits data out on a  VF page XML format. This works find behind the wall.

I published it to a site, however the query does not run. It looks against the Contact and Account tables. Is there something special I need to do?
I need to replace a 10 digit string - a phone number with a format like (123) 456-7890 because unforutnately, the DB a total mess.

I can do it in PHP like this:
$data = '1234567890';

if(  preg_match( '/^\d(\d{3})(\d{3})(\d{4})$/', $data,  $matches ) )
{
    $result = '('.$matches[1] . ') ' .$matches[2] . '-' . $matches[3];
    return $result;
}
Which works fine in PHP, but't I can't seem to translate it to APEX. Any help would be apprecieated.
 
So, here is what I am trying to do:
1. Create public page that Five9 can post a Caller ID number to via a URL.
2. Parse through the DB based on the Caller ID passed in the URL
3. Return first result with a couple other fields as XML so Five9 can pick it up

I have the SOQL query defined, but I don't know how to do the rest. Any help would be apprecieated.
Hi, this is my first coding project with SF. I'm a n00b when it comes to programming in general.
The code below is just running through different areas where a phone number can be stored. On Checking billing__contact__phone__c and Checking Contact Fax, I get the error in the title of this post. The other ifs work fine. I can run the queries against the DB with no problem. What is going on here.

String CID = '(555) 555-5555';

List<Contact> conMobile = [SELECT MobilePhone, Dealer_Portal_Account_Created__c FROM Contact WHERE MobilePhone = :CID limit 1];

//Checking Contact Mobile Phone
if (!conMobile.isEmpty()){
    System.debug('Contact Mobile Phone: ' + conMobile);
}   
//Checking Contact Phone
else if (conMobile.isEmpty()){
     List<Contact> conPhone = [SELECT Phone, Dealer_Portal_Account_Created__c FROM Contact WHERE Phone = :CID limit 1];
     System.debug('Contact Phone: ' + conPhone);
    
     //Checking Account Phone
     if (conPhone.isEmpty() && conMobile.isEmpty()){
         List<Account> accPhone = [SELECT Phone FROM Account WHERE Phone = :CID limit 1];
         System.debug('Accout Phone  : ' + accPhone);
    
     //Checking Account FAX
     if (conPhone.isEmpty() && conMobile.isEmpty() && accPhone.isEmpty()){
         List<Account> accFax = [SELECT Fax FROM Account WHERE Fax = :CID limit 1];
         System.debug('Accout Fax  : ' + accFax); 

         //Checking billing__contact__phone__c
         if (conPhone.isEmpty() && conMobile.isEmpty() && accPhone.isEmpty && accFax.isEmpty()){
         List<Account> accBillingPhone = [SELECT Billing_Contact_Phone__c FROM Account WHERE Billing_Contact_Phone__c = :CID limit 1];
         System.debug('Account Billing Phone  : ' + accBillingPhone);
    
         //Checking Contact Fax
         if (conPhone.isEmpty() && conMobile.isEmpty() && accPhone.isEmpty && accFax.isEmpty() && accBillingPhone.isEmpty()){
         List<Contact> conFax = [SELECT Fax FROM Contact WHERE Fax = :CID  limit 1];
         System.debug('Contact Fax  : ' + conFax); 

     }
}
}
}
}

    else{
System.debug('Nothing');  
}

//account portalLoginCreatedEmailed__c