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

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 8
    Replies
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.