Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • anthony hall 222 posts 536 karma points
    Jun 20, 2013 @ 18:32
    anthony hall
    0

    RecordService_RecordSubmitted hit after workflow

    I have an field called "Address"  I make a few updates to this field on the RecordService_RecordSubmitted event. 

    All good so far and i can view my updates to "Address" when i view the entries

    My issue occurs when i add email workflows. The updates i made on "Address" have not been added during the email workflow. 

    Is there an event i can call that will be hit before the email work flow event. I've tried RecordService_RecordPartiallySubmitted but it didn't appear to work. 

  • anthony hall 222 posts 536 karma points
    Jun 21, 2013 @ 12:18
    anthony hall
    0

    After further investigation it appears my theory that the RecordService_RecordSubmitted is hit after workflow is not valid.  

    I was able to get the updated record using the following code. 

    public static string GenerateHtmlTable(Record record)
            {
    
                var output = new StringBuilder();
                output.Append("<table style=\"background: #eee; width: 100%;\">");
                var fields = record.RecordFields;
    
                foreach (var key in fields)
                {
                    try
                    {
                        RecordField recordField = record.GetRecordField(key.Key);
    
                               if (recordField.Field.FieldType.Name == "13 Line Rule")
                               {
    
                               }
                               else if (recordField.Field.FieldType.Name == "16 Description Heading")
                               {
    
                               }
                               else
                               {
                                    output.Append("<tr style=\"background: white;\"><td style=\"width:40%;\"><strong>" + recordField.Field.Caption + ": </strong></td>");
                                    var values = new StringBuilder();
                                    foreach (var value in recordField.Values)
                                    {
                                        values.Append(value);
                                    }
                                    if (recordField.Field.FieldType.ToString() == "xxx.Forms.Common.FieldTypes.Address")
                                    {
                                        if (!string.IsNullOrEmpty(values.ToString()))
                                        {
                                            values = values.Replace("|", ",");
                                        }
                                    }
                                    output.Append("<td style=\"width: 60%;\">" + values.ToString() + "</td></tr>");
                                }
    
                    }
                    catch (Exception ex)
                    {
    
                    }
    
                }
    
                output.Append("</table>");
                return output.ToString();
    
            }

     

Please Sign in or register to post replies

Write your reply to:

Draft