Forums

 
ForumForumMainstream Foru...Mainstream Foru...WorkflowWorkflowSetting custom field to current date via actionSetting custom field to current date via action
Previous Previous
 
Next Next
New Post
 11/12/2009 10:54 PM
 
 Modified By Marc Sizemore  on 11/12/2009 11:57:00 PM
I have the condition properly set because I can get it to send me an alert when it triggers but I am trying to update a custom datetime field in contacts with the current date/time so I can track and trigger off of when the user sets a specific condition.. I can't figure out the proper format to do this.. What do I need to set the value to, I have tried tp_today and getdate() and even tried hardcoding a datetime in multiple formats
New Post
 11/13/2009 2:06 AM
 
 Modified By Support  on 11/13/2009 3:09:13 AM
SplendidCRM does not have the ability to call a function as part of the value set operation.

You can still do this with some custom coding, but you would need to create your own activity or method to assign the date value. One quick solution would be to add a CURRENT_DATE property to the SplendidActivity class so that you can bind to it.

New Post
 11/13/2009 7:09 AM
 

What format is it expecting even if I wanted to hardcode it? is it mm/dd/yyyy hh:mm:ss ??

I am assuming once I add the property I will have to hand edit the xoml to look something like this?

<crm:SplendidSequentialWorkflow x:Name="Workflow1" WORKFLOW_ID="00000000-0000-0000-0000-000000000000" xmlns:crm="clr-namespace:SplendidCRM;Assembly=SplendidCRM" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow">
	<crm:ContactActivity x:Name="Contacts1" WORKFLOW_ID="{ActivityBind Workflow1,Path=WORKFLOW_ID}" AUDIT_ID="{ActivityBind Workflow1,Path=AUDIT_ID}" CURRENT_DATE="{ActivityBind Workflow1,Path=CURRENT_DATE}" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml/workflow">
		<crm:WorkflowLogActivity x:Name="Contacts1_Log" MODULE_TABLE="CONTACTS" WORKFLOW_ID="{ActivityBind Workflow1,Path=WORKFLOW_ID}" />

		<CodeActivity x:Name="Contacts1_LoadByAUDIT_ID" ExecuteCode="{ActivityBind Contacts1,Path=LoadByAUDIT_ID}" />
			<crm:SetValueActivity x:Name="Contacts1_StatusDt1" LVALUE="{ActivityBind Contacts1,Path=StatusDT}" RVALUE=CURRENT_DATE OPERATOR="equals" />

		<CodeActivity x:Name="Contacts1_Save" ExecuteCode="{ActivityBind Contacts1,Path=Save}" />
	</crm:ContactActivity>
</crm:SplendidSequentialWorkflow>
New Post
 11/13/2009 9:53 AM
 
 Modified By Support  on 11/13/2009 10:57:58 AM
If you create the current date field in the SplendidWorkflow class, then you can just refer to it in the RVALUE.  The LVALUE should point to the custom field in the Contacts1 activity.  The SetValueActivity should handle the DateTime data type, or convert it to text if necessary, 
but there is no way to set the text format.
Is StatusDT the correct custom field name?  I was expecting it to end in _C as do all custom fields in SplendidCRM.
<crm:SplendidSequentialWorkflow x:Name="Workflow1" WORKFLOW_ID="00000000-0000-0000-0000-000000000000" xmlns:crm="clr-namespace:SplendidCRM;Assembly=SplendidCRM" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow">
	<crm:ContactActivity x:Name="Contacts1" WORKFLOW_ID="{ActivityBind Workflow1,Path=WORKFLOW_ID}" AUDIT_ID="{ActivityBind Workflow1,Path=AUDIT_ID}" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml/workflow">
		<crm:WorkflowLogActivity x:Name="Contacts1_Log" MODULE_TABLE="CONTACTS" WORKFLOW_ID="{ActivityBind Workflow1,Path=WORKFLOW_ID}" />

		<CodeActivity x:Name="Contacts1_LoadByAUDIT_ID" ExecuteCode="{ActivityBind Contacts1,Path=LoadByAUDIT_ID}" />
			<crm:SetValueActivity x:Name="Contacts1_StatusDt1" LVALUE="{ActivityBind Contacts1,Path=StatusDT}" RVALUE="{ActivityBind Workflow1,Path=CURRENT_DATE}" OPERATOR="equals" />

		<CodeActivity x:Name="Contacts1_Save" ExecuteCode="{ActivityBind Contacts1,Path=Save}" />
	</crm:ContactActivity>
</crm:SplendidSequentialWorkflow>
New Post
 11/17/2009 9:51 AM
 
 Modified By Marc Sizemore  on 11/17/2009 10:59:14 AM
Ok, after talking with Paul, I put the property in SplendidSequentialWorkflow.cs. Just a simple

public DateTime CURRENT_DATE
{
get { return DateTime.Now; }
}

I modified the xoml to be the following (you were right on the custom field name)













I still get a Protection Level 10 and the value doesn't change. In talking with Paul this is a message basically protecting against an endless workflow loop but the field I am changing has no workflow attached... Upgraded to latest Splendid engine to no avail. Any suggestions?
Previous Previous
 
Next Next
ForumForumMainstream Foru...Mainstream Foru...WorkflowWorkflowSetting custom field to current date via actionSetting custom field to current date via action