Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Setting the GUID of a Document Selector field directly to the database View modes: 
User avatar
Member
Member
stradle - 11/7/2013 9:32:10 AM
   
Setting the GUID of a Document Selector field directly to the database
I have been using the "Document Selector" field type in one of my document types, which has been storing the GUID (database side) and the Path (CMS Form side) of the document selected by a user fine.

I have now written a method elsewhere which updates the GUID directly to the database.

I expected this to reflect within the form, but that is not the case.

Is this possible?

User avatar
Member
Member
stradle - 11/7/2013 12:37:27 PM
   
RE:Setting the GUID of a Document Selector field directly to the database
This is the fields in the database, with the GUID's I have provided

User image

This is the fields in the Form which show no document as being selected

User image

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 11/7/2013 2:56:39 PM
   
RE:Setting the GUID of a Document Selector field directly to the database
It is possible but why don't you use the API to perform your updates vs. directly accessing the database? There could be a number of different problems with your direct database approach where a simple API call would resolve this. For instance, updates in more than one place, validation, cascading deletions, etc.

So even though you can query the database, I'd highly recommend staying away from it unless you know all the objects that will or are going to be updated.