• Abby Becker
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 4
    Replies
I am a new 'admineloper' of a brand new Financial Services Cloud org.

We have records coming from our banking core and my business unit does not want to change the record type of them. They all come in with the same record type on an object within the managed package. They want different page layouts (or Visual Force pages) dependent on a value in a field on the record.

I have no idea how to execute this - directing records of the same record type to different layouts (or Visual Force pages) based on a field value - not the record type... is this even possible?

I am working in a managed packaged, Financial Services Cloud, and am aware that this limits my development, although - this early on - I'm not sure to what extent...

Any advice or direction is appreciated. Thanks.
Hi,

I work for a community bank as an 'admineloper.' I have a custom object named Financial_Account__c and a field on that object named Responsibility_Code__c. This information is flooded from our core financial processor every night by an ETL tool. Currently, every Financial_Account_c record is owned by a dummy user used by our ETL tool. (As far as I'm aware, this is due to a limitation of our ETL tool/core.)

We are looking for a way to correct that so a User owns the record - not the dummy account.

My initial thoughts are to create a field on the User object named User_Responsiblity_Code__c and build some logic to evaluate 'if User_Responsibility_Code__c on the User object matches Responsiblity_Code__c on the Financial_Account__c custom object, change Record Owner to that User.'

I'm just not entirely sure how to go forward. Any insight or suggestions would be appreciated.

Thanks.
New 'adminelope'r here - grateful for any advice that's thrown my way!

I have an Apex trigger on the Attachment sObject that changes the value of a checkbox on a related object to True when an attachment is added to the record. Below is the trigger:
 
trigger AttachmentAdded on Attachment (before insert) {	
 	
	list<Customer_Tool__c> ctListA = new List<Customer_Tool__c>();
	list<Customer_Tool__c> ctListB = new List<Customer_Tool__c>();
	Set<id> ctID = new Set<id>();

	for(Attachment at : trigger.new) {
		ctID.add(at.parentid);
	}

	ctListA = [Select id, Has_Attachment__c from Customer_Tool__c where id in: ctID];
		if(ctListA!=null && ctListA.size()>0){
			for(Customer_Tool__c ct : ctListA) {
				ct.Has_Attachment__c = true;
				ctListB.add(ct);
			}
			update ctListB;
		}
}

When the Has_Attachment__c custom field is updated to 'True,' I have a workflow rule that executes to notify another department that an attachment has been added to the record. The workflow rule also has a Field Update that "unchecks" the Has_Attachment__c field so that if ANOTHER attachment is added, they'll be notified again.

My question is how do I write a test class for this? When I deactivate the workflow rule, my test class passes. It's the workflow rule and field update that is messing it up... I just don't know how to go forward from here. Below is my test method:
 
static testMethod void testOneAttachment () {
		Customer_Tool__c ct1 = new Customer_Tool__c();
		insert ct1;

		Attachment att = new Attachment();
		Blob b = Blob.valueOf('Test Data');
		att.Name = 'Unit Test Attachment';
		att.Body = b;
		att.ParentID = ct1.Id;
		att.IsPrivate = false;
		insert att;

		List<Customer_Tool__c> cts = [select Has_Attachment__c from Customer_Tool__c where Id = :ct1.Id];

		System.assertEquals(1, cts.size());
		System.assertEquals(true, cts[0].Has_Attachment__c);  //This is failing the test because of the field update
	} //testOneAttachment

Thanks in advance

Hi all,

New "admineloper" here. I have an Apex trigger that checks a custom field "Has_Attachment__c" when an attachment is added to a record, then a workflow rule that sends an email alert to the record owner, notifying them that an attachment has been added.  Right now, it works great the FIRST time an attachment is added. Any further attachments, don't generate emails.

How can I go about sending an email for every added attachment? Is there a way to uncheck the box after the trigger has executed and the email has been sent? Below is my Apex trigger.
 

trigger AttachmentAdded on Attachment (before insert) {	
 
	list<Customer_Tool__c> ctList = new List<Customer_Tool__c>();
	list<Customer_Tool__c> ctListAdded = new List<Customer_Tool__c>();
	Set<id> ctID = new Set<id>();

	for(Attachment at : trigger.new) {
		ctID.add(at.parentid);
	}

	ctList = [Select id, Has_Attachment__c from Customer_Tool__c where id in: ctID];
		if(ctList!=null && ctList.size()>0){
			for(Customer_Tool__c ct : ctList) {
				ct.Has_Attachment__c = true;
				ctListAdded.add(ct);
			}
			update ctListAdded;
		}
}
 

Very new to development - so any advice/help/guidance would be greatly appreciated!

Thanks,

Hi,

I work for a community bank as an 'admineloper.' I have a custom object named Financial_Account__c and a field on that object named Responsibility_Code__c. This information is flooded from our core financial processor every night by an ETL tool. Currently, every Financial_Account_c record is owned by a dummy user used by our ETL tool. (As far as I'm aware, this is due to a limitation of our ETL tool/core.)

We are looking for a way to correct that so a User owns the record - not the dummy account.

My initial thoughts are to create a field on the User object named User_Responsiblity_Code__c and build some logic to evaluate 'if User_Responsibility_Code__c on the User object matches Responsiblity_Code__c on the Financial_Account__c custom object, change Record Owner to that User.'

I'm just not entirely sure how to go forward. Any insight or suggestions would be appreciated.

Thanks.
New 'adminelope'r here - grateful for any advice that's thrown my way!

I have an Apex trigger on the Attachment sObject that changes the value of a checkbox on a related object to True when an attachment is added to the record. Below is the trigger:
 
trigger AttachmentAdded on Attachment (before insert) {	
 	
	list<Customer_Tool__c> ctListA = new List<Customer_Tool__c>();
	list<Customer_Tool__c> ctListB = new List<Customer_Tool__c>();
	Set<id> ctID = new Set<id>();

	for(Attachment at : trigger.new) {
		ctID.add(at.parentid);
	}

	ctListA = [Select id, Has_Attachment__c from Customer_Tool__c where id in: ctID];
		if(ctListA!=null && ctListA.size()>0){
			for(Customer_Tool__c ct : ctListA) {
				ct.Has_Attachment__c = true;
				ctListB.add(ct);
			}
			update ctListB;
		}
}

When the Has_Attachment__c custom field is updated to 'True,' I have a workflow rule that executes to notify another department that an attachment has been added to the record. The workflow rule also has a Field Update that "unchecks" the Has_Attachment__c field so that if ANOTHER attachment is added, they'll be notified again.

My question is how do I write a test class for this? When I deactivate the workflow rule, my test class passes. It's the workflow rule and field update that is messing it up... I just don't know how to go forward from here. Below is my test method:
 
static testMethod void testOneAttachment () {
		Customer_Tool__c ct1 = new Customer_Tool__c();
		insert ct1;

		Attachment att = new Attachment();
		Blob b = Blob.valueOf('Test Data');
		att.Name = 'Unit Test Attachment';
		att.Body = b;
		att.ParentID = ct1.Id;
		att.IsPrivate = false;
		insert att;

		List<Customer_Tool__c> cts = [select Has_Attachment__c from Customer_Tool__c where Id = :ct1.Id];

		System.assertEquals(1, cts.size());
		System.assertEquals(true, cts[0].Has_Attachment__c);  //This is failing the test because of the field update
	} //testOneAttachment

Thanks in advance

Hi all,

New "admineloper" here. I have an Apex trigger that checks a custom field "Has_Attachment__c" when an attachment is added to a record, then a workflow rule that sends an email alert to the record owner, notifying them that an attachment has been added.  Right now, it works great the FIRST time an attachment is added. Any further attachments, don't generate emails.

How can I go about sending an email for every added attachment? Is there a way to uncheck the box after the trigger has executed and the email has been sent? Below is my Apex trigger.
 

trigger AttachmentAdded on Attachment (before insert) {	
 
	list<Customer_Tool__c> ctList = new List<Customer_Tool__c>();
	list<Customer_Tool__c> ctListAdded = new List<Customer_Tool__c>();
	Set<id> ctID = new Set<id>();

	for(Attachment at : trigger.new) {
		ctID.add(at.parentid);
	}

	ctList = [Select id, Has_Attachment__c from Customer_Tool__c where id in: ctID];
		if(ctList!=null && ctList.size()>0){
			for(Customer_Tool__c ct : ctList) {
				ct.Has_Attachment__c = true;
				ctListAdded.add(ct);
			}
			update ctListAdded;
		}
}
 

Very new to development - so any advice/help/guidance would be greatly appreciated!

Thanks,

Hello, as from the title of my post I am having problems with some simple stuff, but I assume it's a problem with my companies connection or salesforce.

My playgrounds will get created, but when I go to launch them it comes up with "This page can't be displayed", and even after refreshing 5+ min down the road, nothing happens.

Also, during my sample data initialization. I would let it pend for about 5-10 min before I'd try to refresh the page, but it also wouldn't go through.
The internet at my company is a little slow today, but everything else seems to work fine, so I am not sure if it's a salesforce related issue or not.

Thanks for any insight.
Hello, as from the title of my post I am having problems with some simple stuff, but I assume it's a problem with my companies connection or salesforce.

My playgrounds will get created, but when I go to launch them it comes up with "This page can't be displayed", and even after refreshing 5+ min down the road, nothing happens.

Also, during my sample data initialization. I would let it pend for about 5-10 min before I'd try to refresh the page, but it also wouldn't go through.
The internet at my company is a little slow today, but everything else seems to work fine, so I am not sure if it's a salesforce related issue or not.

Thanks for any insight.