It is currently 21 April 2025, 18:37 Advanced search

DocID, GUID, and primary keys

Questions and answers on how to best use Instant Developer

Re: DocID, GUID, and primary keys

Postby josevelez » 10 July 2013, 20:02

In further reading the user manual, Chapter 5 specifically, I am realizing how important this topic will be - for me at least. Page 250 of the manual states, "Without the use of the Document Orientation, it would not be possible to use Instant Developer's synchronization framework."

So if I plan to have an application that works on both browsers and mobile devices, which is the reason I am looking to use In.de, then I must be sure that my database is setup correctly to leverage the DO and it's synchronization features.
josevelez
 
Posts: 404
Joined: 7 June 2013, 17:25
Location: Dallas, Texas

Re: DocID, GUID, and primary keys

Postby john w » 10 July 2013, 23:08

After seeing Giuseppe's response your reference to the User Manual pages I glanced through them. It looks like the Docid is created through using a function. NewDocId(). I am probably way - off on that but perhaps you set the field value to that function and that will generate the Docid.

Anyway its a good thread and I will continue following it. It looks like a couple of others on the Alternatives forum are reading and learning as well.
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: DocID, GUID, and primary keys

Postby josevelez » 10 July 2013, 23:21

That is what I am thinking as well, using the NewDocId() function, but I'm still confused on the implementation.

Two questions for In.de folks:

1. Should my new table have a primary key field that is char(20) and then set to use the NewDocId() function?

2. Should I still have a regular primary key field that is integer/auto increment/ set to primary key?

As I understand it, the database needs to be setup already before one can create 'Document' objects. So if the database must already be setup, then I'm guessing there must already exist a primary key - albeit may not be used for the purpose of Document Orientation.

This is still abstract for me and I'm still trying to wrap my head around it

Thanks,

Jose
josevelez
 
Posts: 404
Joined: 7 June 2013, 17:25
Location: Dallas, Texas

Re: DocID, GUID, and primary keys

Postby g.lanzi » 11 July 2013, 13:08

If you plan to use Documents, then use a Charfixed(20) field as a primary key, than immediately use the documents and activate in them the identification service, so that the framework will do all the work for you ;)
Giuseppe Lanzi
Director of Support services
Pro Gamma S.p.A.
User avatar
g.lanzi
Pro Gamma
Pro Gamma
 
Posts: 3503
Joined: 29 September 2010, 10:24
Location: Bologna

Re: DocID, GUID, and primary keys

Postby josevelez » 11 July 2013, 14:22

Giuseppe,

I hope I'm not getting annoying, but could you offer step by step instructions to do this? I've looked through the documentation but I didn't see any. The documentation does of a great job of introducing the concept and some of the functions but I'm still having a hard time getting through the implementation part.

I'm still new to In.de and I'm sure that is part of it as well but this concept, I think, is going to be new for many and abstract to understand.

I think this thread would go a long way in helping us newbies to understand and take advantage of this feature.

Thanks!

Jose
josevelez
 
Posts: 404
Joined: 7 June 2013, 17:25
Location: Dallas, Texas

Re: DocID, GUID, and primary keys

Postby john w » 11 July 2013, 15:21

Jose

I still not confident I have the answers, but I went through the intereactive tutorial on the Document Orientation. If I am understanding what is going on is that what in.de calls document I think of as classes. That was not clear to me before so I hope am getting close. What in.de calls DocId is what is referred to as the ClassId in .Net framework. I dont know if in.de extends this in some way.

What seems to set something to document orientation is how you build it. You can build all your forms and panels using documents(my thought classes). Using the shift + control key in the dragging and dropping seems to create the objects based on classes. If I am close to understanding this even a bit correctly this is very - very cool. It gives you a nice layer of business objects to work with.

Now getting the DocID into the primary key data field is still the question. Given everything I have seen with in.de so far it will be quite simple and I will be again see my problem of making everything too hard.
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: DocID, GUID, and primary keys

Postby g.lanzi » 15 July 2013, 12:23

It's difficult to explain it in short terms, but to try to go straight to the point the basis actions are:
- create a Domain (right click on the Database Library then Add domain menu)
- set the new domain DocID as a character(fixed) of 20
- set "DO_ID" in the concept field on the domain
- save the domain's properties
- create a new Table
- insert a new field in the table and choose DocID in the domain/value list property
- add the other fields to the table
- drag & drop the table on the application with ctrl+shift pressed
- double click on the Document Oriented class just created and activate Doc. Activation in the Services property.
- then save

Now you can use this Document Oriented class in a master query, just as a table.
For more information about the document oriented panel please refer to the 5th chapter of the Instant Developer Users' Guide doc.instantdeveloper.com/eng/inde-users-guide.pdf .
Giuseppe Lanzi
Director of Support services
Pro Gamma S.p.A.
User avatar
g.lanzi
Pro Gamma
Pro Gamma
 
Posts: 3503
Joined: 29 September 2010, 10:24
Location: Bologna

Re: DocID, GUID, and primary keys

Postby josevelez » 16 July 2013, 13:48

Giuseppe,

Thanks for the help. Unfortunately, I just cannot wrap my head around this still. I'm a visual person and I think that a video tutorial would be more helpful for some of us In.de newbies.

Anyway, I've spent the better part of a week trying to figure this out with no luck. I think In.de will not be the right tool for me.

Thanks again!
josevelez
 
Posts: 404
Joined: 7 June 2013, 17:25
Location: Dallas, Texas

Re: DocID, GUID, and primary keys

Postby g.lanzi » 16 July 2013, 15:45

It must me said that document orientation is a bit difficult as starter topic. Feel free to ask freely in this forum, you are aways welcome.
Giuseppe Lanzi
Director of Support services
Pro Gamma S.p.A.
User avatar
g.lanzi
Pro Gamma
Pro Gamma
 
Posts: 3503
Joined: 29 September 2010, 10:24
Location: Bologna

Re: DocID, GUID, and primary keys

Postby josevelez » 16 July 2013, 15:58

document orientation is a bit difficult as starter topic


Giuseppe,

I agree, that is all the reason more why I think In.de should consider offering some free video tutorials on these more advanced features.

Not only will they allow In.de users, and those evaluating In.de as an alternative, to better leverage In.de but a rich ecosystem of active users and free videos showing off the capabilities of In.de will help market your product as well.

I myself have decided to look at alternatives because I'm too afraid of investing time and money into something that does not have this. There are not enough people or threads in this forum to make me comfortable using In.de. The current documentation is great but it just does not go far enough. There really needs to be more activity on this forum and it would be nice to see a youtube channel with videos demonstrating how to use In.de.

I think In.de should consider this, as I think it would help market your product and bolster the existing community.

Jose
josevelez
 
Posts: 404
Joined: 7 June 2013, 17:25
Location: Dallas, Texas

PreviousNext

Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 22 guests

cron