ASPX templates
Version 5.x > ASPX templates > Document Name Settings View modes: 
User avatar
Member
Member
eric.rovtar - 1/28/2011 11:06:23 AM
   
Document Name Settings
Hi!

I have a document type that allows a person to select a campus from my Campuses Custom Table. I load that campuses into the New Document form with a simple SQL query:
SELECT ItemID, Name
FROM general_campuses;


Simple enough. I want it to store the ItemId value just for clarity and not relying on strings.

The issue is, I want the document name to be the Name field from the Query. Now, I can set "Document name source field" to "CampusID" but then it's the ItemId, not Name.

Is there a way to set the Document name to the Name value?

Thanks!

-Eric

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/2/2011 3:00:52 AM
   
RE:Document Name Settings
Hi,

The only way I see right now is in using custom event handler where in the tree node handler you will get the name according to the selected ID and set it as the document name (in OnBeforeSave or overwrite it in OnAfterSave).

Best regards,
Juraj Ondrus