Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Saving html record crashes editor
We have some html templates stored as a record in an OI table.
We use these for sending nicely formatted emails within outlook. Works well.
If however, we open them in the editor and then try and save them OI crashes.
here's an example
We use these for sending nicely formatted emails within outlook. Works well.
If however, we open them in the editor and then try and save them OI crashes.
here's an example
Comments
Can you post the HTML code or email it to support@srpcs.com? That way we can test it ourselves.
<!DOCTYPE HTML> <html> <head> </head> <body style="overflow-x:hidden;overflow-y:scroll;"> <div style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;font-size: 10pt"> <p>Good afternoon [NAME],</p> <p><br> Please find attached your invoice/s for week ending [WEEK_ENDING]</p> <p> </p> <p>If you have any queries please don't hesitate to contact me.<br><br> Kind Regards,</p> </div> <div style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;font-size: 10pt"> <strong>[MY_NAME]</strong><br><br> [MY_TITLE] <p><img src="http://powerforce.sms-designs.com/email_img/edmen_logo.gif"></p> </div> <div style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;font-size: 8pt"> <p><strong>T: 1300 665 880</strong> F: 1300 665 917<br> E: <a href='mailto:[MY_EMAIL]'>[MY_EMAIL]</a><br> W: <a href='http://www.edmen.com.au'>www.edmen.com.au</a></p> <p style='font-weight:bold;font-style:italic;'>Proudly supporting the National Disability Insurance Scheme <a href='http://www.ndis.org.au'>www.ndis.org.au</a></p> <p style='color:#808080;font-style:italic;'><img src="http://powerforce.sms-designs.com/email_img/fly_carbon_neutral.gif">Edmen Group chooses to fly carbon neutral for all domestic business air travel.</p> <p style='color:#808080;font-style:italic;'>Please consider the environment before printing this e-mail message.<img src="http://powerforce.sms-designs.com/email_img/environment.gif"></p> <p style='color:#000080;font-style:italic;'>CONFIDENTIALITY NOTE: This message is intended for the addressee above mentioned and may contain confidential information.<br> Access to this email by anyone else is unauthorised.<br><br> If you are not the intended recipient, please delete this message and notify the sender as any disclosure, copying, distribution or any<br> action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. Views expressed in this message are those of the individual<br> sender, and are not necessarily the views of the Edmen Group</p> </div></body> </html>
Note that if we just copy/paste from text file, it automatically inserts as a record with many fields.
This saves fine but is not what we need.
The html needs to be in a single field for us to use it (like in the original screenshot) but that is also when the crash happens
How do you normally store this long string in OI? Also, have you tested other editors?
I'm still confused as to how you are getting this inserted into an OI database record in the first place without the field marks. Alternatively, what steps are you going through that causes the crash to occur?
FWIW, @LF or @CR/LF delimited data will convert to @FM by design. May I ask why this causes problems for your application? I mean, I realize @FM won't work, but presumably you pull this data out via code anyway and then pass it along to another process. Why can't you swap the delimiters en route?
It works on the basis that the user can download a template, edit as they wish in some html editor and then 'import' into OI.
That's how it gets inserted.
If we then open the record in the editor and simply do a 'Save As', OI crashes before saving.
Why can't we swap delimiters en route? I don't know offhand. The code exists and works and is deep in the bowels of the app where I am wary to tread. What concerns me is that there must have been a reason for the current approach to be taken and I don't know what that is nor what I might break if I begin to experiment.
Regardless, having OI crash on a 'save' in the editor is a little concerning and I thought it may be something you guys could easily address.
I can replicate the problem, albeit sometimes the Save As actually works. Go figure.
I am convinced the problem is related to the embedded LF characters. If I strip those out and convert the HTML into a true non-delimited string then I have no problems doing a Save As with the content all day long. Perhaps this might be a work around for you...unless the LF characters are also a necessary for your app.
It is also interesting, as you noted, that the OI editor (actually, all of them) won't even try to store LF characters but instead converts them to @FM. Kevin has made a note of your issue for the SRP Editor, but I am not sure (as of yet) if this is easy to address. We'll keep you posted.
If you download SRPUtil.ocx 4.0.2 RC1 and register it, the crash should no longer present itself, as I updated the algorithm to use the same line break characters as the document itself.
Should the line breaks be displaying in routines as well?
Thanks
Did 4.0.2 RC2 have some effect on the display of line numbers?