I'm trying to create a RecordActionType to print a record. I'd like to have it work like the 'Edit Values' RecordActionType, where it opens the record in a new window. I'm trying to figure out how this is done. I've downloaded the Contour Shared Source but its not in there.
Does anybody know how to do that? I already created the print page, and it works if I type the url in the address bar, not I just need to add it to the record actions.
publicclassEditRecord : RecordActionType
{
public EditRecord()
{
this.Description = "Opens the record editor to allow to change values after the record has been submitted";
this.Icon = "edit.png";
this.Id = newGuid("461ea480-9334-11df-981c-0800200c9a66");
this.Name = "Edit values";
this.JsAction = "window.open('previewFormDialog.aspx?recordGuid=' + selectedContextGuid);";
}
publicoverride Enums.RecordActionStatus Execute(Record record, Form form)
{
//this will never trigger as JsAction overrides the js that would have triggered itreturn Enums.RecordActionStatus.Completed;
}
}
Print Record
I'm trying to create a RecordActionType to print a record. I'd like to have it work like the 'Edit Values' RecordActionType, where it opens the record in a new window. I'm trying to figure out how this is done. I've downloaded the Contour Shared Source but its not in there.
Does anybody know how to do that? I already created the print page, and it works if I type the url in the address bar, not I just need to add it to the record actions.
Comment author was deleted
Hi Clair,
For an example of record action and record set actions types check out this code: http://contourstrikesagain.codeplex.com
http://contourstrikesagain.codeplex.com/SourceControl/changeset/view/ae0f5c52f0de#ContourStrikesAgain%2fProviders%2fRecordActionTypes%2fMarkRecordAsSpam.cs
Comment author was deleted
Code snippet of the edit record:
Comment author was deleted
Sourcecode for all default providers is available on sourcecode tab of the contour project page:
http://our.umbraco.org/projects/umbraco-pro/contour
The archive umbraco.core.forms.providers.zip
Thanks Tim. this.JsAction is what I needed.
is working on a reply...