• Doug Beltowski X
  • NEWBIE
  • 60 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 8
    Replies

Hello,

I'm not a coder by any stretch, but I've been dabbling a bit to see if I can learn. We currently have a customer Lead convert page in our org where I'd like to add a field for "Qualifying Reason" (a custom picklist that has been created on the Lead). I mimicked some existing code to get the field on the visual force page and I tried to update the controller, by mimicking existing code as well.

What I get is a field for "Qualifying Reason" and picklist box with no values. From researching around, it looks like I need additional coding in my controller to pull the values, but my various attempts to do so have only created errors for me...

Can anyone provide any gudiance here?

Thank you!!!
TK


Visual Force Page:
                <apex:pageblocksectionitem >
                    <apex:outputlabel >Converted Status</apex:outputlabel>
                    <apex:outputPanel layout="block" styleClass="requiredInput">
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                        <apex:selectlist value="{!ConvertedStatus}" required="true" multiselect="false" size="1" onchange="processChange()">
                            <apex:selectOptions value="{!ConvertedStatuses}"/>
                        </apex:selectlist>
                    </apex:outputpanel>
                </apex:pageblocksectionitem>

Controller:

    public String QualifyingReason {get; set;}
    public List<SelectOption> QualifyingReasons {get; set;}


What my page looks like:
Visual Force page

We are implementing Live Agent with a pre-chat form to capture and display information from the customer.  The pre-chat form works great but we also want capture the URL the customer was on when they clicked the chat button.

I added some JavaScript to pass in this detail from the webpage.

`liveagent.addCustomDetail('URL', window.location.href);`

This works fine from a test HTML page on my desktop, but when we put the code on our testing website the URL doesn't get passed through.

On the webpage the code is in the `<body>` tag and looks like this.
<script type="text/javascript">
        if (!window._laq) { window._laq = []; }
        window._laq.push(function(){
            liveagent.showWhenOnline('573XXXXXXXXXXXX', document.getElementById('liveagent_button_online_573XXXXXXXXXXXX'));
            liveagent.showWhenOffline('573XXXXXXXXXXXX', document.getElementById('liveagent_button_offline_573XXXXXXXXXXXX'));
        });
    </script>
    <script type='text/javascript' src='https://c.la3-c2cs-chi.salesforceliveagent.com/content/g/js/37.0/deployment.js'></script>
    
    <script>
        // liveagent.addCustomDetail('URL', window.location.href); Doesn't work either
        window.onload=liveagent.addCustomDetail('URL', window.location.href);
    </script>
    
    <script type='text/javascript'>
        liveagent.init('https://d.la3-c2cs-chi.salesforceliveagent.com/chat', '572XXXXXXXXXXXX', '00DXXXXXXXXXXXX');
    </script>
I'm not JavaScript wiz so I'm not sure if/how much placement matters.

Also using FireFox firebug I see this error when I refresh the page

> ReferenceError: liveagent is not defined

I suspect this is caused by the `addCustomDetail` function but I'm not sure exactly how to find exactly where it is happening.

User-added image
I can't figure out how to do this.  There seems to be no global constant for blank/null associated with Date fields, and if I simply leave the assignment box empty it doesn't do anything.
I'm trying to utilize Remote Objects in order to query a Custom Object.  My JSON criteria are below. My query returns data, the problem is that the first Custom_Date_Time__c field criteria is ignored.  As shown it will return all objects with date before January 1st 2016, and if I switch the lines it will return all objects with the date after January 1st 2014.  What I need are all objects with the date between these two.
{
	where:
	{
		RecordTypeId: {in: ids},
		Custom_Boolean__c: {eq: true},
		Custom_Date_Time__c: {gte: new Date('2014-1-1')},
		Custom_Date_Time__c: {lte: new Date('2016-1-1')}
	},
	limit: 100
}
Is this a bug/limitation with Remote Objects, or is my query somehow malformed?
 

I'm getting this error "The page you submitted was invalid for your session. Please click Save again to confirm your change." from an inline Visualforce page on page layout.

We have 2 Standard Objects in which we've added inline Visualforce pages for our support personel to verifiy a customers pin. The PIN is stored encrypted on the Contact sObject.  The VF page and accompanying custom controller accepts input from our support personel, encrypts the input and checks to see if it matches what we have on record and displays an appropriate message.

I've been tasked with adding this functionality to another custom object (a child of Contact).  When I access the VF page directly I get no errors, but when I try to use it inline in the page layout I get this error.  

I've also noticed that the previously built functionality is also giving this error in our.  The odd thing is that this error is only happening in our sandbox (CS19) right now.  In production (NA28) the previous functionality is still working fine.

I'm not doing any URL hacking, or page redirecting.  I'm simpy rerendering the VF page.

 

<apex:form id="securityForm" >

		<div class="{!IF(hasPIN,'slds-show','slds-hide')}">
			<div class="{!IF(NOT(PINMatches),'slds-show','slds-hide')} input-wrapper">
				<div class="slds-form-element {!IF(AND(NOT(PINInput == ''), NOT(PINMatches)),'slds-has-error','')}">
					<label class="slds-form-element__label slds-form-element__label--small" for="{!$Component.pinInput}">Enter PIN supplied by Client</label>
			    <div class="slds-form-element__control">
			      <apex:inputText id="pinInput" styleClass="slds-input slds-input--small" value="{!PINInput}" onkeypress="return noenter(event);" />
			      <span id="pinError" class="slds-form-element__help {!IF(AND(NOT(PINInput == ''), NOT(PINMatches)),'slds-visible','slds-hidden')}">Incorrect PIN</span>
			    </div>
				</div>
				<apex:commandButton value="Submit" action="{!checkPIN}" rerender="securityForm" styleClass="slds-button slds-button--neutral slds-m-left--small"/>
			</div>

			<div class="{!IF(PINMatches,'slds-show','slds-hide')}">
				Security Information has been verified
			</div>
		</div>
</apex:form>


public void checkPin()
	{
		if(PINInput != null)
		{
			Blob inputBlob = Blob.valueOf(PINInput);
			Blob inputHash = Crypto.generateDigest('SHA1', inputBlob);
			String result = EncodingUtil.base64encode(inputHash);
			PINMatches = PINRef.equals(result);
		}
	}

 
I'm trying to implement a toString method on a custom class I've created.  However whenever I try to save I get the error. "Method must use the override keyword: String toString()".  I'm not sure exactly what I'm doing wrong.  Below is my code.
 
public String toString()
{
	return csvCell;
}

csvCell is defined as a private String.
I can't figure out how to do this.  There seems to be no global constant for blank/null associated with Date fields, and if I simply leave the assignment box empty it doesn't do anything.
Hi All, 

I am trying to create a validation rule that restricts the ability to change the status of a case to Transfer for all users. 
It should restrict the user from changing the status of a case with a specific record type to transfer, unless the user has a specific role which will allow it to use that status.

The syntax passes, but whenever I test the rule on a case I get the validation error with the roles listed.

Any help would be very appreciated. 

Thank you in advance!
 
AND( 
ISPICKVAL(Status, "Transfer"), 
RecordType.Name = "Example", 
OR( 
NOT($UserRole.Name = "CEO"), 
NOT($UserRole.Name = "CFO"), 
NOT($UserRole.Name = "CIO"), 
NOT($UserRole.Name = "Admin") 
) 
)

 

Hello,

I'm not a coder by any stretch, but I've been dabbling a bit to see if I can learn. We currently have a customer Lead convert page in our org where I'd like to add a field for "Qualifying Reason" (a custom picklist that has been created on the Lead). I mimicked some existing code to get the field on the visual force page and I tried to update the controller, by mimicking existing code as well.

What I get is a field for "Qualifying Reason" and picklist box with no values. From researching around, it looks like I need additional coding in my controller to pull the values, but my various attempts to do so have only created errors for me...

Can anyone provide any gudiance here?

Thank you!!!
TK


Visual Force Page:
                <apex:pageblocksectionitem >
                    <apex:outputlabel >Converted Status</apex:outputlabel>
                    <apex:outputPanel layout="block" styleClass="requiredInput">
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                        <apex:selectlist value="{!ConvertedStatus}" required="true" multiselect="false" size="1" onchange="processChange()">
                            <apex:selectOptions value="{!ConvertedStatuses}"/>
                        </apex:selectlist>
                    </apex:outputpanel>
                </apex:pageblocksectionitem>

Controller:

    public String QualifyingReason {get; set;}
    public List<SelectOption> QualifyingReasons {get; set;}


What my page looks like:
Visual Force page

Here we go ...

trigger o1 on Opportunity (Before Insert) {

for(Opportunity o:Trigger.new){
    ID aid = o.Account.ID;
Account a = [Select Name,Industry From Account WHERE ID = :aid];

if(a.Industry == 'Education'){
o.addError('No more Opportunity from Education Domain');
}
}
}

Above triggere is not allowing me to create opportunity for any account.
I can't figure out how to do this.  There seems to be no global constant for blank/null associated with Date fields, and if I simply leave the assignment box empty it doesn't do anything.
I'm trying to utilize Remote Objects in order to query a Custom Object.  My JSON criteria are below. My query returns data, the problem is that the first Custom_Date_Time__c field criteria is ignored.  As shown it will return all objects with date before January 1st 2016, and if I switch the lines it will return all objects with the date after January 1st 2014.  What I need are all objects with the date between these two.
{
	where:
	{
		RecordTypeId: {in: ids},
		Custom_Boolean__c: {eq: true},
		Custom_Date_Time__c: {gte: new Date('2014-1-1')},
		Custom_Date_Time__c: {lte: new Date('2016-1-1')}
	},
	limit: 100
}
Is this a bug/limitation with Remote Objects, or is my query somehow malformed?
 
I need to retrieve a value from a custom setting and incorporate it as a value in a Visual Flow. But I cannot see where custom settings are exposed to the flow designer.  any help?
My use case is that I am launching a report from the flow, and best practice is to store report IDs in custom settings to facilitate deployments.
Doug
Hi does any one has involved in filenet to salesforce integration..... if so please share your ideas about the integration Thanks in Advance

I have written a trigger on the Campaign Member object that gives users access to our subscription service when their campagn status changes to 'Free Trial'. The trigger works without fail but the test is failing because of this error: 

 

System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>: []

 

Here is my code:

@isTest
public with sharing class Test_Trial_Campaign {
	
	static testMethod void test(){
		
		list<Id> IdLst = new list<Id>();
		list<CampaignMember> cMemL = new list<CampaignMember>();
		
		Campaign testC = new Campaign(isActive = true, ActualCost = 0, Name = 'SystemTest');
		insert testC;
		system.debug(testC);
		
		CampaignMemberStatus status = new CampaignMemberStatus(CampaignId = testC.Id, HasResponded = true, label = 'Free Trial', SortOrder = 2);
		
		insert new list<CampaignMemberStatus>{status};
			
		for (Integer i=0; i<10; i++){
			Lead testL = new Lead(FirstName = 'Test', LastName = 'Testerino'+i, email = 'test@testing.co'+i, Trial_Product__c = 'SUB-RTE-01');
			insert testL;
			
			CampaignMember mem = new CampaignMember(CampaignId = testC.Id, LeadId = testL.Id, Status = 'Free Trial');
			IdLst.add(testL.Id);
			
			insert mem;
			
			CampaignMember testerino = [SELECT Id, Status from CampaignMember where id =:mem.Id];
			
			system.debug(testerino);

		}
	
		list<Lead> lList = [SELECT Id, isConverted From Lead Where Id IN: IdLst];
		
		for (Lead l: lList){
			system.debug(l);
			system.assert(l.IsConverted == true);
		}
	}
}

 

It fails when attempting to insert the CampaignMemberStatus. I have tried multiple workarounds, all of which have failed. Any insight is greatly apprechiated.