Generate email once order is changed to filled in netsuite - workflow

Once someone clicks on the fulfill button on the Sales Order I want it to send an email to someone.How can make this occur in Netsuite?

You can create a custom workflow on sales order and configure the worflow to send email to the specific email id. The email id can be either custom one / a field value from the sales order record (ex. customer, salesperson etc.,)
The condition for the workflow will be
OldRecord.Status!="Pending Fulfillment" && NewRecord.Status!="Pending Fulfillment"
Thanks
Frederick D

you can write a user event on Item Fulfillment record type and send email using nlapiSendEmail()
You may want to put a check in script if type == 'create' to avoid sending email on other record operation.

Related

Workflow - get transaction Created By Field

How do I get Created By field of any transaction in workflow. I'm creating a workflow that is applied to Bill record. Bill record is created from PO. I want to send an email to the created by of PO record when Bill gets created.
But I am unable to find that field in workflow.
Hi Refer "Access Purchase Order Fields on Vendor Bills via SuiteFlow"
Suite answer id :37827

How to Add Followers Into The Recipient Field of an Email in Odoo?

I'm currently using Odoo 12.0+e-20181025 and I'm trying to add the followers of each ticket made in helpdesk into an automated email whenever it has been changed (not only in stage). So far I've tried some codes and managed to put the followers' emails into the body of the text, but in the recipient field.
Here is the code I used:
% for follower in object.message_follower_ids:${follower.email_formatted}%endfor
I can use it in the body text but I can't produce any result in the Email To field. Any help is greatly appreciated.
You could use ${str(object.message_partner_ids.ids).replace('[', '').replace(']', '')} in "To (Partners)" field.

Salesforce: trigger on related list

Suppose I have two objects
1.Account- standard object[it has a field name Status_c which is a picklist having value inprogress and closed]
2.Client_c - custom object[it also have same field name Status__c which is a picklist having value inprogress and closed]
and Client__c has lookup to Account name which means Account has a related list of client object .
My question is :
I want to write a trigger where if I put account status to "closed" I can not put client status to "closed",it should throw an error message on client object or if I put client status to closed I can not put account status to closed vice versa.
Can any one please help me to write a trigger on this??
Conceptually, I think what you are looking to do is set up Validation Rules on both of those objects. Your validation rule on Client_c should be pretty simple: TEXT(Status_c) == 'Closed' && TEXT(Account_c.Status_c) == 'Closed'
The more interesting piece is how you handle making sure none of your related items are Closed when you move the Account to Closed. I tend to prefer creating a field on the Account that keeps track of the status of the related items (checkbox) that basically tells me whether it is valid for me to change my status or not. In this case, the validation rule becomes pretty simple. In order to set that boolean value, I end up using a Trigger on Client__c that basically just grabs all the Accounts when a Client is being modified in the batch (taking into account both inserts, upserts, and deletes):
SELECT Account__c.Id FROM Client__c WHERE Id =: Trigger.new OR Id =: Trigger.old
Then create a Set of all the Account Ids (in this example, named accounts), and run a query to retrieve ALL Clients related to those Ids (in a single query to ensure you don't hit SOQL limits).
SELECT Account__c.Id, Status__c FROM Client__c WHERE Account__c.Id =: accounts
From the results of this, you will iterate over all of the entries, tossing them into a Map keyed by the Account Id where the value is a List of Clients. When you are done, run a query to get all accounts based on the "accounts" list from earlier (which was just a list of strings, not actual Accounts), subsequently iterate over all the Clients associated with that Account, and if a Client is marked as Closed, you will update the metadata of that Account accordingly. If no Clients are closed, the Account will be marked as such. Once you are finished, run an update statement to update the list of Accounts that you have modified.

Create Email with a workflow in MS Dynamics Crm 2011 and dynamically fill the "To" field

I'm working on Ms Dynamics Crm 2011 development and I encountered following problem.
My situation:
I want to be able to automatically send an Email after a change on a specific status field on a record of the Entity "MyEntity". "MyEntity" has an Email-field. I try to create a workflow which sends an Email to the Email-field address of the "MyEntity" record after the status has been changed. My problem is that I can't add in the Email Creation workflow to the "To" field this "MyEntity" Email-field adress. I need to somehow specify in the workflow to dynamically add the "To" field, the relating Email address from the specific "MyEntity". Is that possible? Is there a workaround for that? It could be done with a plugin I guess, but by now I'm trying to avoid the plugin solution.
Thanks in advance
John
Yes, you should be able to. First go to Solutions, bring up your entity, go to Fields, bring up your e-mail field and ensure the Format is e-mail. Publish.
Work around: If you have more than 1 e-mail Format text field, change the others temporarily (to text from e-mail) and Publish. Otherwise, the next step is ambiguous and we don't have control over which field CRM sets up as the email to use when this entity is used for e-mail.
In the solution frame, select your entity node in the tree. Under Communication and Collaboration, check the box 'Sending e-mail (If an e-mail field does not exist, one will be created).' Save/Publish.
Fix the work around above if you had more than 1 e-mail format text field. Change them back to e-mail. Publish.
In Workflow, select your To Field. Under the Send e-mail step, select 'Set Properties.' Select the 'To' field. In the form assistant you should not be able to select your entity. NOTE: You will bind to the 'Key' field and NOT to the particular e-mail field.
This only works for a single e-mail field on your custom entity. There is no way to use a text field as an address in a CRM 'to' field.
Unfortunately you cannot.
Out of the box the To field in an email accepts only
Account
Contact
Facility/Equipment
Lead
Queue
User
So in order to achieve the goal , you will have to write a custom workflow activity (optional : taking the custom text field in your input parameter )and refer it in your workflow or develop a plug-in.
Sample code for Plugin:
SendEmailRequest req = new SendEmailRequest();
req.EmailId = emailId;//ID of created mail
req.TrackingToken = "";
req.IssueSend = true;
For more information check this post Crm 2011 :Workflow - Sending email problem

Drupal Simplenews - How to subscribe all existing users?

Registered users were created first, then Simplenews was added.
How to set up mailing to all already registered users?
I get that you can send emails only to those who joined after you install the module. But I need the existing users' addresses included also.
I found a solution only cure addresses from the database, then export, and put them in a mass subscription.
I just did the following successfully on an up-to-date Simplenews module, with a 3000+ user base. The answer comes from http://cc.com.au/2010/02/03/drupal-simplenews-mass-subscribe
So what I do first is select the uid and email address for all authenticated users (the anonymous user has uid 0, so I select only users with a higher uid) and insert those into the simplenews_subscriptions table.
INSERT INTO simplenews_subscriptions(activated,mail,uid) SELECT 1,mail,uid FROM users WHERE uid > 0 ORDER BY uid ASC;
This automatically assigns a snid (subscription id) to each entry. You'll notice that rather than selecting a column value into the activated field, I just set it to 1.
Next, I need to find the taxonomy term ID (tid) for the particular newsletter to which I want to subscribe all users. You can find this either by listing the terms in the Newsletter vocabulary or by listing all newsletters. In both cases the term id will be shown in your web browser's status bar if you hover the mouse over the edit link: http://example.com/admin/content/simplenews/types/edit/42
On my Drupal site the tid is 42, so that is the newsletter number I want to subscribe my users to. I need to refer to them via the automatically assigned snid from the simplenews_subscriptions table, so I select that and insert it directory into the simplenews_snid_tid table, together with the correct tid.
INSERT INTO simplenews_snid_tid(snid,tid) SELECT snid,42 FROM simplenews_subscriptions;
D7 Solution
To add all users that are not already subscribers run this query
insert into simplenews_subscriber(activated, mail, uid) select 1, mail, uid from users where uid not in (select uid from simplenews_subscriber) and uid > 0;
And to subscribe them to a newsletter run this query
insert into simplenews_subscription(snid, tid, status, timestamp, source) select snid, 31, 1, unix_timestamp(), 'manual' from simplenews_subscriber where snid not in (select snid from simplenews_subscription);
Remmember to replace the number 31 by the number of your newsletter.
You should be able to implement this using Views, VBO and Rules.
Create a view that lists your users (with filters, if you want), create a rules component that receives a user as argument and then subscribe the mail address of that user using the provided action (make sure you've enabled the simplenews rules module).
Then enable bulk operations on the view with that rules component.
Credit #Berdir https://www.drupal.org/project/simplenews/issues/1564988