I'm trying to create a plugin on CRM 2011 online to notify users by mail when an opportunity is updated.
In the email, I need to have the value of some fields before and after the update.
So, I'm using Post operation on update message for the opportunity entity with the pre and post image.
It's working well if I update any fields except for the owner of the opportunity. I changed it, I get two emails generated. One with the owner who owns the record before the update and one with the owner who owns the record after the update. So I supposed that the plugins is called twice.
I think that I have an infinite loop in my plugin and I take a look at the depth property but it's not working for me.
Any help is greatly appreciated.
Owner is updated using other then Update message - Assign message is used. So I assume that behaviour of your plugin is correct.
Related
I am trying to create a script that will auto-email a person. Basically, this sheet is going to have a list of items and track those items, and I need to assign each item when it comes it. When I assign it to a person's name, I want the script to then email that person. There are only about 15 people, but I assume I would need a script for each person aka if I put "Sally" in the sheet, there is a script to now email "Sally" to say she has been added to this task.
Ideally, I would like a way to also generate an email again to "Sally" if I update her task, add a comment to it, or do another input to do some sort of follow-up.
Any help would be appreciated immensely!
It wont be good to directly post the complete solution but I will mention the required functionalities which I get in my mind , please use them to solve your task:
onEdit(e) - use this to trigger a particular set of functions whenever a particular range or cell value is changed(it may be automated or manual both can trigger this function) look into the official documentation for how to detect the changes occurred in which cell(https://developers.google.com/apps-script/guides/triggers)
once the new task is assigned to a person(for first time) send an email to that person using GmailApp(install the library in app script) , get the ThreadById of this email and store it into the sheet along the same row, if any changes are made afterwords like adding comments or something,use this threadId to reply to the same email using "thread.reply"(How do you reply to email thread with google Mailapp?)
I think you have also asked how to make the system dynamic, I mean you are right now coding as if each member needs a code for his/her entry. Please study a bit deeper you will easily find an approach to make it dynamic using the onEdit and some for loops as the way you are thinking is not recommended in automation scenarios.
I created a plugin that should upload the contact entity "entityimage" to an external storage.
The code itself should works (it works as a console app), but I am unable to add a step that trigger on "entityimage" change as I can't find it in the filtering attribute list in the Plugin Registration Tool.
Is there a way to trigger this plugin only when "entityimage" change?
Regards,
Dremor
Reviewing the Contact's entityimage field in the Metadata Browser indicates that it is a "Virtual" field, which may be why it is unavailable as a filtering attribute.
Also, according to the SDK there does not appear to be any other message available besides "Update" on the Contact that could be used to indicate that the entityimage has changed.
And, changing the image through the UI does create an Audit History entry, however, it is a generic "Update" entry, with the old value and new value blank.
It appears that triggering a plugin on change of only the entityimage field is not possible, nor do there appear to be any OOB hooks to see if that field has changed.
The only other think I can think to research is Change Tracking. Otherwise it looks like you may have to upload the image on any Update of a Contact.
Or, you could sync the image URL's from CRM to an external system and compare the one in CRM to the external system before uploading.
Strangely enough, if you don't set any filtering attributes the plugin does get triggerd when changing the image, but i guess this also means that all field changes will trigger it.
Does anyone have a working example of a hook to update a document with a timestamp on update?
I was able to set the timestamp on record creation by using DEFAULT sysdate().
This doesn't help me when updating an existing record. Any advice would be appreciated.
Ok. Check out this thread in GG. I posted a Javascript function, which does what you are asking for.
All you need to do is save what I came up with as a custom function then create the customer trigger property on your class. See this section of the docs on how to do that.
Scott
I'm sure the first answer is great but here's another option I wrote for myself. It takes a schemaless prop from your updating record to save the editing user, and could be extended to save the field being updated too.
We are using the Tuleap 7.0 for Project management. We have a new requirement that we need to show the contact number of current logged in user when a artifact is submitted either in a separate field or in the same field (submitted by). Is it possible to show or what type of code change has to be done, to retrieve the current logged in user information when artifact is created. Kindly do needful.
That's not easy. There are two main steps: one surrounding the user; the other surrounding the artifact.
First you would need to edit PFUser.class.php to add the property to the user object. You would also probably need to create a forgeupgrade script (database upgrade) so that you could save and modify the property. Obviously the UI and scripts that manage the CRUD of a user would also need changing.
Next, you would need to create a new type of class that extends TrackerformElementField, make that type available for use in the Tracker Field administration and set its value to the user's contact number.
Unfortunately, any of these modifications, if not done carefully, can have important side-effects. If you want to write your code and have it reviewed by the community, you can go through gerrit.tuleap.net and read the developer guide
Good afternoon. Thank you in advance for taking the time to read this. Inside of a Dynamics CRM 2013 environment, I have a custom entity which holds 3 data grids. Whenever a record (of contact, account or lead) is added to its respective datagrid, it adds the record to a static marketing list via a custom plugin I wrote. The trouble I'm having is that when I use the "Manage Members" (to add/remove records using the advanced find feature) it's not firing at all. The plugin IS firing correctly when I add/remove items from the custom entity using the "+" and "trash can" buttons. The RemoveMember portion is firing when I use "Remove from Marketing List" button list as well, just not from "Manage Members". I have three steps registered on this plugin, associate on post-op/sync, disassociate on pre-op/sync, and removemember on post-op/sync. The idea is to be able to add or remove records from my custom entity OR the marketing list, and it auto-updates the other.
Does anybody have any suggestions or advice on how to fire a plugin when using the "Manage Members" portion of marketing lists? I've tried all valid combinations of messages and steps that I could think of, and I've written and re-written the code a few times to try to get it to work. Below is a pastebin with my code.
http://pastebin.com/X1n017Nr
Thank you.
I created a second plugin and moved the logic for AddMember into it. I have no idea why, but this solved my problem.
Try this approach, hope this can help you:
Register the plug-in on the 'Update' Message.
Ask for the parentContext.Message AddMember, RemoveMember y AddMembersByFetchXml, the last one maybe is the message you can't find.
Do the logic you need with de message.
This worked for CRM2011.