How do we bulkify a trigger to create multiple #mention chatter feeditems? - salesforce

I came across this problem, and I think right now there is no way to bulkify a trigger and include multiple chatter feed items with #mention?

Related

Access 365: update table row using split form

I have a very rookie question regarding making a simple Access database but for some reason I'm having trouble finding the proper keywords to adequately Google the problem. I'm certain the solution is going to be a simple toggle or setting I need to flip somewhere but I'm not sure what I'm looking for.
I have a table, tblClients. Each row has name, address, etc. I manually inputted a bunch of entries in here from datasheet view. I created a split form, frmClients, which will be to update client info in a more user-friendly fashion. At the moment, when the user makes any modifications in the form view and hit save, it appears to succeed but the actual data in the table row hasn't been modified. Do I need to change a setting somewhere or is there a different mechanism to post changes other than Ctrl+S or the save icon?
If there is necessary additional information I neglected to provide, please let me know. Thanks for your help.
-Marissa

Can I call a method in a trigger from another trigger in salesforce?

Can I call a method in a trigger from another trigger in salesforce? If so, can I just use inheritance?
It is a best practice to take all your trigger logic into a sepparate class. For example your tigger could looks like this
trigger AccountBeforeUpdate on Account (before update) {
TR_AccountBeforeUpdate.doSomeActions(trigger.new, trigger.oldMap);
}
And in TR_AccountBeforeUpdate you put all your logic. You can leave some data agregation in the trigger itself and pass you own set maps or lists (containing only objects matching some examples) Now you can call methods from TR_AccountBeforeUpdate or even instantiate it.
Read the following articles regarding trigger patterns and best practices
A Simple Trigger Template for Salesforce
Trigger Pattern for Tidy, Streamlined, Bulkified Triggers
Apex Triggers the Definitive Guide
Two interesting ways to architect Apex triggers
All articles provide a cool advice regarding architecture salesforce triggers and you can mix up these recommendations for create your own trigger template. I use the first one with some own improvements.

onSync Event and its properties

Hello People of Stackoverflow, I am using a persistent SharedObject for Adobe Media Server to store and share date in real-time for multiple clients. I am using the SyncEvent to dispatch any event that has been updated.
Reading through the documerntation the SyncEvent contains numerous properties. What i want to achieve is to use remote shared object to store a list of people who are online when one client disconnects all the other clients listed will be updated of the disconnection.
Adobe docs unfortunately doesnt provide any examples how to do this.
Would the best approach be to create a changeList array that contains properties of all members then execute a loop?
Or can anyone suggest any other method?
Thanks
The changelist property of the event contains only the properties that got changed. So, if your shared object contains the list of ids, you should be able to get what you achieve.
Note, that the notification is done for the top level properties stored in the shared object. So, what you want would probably look like:
idSo.setProperty("1", true);
while adding. To remove the user, you should use:
idSo.setProperty("1", null);
To reassert, having
idSo.setProperty("ids", <array of ids>)
would send the whole array when it's updated. So, this would be a bad approach
This sync event would be sent to all the connected shared objects.

Backbone/Laravel: How to post to a different table

Here's my dilemma. I have a series of tables with leads from our various contact forms. We also have tables for spam that comes in on our forms. But occasionally, a lead may get routed incorrectly to a spam table. So I need to move that lead from one table to the other, which means inserting it one and deleting it from the other.
As I understand it, when Backbone calls the save method, it checks to see if that id exists in the table. If it doesn't, it makes a POST request. If it does, it makes a PUT request. I need to be able to force Backbone to make a POST request, so that Laravel can call the right RESTful action.
See the problem is that if Backbone makes a PUT request to say, /send-message/52 (the 52 being the ID of the lead in the send-message-spam table), it will update/overwrite the existing lead with the ID of 52. I want to make a POST request to /send-message (obviously without an ID).
I can force Backbone to use a different urlRoot, but how do I force it to make a POST when I call save()?
I'm unsure if there is a configuration option to do this, but you could always override the save method in your Backbone model to have it perform the action you desire.

Why Do Some Related Entities Persist and Not Others in RIA Services?

I'm having a lot of troubles with RIA Services. I'm really wondering if it's worth the hassle at all. The problem I have now is similar to other problems: related entities. Let's say I have a class, Foo. Foo has two related entities, Bar and Fighter.
If I'm working on a new Foo, foo, and I want to add something to the Bars collection, it works just fine. Like:
foo.Bars.Add(new Bar{A=a, B=b});
But when I try to add a Fighter, it doesn't work:
foo.Fighters.Add(new Fighter{C=c,D=d});
I've been all around the interwebz looking for the solution. I've found the suggestions to use the [Include] attribute and the [Associated] attribute as well. Both have worked in some cases. But they're not working in this case and I have zero clue why. I've deleted and re-created my EDMX and my DomainService because someone suggested it, but it isn't working.
So what is wrong and what other information do you need to help me out? When I say try to add a Fighter to my foo.Fighters collection, it's not persisting the add. I will note that I'm trying to add an existing Fighter in my specific example, not a new Fighter, if that helps/gives clues.
If you need information or real code samples, I'll be happy to oblige. Thanks in advance to all that try to help.
A number of things to check and confirm
The Fighter table has a foreign key defined in the database.
Use [Association], [Include], and [Composition] attributes. Association defines the relationship. Include instructs the server to send the instance or contents of the collection to the client, if populated. Composition instructs WCF RIA to track changes to the collection and send them back to the server.
Ensure you are calling context.SubmitChanges() after all the adds in Silverlight.
Ensure you have an insert method on your DomainService.
Maybe one or more of these will help.

Resources