Using SPUtility.SendEmail inside a state machine workflow not working
I have a State Machine Workflow. I have developed in visual studio 2010 for a SharePoint 2010 site. I want to send emails to couple of people inside an activity and my code will decide the email receiver. When I assign the task from my code to some one the
State Machine workflow is sending mail to the task assignee and assigning the task to that person. But if I want to send mail to some additional person from the workflow, it is not allowing me to send that. The code I am using for the same is, SPUtility.SendEmail(SPContext.Current.Web,
headers, mailBody);
Can any one please let me know, why it is not sending mail with this code, or what can be the solution for the same.
Thanks
Hi Monali,
Thanks for your sharing.
Best regards,
Patrick
Patrick Liang
TechNet Community Support
Similar Messages
-
Create Multiple tasks for Single Item in List using state machine workflow in sharepoint
Hi,
I want to create multiple create tasks for Single Item in List based on Assigned to column using state machine Workflow through visual studio
Here Assigned to column allows multiple users. so i have to create task for every user based on column .
I'm trying for this but i didn't got any solution
Please provide solution for this.Hi,
According to your post, my understanding is that you wanted to allow multiple users to approve.
There are some articles about creating parallel tasks in state machine workflow, you can have a look at them.
http://www.codeproject.com/Articles/477849/Create-Parallel-Task-in-State-Machine-Workflow-in
http://msdn.microsoft.com/en-us/library/office/hh128697(v=office.14).aspx
http://social.technet.microsoft.com/Forums/office/en-US/b16ee858-4360-479a-a686-4ee35b7be9db/sharepoint-2010-workflow-creating-multiple-tasks?forum=sharepointdevelopmentprevious
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support -
SharePoint 2013 State Machine Workflow Developped using Visual Studio 2013 Terminated
Hi all,
I developped a state machine workflow using Visual Studio 2013, and deplyed to SharePoint 2013, the workflow work fine for first task, and some times for second task.
after that the workflow become terminated with below error:
- System.Activities.Statements.WorkflowTerminatedException: The workflow instance exceeded the throttle of 10000 activities executed in a row and could not be unloaded because it was not persistable.
I spent many days to solve this issue but witout any result...
Please advice...Hi,
According to your description, there seems an endless loop in your workflow which makes the workflow exceed the throttle.
A suggestion is that you can create a new clean sample state machine workflow firstly, when it works without error, then adding other activities with custom logic
gradually.
By doing this, it would be easier to find out what might cause the error in this workflow.
A demo about Create State machine Workflow In SharePoint 2013 for your reference:
http://www.splessons.com/2013/12/create-state-machine-workflow-in-sharepoint-2013-using-visual-studio-2012/
Best regards,
Patrick
Patrick Liang
TechNet Community Support -
i have developed the State machine workflow in which i am using default workflow task
i have added one status dropdown and that is having approve or reject that i set using workflow task drop down values
now my requirement is that when my workflow goes to different approval i need to have different status values in dropdown
for example
on manager approval state activity i need to add additional status value forward to legal
but when it moved to next activity this task status field should show only approve and reject
in summary i need to have different status values for workflow task when it moved to different state activity(approval levels)
can we set these status field of task for state machine workflow programtically as well like for different approval level of task i need different status to be set for the dropdown of task status field
MCTS,ITILHi Shahid Siddique,
I have seen a similar thread from you about this issue, create custom form for the seperate form is a considerable workaround, you can have a check whether it works.
http://social.technet.microsoft.com/Forums/en-US/9baa0c32-1cde-4c58-aa7c-3568ccf0cdc9/different-approval-level-of-task-i-need-different-status-to-be-set-for-the-dropdown-of-task-status?forum=sharepointdevelopmentprevious
Thanks,
Qiao Wei
TechNet Community Support -
How to REpublish Custom Task Forms (InfoPath) to SharePoint 2010 State Machine Workflows
I am new to SharePoint. Sorry if answer to my question is obvious.
I've create Custom Task Form in InfoPath and publish it (File/Publish/Network Location [Form Template Path and filename='MYPROJECT/Forms/ApprovalForm.xsn'; Form template name='ApprovalForm'], in the next window I've cleared Public URL according to the articlehttp://www.codeproject.com/Articles/195348/SharePoint-2010-State-Machine-Workflows-with-Custo).
After it I've added module Forms, and added ApprovalForm.xsn from the existing items.
My xml files: Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Workflow
Name="Order New Server"
Description="My SharePoint Workflow"
Id="482cbc86-b717-4981-a49a-3cf4c89e9399"
CodeBesideClass="Myproj.OrderNewServer.OrderNewServer"
CodeBesideAssembly="$assemblyname$"
TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160">
<Categories/>
<AssociationData><Data></Data></AssociationData>
<MetaData>
<AssociationCategories>List</AssociationCategories>
<Task2_FormURN>urn:schemas-microsoft-com:office:infopath:ApprovalForm:-myXSD-2012-03-09T14-11-55</Task2_FormURN>
<StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>
</MetaData>
</Workflow>
</Elements>
Feature.Template.xml:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" ReceiverAssembly="Microsoft.Office.Workflow.Feature, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Receiverlass="Microsoft.Office.Workflow.Feature.WorkflowFeatureReceiver">
<Properties>
<Property Key="GloballyAvailable" Value="true" />
<Property Key="RegisterForms" Value="Forms\*.xsn"/>
</Properties>
</Feature>
My form work fine, but when I make changes and republish it, it doesn't update (I see old form). What I tryed:
IISReset
Clear all cookies and cache in IE
Retract solution, restart VS2010, reboot computer.
Change assembly number, guid.
I have no ideas, what can I try for republish my form with changes.
Thank you in advance for any suggestions.
PS: sorry for my writing. English is not my native language.
PPS: when I save new Form to new location and add it to the project, it works.I've found how can I republish changes. But it seems more like crutch than solution, but it works:
After republishing InfoPath form, I delete file from project (DEL on ApprovalForm.xsn in Solution explorer) and after it add it again. (Add/Existing Item). And then redeploy! Hurray!
Is there any way to redeploy a Task Form directly on the server without importing it in Visual Studio again? I am using some data connections in my task form which are different for different environments (staging, dev. etc.). Seems like I've to create a separate
Workflow WSP file for each envrionment. Any comments? -
How to update task status from custom task in state machine workflow
i m using custom task for state machine workflow
i am using
if(this.onTaskChangedSupervisorAction_AfterProperties.ExtendedProperties["Workflowstatus"].ToString().Contains("Approved"))
if above is true moving forward its working fine but i want to update the status field of task as i can update the title and due date for the task but how can i change the status once approved it
should show the status as approved it's only showing in progress
this.CreateTaskSupervisorAction_TaskProperties.Title="supervisor task"
MCTS,ITILIf your task shows In Progress state then I think you need to look at your workflow and make sure you are using Complete Task activity and if you are already using Complete Task Activity then verify the Correlation ID. Ideally you are not required to set
this value in workflow. You simply use the Complete Task Activity.
If you are running into issue where your workflow is staying in In Progress state even after the task is complete then you can look at the following blog post.
How to programmatically complete Approval workflow task
Amit -
How to send email using SPUtility.SendEmail method
hi all,
I am using SPUtility.SendEmail method to send email to list of users. but i am unable to send it. Code is not throwing any kind of error. Can anyone guide me steps to send email programmatically .
Regards,
Milan C.Hello Milan,
Humm,
Problably code is correct, need to speak with System administrator of mail server/exchange to know what rules exist on server mail.
Verify if server mail validate IP from server to allow send mail.
Verify if exist some rule from server mail that validate sender with some domain "[email protected]"
Verify if Email server have relay active to send Emails externaly
Verify what type of authentication exist on you server Email, "Anonymous access or Login as password access", https? port number?
This info is very important to have before you configure emails on sharepoint, to preview problems....
André Lage Microsoft SharePoint, CRM and Sybase Consultant
Blog:http://aaclage.blogspot.com
Codeplex:http://spupload.codeplex.com/http://simplecamlsearch.codeplex.com/ -
Problem in using aggregate functions inside case statement
Hi All,
I am facing problem while using aggregate functions inside case statement.
CASE WHEN PSTYPE='S' THEN MAX(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ELSE SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) END,
how can I achieve above requirement ? Con anyone help me.
Thanks and Regards
DGHi All,
Below is my query:
SELECT
CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT
ELSE POS.PACCT || '-' || DECODE(POS.SYSTEMCODE,'GMI1','1', 'GMI2','2', 'GMI3','4', 'GMI4','3', '0') ||POS.PFIRM|| NVL(POS.POFFIC,'000') END,
CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-')
ELSE POS.PFIRM||POS.POFFIC||POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-') END,POS.SYSTEMCODE,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,POS.PEXCH||DECODE(POS.PSUBEX,'<NULL>',''),
POS.PCURSY,
CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) END ,
NVL(POS.PSUBTY,'F') ,POS.PSTRIK,*SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ,SUM(DECODE(POS.PBS,2,ABS(POS.PPRTQ),0))* ,
POS.PCLOSE,SUM(POS.PMKVAL) ,
TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
POS.UBS_ID,POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER ,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,TO_CHAR(POS.BUSINESS_DATE,'YYYYMMDD'),
POS.SOURCE_GMI_LIB,
--DECODE(POS.SYSTEMCODE,'GMI1','euro','GMI2','namr','GMI3','aust','GMI4','asia','POWERBASE','aust','SINACOR','namr',POS.SYSTEMCODE),
DECODE(p_reportid,'RVPOS_SING','euro','RVPOS_AUSTDOM','aust','RVPOS_AUSTEOD','euro','RVPOS_GLBLAPAC','asia','POS_RV_SN','namr','POS_PB','aust',POS.SYSTEMCODE),
POS.RIC,
CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
NVL(C.SSECID,POS.PCUSIP),
NULL,
POS.PYSTMV,
POS.PMINIT,
POS.PEXPDT,
CASE WHEN POS.PSUBTY='S' THEN SUBSTR(C.ZDATA2,77,1) ELSE NULL END,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
FROM POSITIONS_WRK POS LEFT OUTER JOIN
(SELECT * FROM CDS_PRODUCTS CP INNER JOIN FUTURE_MASTER FM ON
(CP.STRXCH=FM.ZEXCH AND CP.SFC=FM.ZFC AND CP.BUSINESS_DATE = FM.BUSINESS_DATE )) C ON POS.PCUSIP = C.SCUSIP
AND NVL(POS.PCUSP2,'X') = NVL(C.SCUSP2,'X')
WHERE
POS.PEXCH NOT IN ('A1','A2','A3','B1','B3','C2','D1','H1','K1','L1','M1','M3','P1','S1')
AND (POS.PSBCUS IS NOT NULL OR POS.PCTYM IS NOT NULL OR POS.PSTYPE ='S')
AND POS.BUSINESS_DATE = run_date_char
GROUP BY
POS.UBS_ID,POS.SYSTEMCODE,POS.RECIPIENTCODE,POS.BUSINESS_DATE,POS.PACCT,POS.PFIRM,POS.POFFIC,POS.PCUSIP,POS.PBS,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,
POS.PEXCH,POS.PSUBEX,POS.PCURSY,
CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) END,
NVL(POS.PSUBTY,'F') ,POS.PSTRIK,POS.PCLOSE,TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,POS.PSUBTY,POS.SOURCE_GMI_LIB,RIC,
CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
NVL(C.SSECID,POS.PCUSIP),
POS.PYSTMV,
POS.PMINIT,
POS.PEXPDT,
CASE WHEN PSUBTY = 'S' THEN SUBSTR(C.ZDATA2,77,1) ELSE NULL END;Now, could you plz help me in replacing the bold text in the query with the requirement.
Thanks and Rgds
DG
Edited by: BluShadow on 16-May-2011 09:39
added {noformat}{noformat} tags. Please read: {message:id=9360002} for details on how to post code/data -
How to debug Sequential workflow and state machine workflow?
Hi All,
How to debug Sequential workflow and state machine workflow?
Thanks in Advance!check this
http://msdn.microsoft.com/en-IN/library/bb386166(v=vs.90).aspx
http://msdn.microsoft.com/en-us/library/vstudio/ee231573(v=vs.100).aspx -
Build state machine has not been initialized
Problems occurred when invoking code from plug-in: org.eclipse.core.resouces
eclipse.buildId=M20100211-1343
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=pt_BR
Command-line arguments: -os linux -ws gtk -arch x86
Error
Wed Oct 20 08:19:22 BRST 2010
Build state machine has not been initialized.
It occurs when building the project and after the error happens once, it always happens
to save the project.Problems occurred when invoking code from plug-in: org.eclipse.core.resouces
eclipse.buildId=M20100211-1343
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=pt_BR
Command-line arguments: -os linux -ws gtk -arch x86
Error
Wed Oct 20 08:19:22 BRST 2010
Build state machine has not been initialized.
It occurs when building the project and after the error happens once, it always happens
to save the project. -
What is the status of time machine not working with yosemite?
I upgraded mu mac pro to yosemite and since have found time machine does not work.
Also, my old backup via a clikfree wireless backup does not work any longer.
Is anyone working on this issue?
Is there anyway I can backup my information today and until time machine &
yosemite get fixed?These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
Launch the Console application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad and start typing the name.
The title of the Console window should be All Messages. If it isn't, select
SYSTEM LOG QUERIES ▹ All Messages
from the log list on the left. If you don't see that list, select
View ▹ Show Log List
from the menu bar at the top of the screen.
In the top right corner of the Console window, there's a search box labeled Filter. Initially the words "String Matching" are shown in that box. Enter the word "Starting" (without the quotes.) You should now see log messages with the words "Starting * backup," where * represents any of the words "automatic," "manual," or "standard."
Each message in the log begins with the date and time when it was entered. Note the timestamp of the last "Starting" message that corresponds to the beginning of an an abnormal backup. Now
CLEAR THE WORD "Starting" FROM THE TEXT FIELD
so that all messages are showing, and scroll back in the log to the time you noted. Select the messages timestamped from then until the end of the backup, or the end of the log if that's not clear. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
☞ If all you see are messages that contain the word "Starting," you didn't clear the text field.
☞ The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. Don't post more than is requested.
Please don't indiscriminately dump thousands of lines from the log into this discussion.
Please don't post screenshots of log messages—post the text.
☞ Some private information, such as your name, may appear in the log. Anonymize before posting. -
Hi
My time machine hard drive has stopped working after the latest update and the Disk Utilities says,:
Error: Disk Utility can’t repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-up files."
How can I back up my files before reformatting when I can't even open the drive's folder?
Thanks for the help.I think my time machine is not working correctly and I dont know how to get it back... I really need to get back my photos!!!!!
Exactly this was the way I USED to make restores of files and photos..
but know I CANT!!!!
When I am inside iPhoto y click on the Time Machine icon at the Dock and it goes to this...
at my right side there are the backups but when i click them nothing happens they are like NOT CLICKABLE...
PLEASEE!!! Help me!! -
Customer Workflows Not Working from SRM Inbox
Hi everyone,
We are upgrdaing our EBP v3.5 system to SRM 5.0 (SRM SERVER 5.5 SP 5).
We are using integrated ITS and have many bespoke workflows which need to executeable in the SRM inbox via the integrated ITS and ultimately the portal (EP 7.0).
We have various issues with our bespoke workflows not working. The 2 errors we have found are:
1. When the users click on the workitem from the SRM inbox they sometimes see 'Service Cannot be Reached' error.
2. Other times they see the workitem details with no user decision buttons shown.
3. Other times the user decision buttons are shown but if the user clicks on one, they see a blank page with text "workitem currently locked by user WF_BATCH" at the top. This is an 'advance with dialog' task which works fine via SAPGUI.
Any ideas on any of the specific issues, or anything which we need to do generally to get custom workitems to be executeable via the ITS?
Thanks a lot,
NickHi abhijit,
I checked that but I set it to blank in debug mode..but its still disappearing...the button disappears after pressing enter on error message.
actually the BADI when I implemented there is one method where I set E_ADD_ON_ACTIVE flag to 'X' to bring that button(recommended by SAP). that method is not getting called... -
Time machine is not working under "Applications". I get this message: You can’t open the application “Time Machine” because it may be damaged or incomplete. What do I do?
Time machine under system preferences lets me setup time capsule. But backup fails because "Volume is in use" Help please!It does sound like you have a corrupted install.
The volume in use error is something we see all the time.
Look at C12 here. http://pondini.org/TM/Troubleshooting.html
But I suspect you have more serious issue.
I would run a disk verify on your local OS disk. A5 in the above reference has some info. -
Why is Time machine backup not working after Mavericks upgrade?
Why is Time machine backup not working after Mavericks upgrade?
I had the same problem due to the Fire Wire port. Apple tested it told me it is OK!, I tried a new cable, and have tested both ports on my back up device. I find it strange that as soon as I installed Mavericks. The drive does work using USB. It could be a coincidence, I don't absolutely know at this point, my back up drive ports could stop working, but I doubt it!
Maybe you are looking for
-
Palm Pre will not sync with EAS on Exchange 2010
I looked through the large EAS thread with the error "Unable to validate incoming server settings." Tried all of these issues and none have worked for me. Exchange version is Exchange 2010 running on Server 2008 R2; Tried without domain and it giv
-
Powerpoint on the iPad using Keynote - Not Getting it
This issue may cement my iPad's role as expensive paperweight. I have a number of PowerPoint presentations, many of which contain video. These presentations are for teaching physicians in radiology and are essential. The first part of my problem is
-
Automatic Clearing Rule for Customers
Hi, I have a query regarding Automatic clearing rules for the Customers. I want to clear all the debit balances against all credit balances for each customer (irrespective of the assignment). The exact amounts are not matching though. Can this be con
-
Passing values to APEX_UTIL.JSON_FROM_SQL
What I'm trying to do in my OnDemand application process is something like: declare lv_ename varchar2(10) := 'BLAKE'; begin APEX_UTIL.JSON_FROM_SQL('select empno,ename,job from emp where ename = '||lv_ename||'') end; What I get is: ORA-20001: get_dbm
-
Setting elements 13 as my external photo editor
I have set elements 13 as my external photo editor in preferences , however when i select this the elements editor program does not open. Can anyone help with this please.