DumontEXE 0.0.1
Public Slots | Public Member Functions | Private Attributes
cmcItem Class Reference

Commence Item. More...

#include <cmcItem.h>

Inheritance diagram for cmcItem:

List of all members.

Public Slots

cmcCategoryDefcategoryDef ()
 Return the forms category definition
.
QString categoryName ()
 Return the Category name of this Form
.
cmcItemFieldcfyField ()
 Return the clarifyField
.
QString changeLog ()
 Retrieve the Change Log string from this form
.
QString clarifiedItemName (bool fullPad=false)
 Return a Clarified Item Name
.
cmcItemscon (const QString &connectionName, const QString &targetCategoryName, const QString &reverseConnectionName="")
 get Items collection by name

cmcItemscon (const QString &conCatName)
 Get a Connection by its "FieldName"
.
cmcItemsconnection (const QString &connectionName, const QString &targetCategoryName, const QString &reverseConnectionName="")
 Get a Items Collection by name
.
cmcItemsconnection (const QString &conCatName)
 Get a Connection by its "FieldName"
.
cmcCursorcursor ()
 Item Cursor
.
bool deleteItem ()
 Delete the Item
.
cmcSubFieldextField (QString fieldName)
 Extended Field
.
cmcItemFieldfield (const QString &fieldName)
 Get a Field object by Name
.
cmcItemFieldfield (long index)
 Field by Index
.
cmcItemFieldfld (const QString &fieldName)
 Field Alias
.
cmcItemFieldfld (long index)
 Field by Index
.
cmcRowSetgetChangeLogAddRowSet ()
 Get the Change Log category Definition
.
cmcItemFieldguidField ()
 Return the guid field
.
bool isAdd ()
 Return true/false if this form is in Add Mode
.
bool isConnection (const QString &fieldName)
 Check for Connection Name
.
bool isDelete ()
 Return true/false is the form is in Delete mode
.
bool isDirty ()
 Report if any field or connection on the form is dirty or not
.
bool isField (const QString &fieldName)
 Check for Field Name
.
bool isShared ()
 Return true/false if this item is shared
.
QString itemClarify ()
 Return the Item Clarify text value
.
QString itemGuid ()
 Return the guid of this item
.
QString itemName ()
 Return the Item Name text value
.
QString itemThid ()
 Return the cmcID of this item
.
cmcItemFieldkeyField ()
 Return the keyField
.
bool loadByField (const QString &fieldName, const QString &qualifier, const QString &value, bool notFlag=false, bool caseSensitive=false)
 Load an item by field value
.
bool loadByGuid (const QString &itemGuid)
 Load by Guid
.
bool loadByKey (const QString &itemKey)
 Load an Item by Key value
.
cmcRowSetrowset ()
 Item Edit Row Set
.
bool save ()
 Cause the form to Save
.
long setColumn (const QString &connectionName, const QString &categoryName, const QString &fieldName="")
 Set a Connection
.
void setShared (bool state)
 Set the shared flag on the form
.
cmcItemFieldthidField ()
 return the cmcID field

void undo ()
 Restore a form back to its original state
.
cmcItemFieldvarField ()
 Return the varField
.

Public Member Functions

 cmcItem (const cmcItem &copy)
 Copy Constructor
.
 cmcItem (const QString &categoryName, long flags, cmcApplication *application, QObject *parent=NULL)
 General Constructor
.
 cmcItem (cmcRowSet *rowset, long index, cmcApplication *application, QObject *parent=NULL)
 Construct a commence item linked to a shared rowset
.
void setColumnDefault ()
 Set Default Columns
.

Private Attributes

QPointer< cmcCategoryDefm_categoryDef
 categoryDef pointer cache

QString m_categoryName
 Form.CategoryName cache Value
.

Detailed Description

Commence Item.

This object represents a single item in the Commence database. This object uses symantics similar to the cmcForm object. Fields values are accessed using the well recognized cmcField object, and connections are accessed using the well recognized cmcConnection object. However, what this object is actually doing is accessing the item information using standard cursors and rowsets through the regular Commence API.

While this object uses the cmcCursor API to gain access to the Commence item data, it does not use related columns to get to connection data. Instead, when a connection is requested, this object manufactures a list of cmcItem objects, whereby each object represents an item in the connection field. This makes manipulating multiple items with multiple connections to multiple items a breeze. What should be noted, however is that the cmcItems collection is designed to reflect the well-known interface of the Form.Connection() interface. This means that working with this new wrapper will be familiar.

Manipulating multiple items with multiple connections may be easy with this object, but it is not without penalties. For instance, each cmcItem object opens a cursor on the requested item, and this cursor stays open the whole time the object is in existance. Therefore, resources from the Commence database can be quickly consumed beyond functionality if too many items are opened at the same time. The same is not quite true for connections, however. When requesting a connection on an item a single cursor/rowset is opened for all connected items, and these individual items refer back to this common rowset.

Definition at line 78 of file cmcItem.h.


Constructor & Destructor Documentation

cmcItem ( const cmcItem copy)

Copy Constructor
.

Definition at line 12 of file cmcItem.cpp.

cmcItem ( const QString &  categoryName,
long  flags,
cmcApplication application,
QObject *  parent = NULL 
)

General Constructor
.

Parameters:
categoryNamestring ~ category name
flagslong ~ flags (defaults to zero)
applicationapplication ~ reference
parentobject ~ parent

Definition at line 17 of file cmcItem.cpp.

cmcItem ( cmcRowSet rowset,
long  index,
cmcApplication application,
QObject *  parent = NULL 
)

Construct a commence item linked to a shared rowset
.

Parameters:
rowsetrowset ~ Pointer to originating rowset
indexlong ~ index number into rowset
applicationapplication ~ pointer to originating application
parentobject ~ parent object

Definition at line 66 of file cmcItem.cpp.


Member Function Documentation

cmcCategoryDef * categoryDef ( void  ) [slot]

Return the forms category definition
.

Definition at line 602 of file cmcItem.cpp.

QString categoryName ( void  ) [slot]

Return the Category name of this Form
.

Return the category name that this form is associated with.

vbScript Example:
   dim cursor: set cursor = dfrm.DB.getCursor( 0, dfrm.categoryName, 0 )

Definition at line 773 of file cmcItem.cpp.

cmcItemField * cfyField ( ) [slot]

Return the clarifyField
.

vbScript Example
 Sub DoSomething()
   dim oCfy: set oCfy = dfrm.cfyField
   oCfy.Value = "this is a test"      ' set the clarify field to "this is a test"
 End Sub

Definition at line 730 of file cmcItem.cpp.

QString changeLog ( ) [slot]

Retrieve the Change Log string from this form
.

vbScript Example:
See also:
Change Log Engine

Definition at line 472 of file cmcItem.cpp.

QString clarifiedItemName ( bool  fullPad = false) [slot]

Return a Clarified Item Name
.

If this category uses clarified field values, then this function will return a properly formatted clarified item name. If this category does not employ a clarify field, then just the key field value is returned.

When providing a Clarified Item Name value, you must pad the 'Name' field with spaces to equal 50 spaces, then append the clarify separator, and finally append the clarify field value. This function takes care of all that automatically.

See also:
Clarified Item Names
Returns:
Clarified item name formatted string .or. just the item name if the category does not employ clarified item names.
Parameters:
fullPadbool ~ Full Pad Request, defaults to false. A Full Pad means that if the key/clarify combination is shorter than 50 characters + seperator + 40 characters, then additional spaces will be added to the field. It is not clear at this time if this extra pad space is necessary, but it is being implemented here just in case.

Definition at line 755 of file cmcItem.cpp.

cmcItems * con ( const QString &  connectionName,
const QString &  targetCategoryName,
const QString &  reverseConnectionName = "" 
) [slot]

get Items collection by name

Definition at line 503 of file cmcItem.cpp.

cmcItems * con ( const QString &  conCatName) [slot]

Get a Connection by its "FieldName"
.

This is an alias function for obtaining a regular Connection field. It is intended to make the code a little more readable.

vbScript Example
 Sub Form_OnEnterField(ByRef FieldName)
   dim oxEmployee: set oxEmployee = dfrm.con("pRD Employee")
 End Sub

Definition at line 492 of file cmcItem.cpp.

cmcItems * connection ( const QString &  connectionName,
const QString &  targetCategoryName,
const QString &  reverseConnectionName = "" 
) [slot]

Get a Items Collection by name
.

This function returns an cmcItems collection by name. This function is designed to act just like the Form.Connection function except it returns an object that manipulates connection-related items through the cursor/rowset. It makes manipulating connection items a breeze.

vbScript Example ~ manipulating connection items
 Sub FormatReport( PrimaryItemName )

   dim retVal: 
   retVal = "Generated Report" & vbCrLf & _
            "----------------"

   dim primaryItem
   set primaryItem = dapp.db.getItem( "Calendar", PrimaryItemName )

   dim attendees
   set attendees = primaryItem.connection( "Attendees", "Contacts", "Attends" )

   dim i: for i = 0 to attendees.count - 1

     dim attendee
     set attendee = attendees.item(i)

     '
     ' List some basic contact info
     '
     retVal = retVal & vbCrLf & _
       "Attendee: " & attendee.field("Full Name").value & vbCrLf & _
       "Position: " & attendee.field("Position").value  & vbCrLf & _
       "Phone:    " & attendee.field("Primary Phone").value

     '
     ' Get some employer info
     '
     dim employer
     set employer = attendee.connection( "Employed by", "Company", "Employs" )
     if( employer.count > 0 ) then
       retVal = retVal & vbCrLf & _
         "Employer: " & employer.item(0).field("Company Name").value & vbCrLf & _
         "Website:  " & employer.item(0).field("Website").value
     end if

     '
     ' Get other projects this attendee is working on
     '
     dim projects
     set projects = attendee.connection( "Working on", "Projects", "Working" )
     dim j: for j = 0 to projects.count - 1
       retVal = retVal & vbCrLf & _
         "Project Name: " & projects.item(j).field("Project Name").value & vbCrLf & _
         "Due Date:     " & projects.item(j).field("Due Date").value     & vbCrLf & _
         "Target Value: " & projects.item(j).field("Target Value").value
     next

   next

 End Sub ' FormatReport()

Definition at line 514 of file cmcItem.cpp.

cmcItems * connection ( const QString &  conCatName) [slot]

Get a Connection by its "FieldName"
.

This is an overloaded function to return a cmcConnection when all we have is the "FieldName" as it is provided by the vbScript Form_onEnterField(FieldName) function call. Normally when dealing with Form Events, all that is provided is a FieldName value which can represent a connection field or a standard text field. The application (code) has to try to determine which one it is. Dumont has the built-in services to make this an easy task. It is possible to pass that simple FieldName value to the connection method and receive a cmcConnection connection object.

What this function also makes available is the ability to set field and connection names using the vbScript 'Const' keyword. Both field names and connection names can be declared this way and then used to reference the connection by name. This can have the advantage of really cleaning up a bunch of code redundancies.

vbScript Example:
 '
 ' These declarations were formerly not possible because the .connection.
 '  object required two parameters.
 '
 Const FN_KEY      = "contactsKey"
 Const FN_CFY      = "contactsCfy"
 Const FN_FIRST    = "First Name"
 Const FN_LAST     = "Last Name"
 Const FN_PHONE    = "Main Phone"
 Const CN_EMPLOYER = "Employed by Company"
 Const FN_EMPLKEY  = "companyKey"
 Const FN_BUSPHONE = "Business Phone"

 Sub Form_OnEnterField(ByRef FieldName)
   '
   ' Do the Dumont OnEnterField stuff
   '
   dfrm.onEnterField FieldName

   '
   ' If this is a connection object then deal with it
   '
   if( dfrm.isConnection(FieldName) ) then
     dim conn: set conn = dfrm.connection(FieldName)
     msgbox "You have " & conn.ConnectedItemCount & " connected items"

     '
     ' Use the Const values to access the controls
     '
     dfrm.field(FN_KEY).value = _
       dfrm.field(FN_LAST)   & ", "   & _
       dfrm.field(FN_FIRST)  & " of " & _
       dfrm.connection(CN_EMPLOYER).fieldValue(FN_EMPLKEY) ' note: connection referred by NAME

     dfrm.field(FN_PHONE).value = _
       dfrm.connection(CN_EMPLOYER).fieldValue(FN_BUSPHONE) ' note: connection referred by NAME

   end if
 End Sub
See also:
ConnectionDefs, Connection, isConnection, isField

Definition at line 497 of file cmcItem.cpp.

cmcCursor * cursor ( ) [slot]

Item Cursor
.

Definition at line 87 of file cmcItem.cpp.

bool deleteItem ( ) [slot]

Delete the Item
.

This function executes a specially tailored delete type of method on this item. This is not just a regular item delete like what you get when you hit ctrl-D on a form or a view. This deletion function is designed to provide tracability and recoverability (as in 'undelete') on deleted items.

In order for this method to work properly several things have to be available to Dumont. First, the item has to have a varField where deletion info can be stored. The type of info that gets stored there is as follows:

 deletedOn=20071114074022           ' date and time of the deletion
 deletedBy=MWP:80011002:00223233    ' who requested the deletion

When an item is stamped in this fashion it can be easily filtered from various views by adding a "varField Does Not Contain deletedOn" type of filter. This gives the operator the illusion that the item has actually been deleted from his computer. The downside of this implementation is that it requires an extra filter be added to all your views and connections in order for them to appear proper to the user. Also, this requires that the user has write permissions on this particular item.

But, even if the user does not have write permissions over this particular item, in parallel with stamping the item with deletion info, a changeLog item is also generated for the deletion request. Note, I say request because once the server gets a hold of it, the server may decide this item shouldn't be deleted afterall - that implementation is left up to the system integrator (that's the *you* part of this relationship).

If the user does not have write permissions on the item, then no deletion stamping will be performed on it, and the item will remain in his views. However, a changeLog item will still be created and saved, and when the server picks up the changeLog deletion request and decides to delete the item anyway then eventually when the user syncs with the workgroup the item will disappear. This actually allows users to delete items they don't have write permissions on, and there is a trace-log of the deletion! Nice, eh?

Here is an actual example of a change log that was generated on an item deletion request.

example changeLog item:
 <!DOCTYPE changeLog>
 <changeLog version="3.8.98.3" formName="Docket General" action="Delete" categoryName="Calendar" >
    <itemName>Petryk.M/lit2</itemName>
    <logOn>20071114112236</logOn>
    <logBy>MWP:7:80006401:000026F7</logBy>
    <cmcID>nothing</cmcID>
    <guid>{55028c01-4b13-4718-9681-c8b832d55360}</guid>
    <field name="calendarVar" >
       <from>cmcID=nothing&#xd;
 guid={55028c01-4b13-4718-9681-c8b832d55360}&#xd;
 createdOn=20071114112228&#xd;
 createdBy=MWP:7:80006401:000026F7&#xd;
 changedOn=20071114112228&#xd;
 changedBy=MWP:7:80006401:000026F7&#xd;
 dragFrom=20071118080000&#xd;
 mdd=0001200711180020110000</from>
       <to>cmcID=nothing&#xd;
 guid={55028c01-4b13-4718-9681-c8b832d55360}&#xd;
 createdOn=20071114112228&#xd;
 createdBy=MWP:7:80006401:000026F7&#xd;
 changedOn=20071114112228&#xd;
 changedBy=MWP:7:80006401:000026F7&#xd;
 dragFrom=20071118080000&#xd;
 mdd=0001200711180020110000&#xd;
 deletedOn=20071114112236&#xd;
 deletedBy=MWP:7:80006401:000026F7</to>
    </field>
 </changeLog>

There is enough information in this change log item to be able to locate the originating source item and user that made the request for deletion.

None-the-less, varField or not, this function is designed to tag the item appropriately so that it may be deleted responsibly, by the server, or some other authorized administrator. And, if you set the server up properly then you can archive your items off in some sort of a historical storage for later retrieval if the users desire.

The second thing that is required for this 'service' to function properly is the guid() method within Dumont. This method must be functioning properly so that a unique guid for this item can be generated and made available to the rest of the system. Yes, I know its possible to build a system that does not require guid's, and you should be able to use this item deletion feature without them, but, frankly, the pitfalls of implementing such a system are great. For instance, say your category does not allow duplicates, but certainly allows changes. Now, someone wants an item deleted, and you are using the 'Name' field to track the item (since it's unique, right?). You delete the item, a log is created on the 'Name' field, and you're done. Meanwhile, on or about the same time, someone else changes the 'Name' value of this item. Their 'sync' packet makes it to the server first so it goes ahead and changes the item name. Then your packet comes in and requests the item be deleted, but it does it by 'Name' value, right? See the problem? The server can't delete the item or archive it or anything because it can't find it because the name has changed! Bottom line? Use the guid() feature of the Dumont project. It's easy and it will make your life happy, and you'll be rewarded with a new house and a nice car a wonderful spouse and a dog that actually listens to you. I have all these things and it's because I started using guid's on all my Commence items... really, really!

Keep in mind that all that is happening here is the item is being *tagged* for deletion. The actual item deletion occurs on the server where the entire process can be controlled.

Definition at line 619 of file cmcItem.cpp.

cmcSubField * extField ( QString  fieldName) [slot]

Extended Field
.

Definition at line 590 of file cmcItem.cpp.

cmcItemField * field ( const QString &  fieldName) [slot]

Get a Field object by Name
.

Note:
This object does *not* fail if an improper field name is provided. Rather, it returns an object that is missing its field-object pointer. The object that gets returned can be tested for validity using the isValid() function call.
vbScript Example ~ Fetching a field by name
 sub FixFieldInfo()
   dim oFName: set oFName = dfrm.field("First Name")
   dim oLName: set oLName = dfrm.field("Last Name")
   dim oBName: set oBName = dfrm.field("Bad Field Name")

   if( oFName is nothing ) then msgbox "First Name is: " & oFName.value else msgbox "Bad Field Name"
   if( oLName is nothing ) then msgbox "Last Name is: "  & oLName.value else msgbox "Bad Field Name"
   if( oBName is nothing ) then msgbox "Bad Name is: "   & oFName.value else msgbox "Bad Field Name"
 end sub
Returns:
Field object from the form collection

Definition at line 540 of file cmcItem.cpp.

cmcItemField * field ( long  index) [slot]

Field by Index
.

Definition at line 580 of file cmcItem.cpp.

cmcItemField * fld ( const QString &  fieldName) [slot]

Field Alias
.

Definition at line 585 of file cmcItem.cpp.

cmcItemField * fld ( long  index) [slot]

Field by Index
.

Definition at line 575 of file cmcItem.cpp.

cmcRowSet * getChangeLogAddRowSet ( ) [slot]

Get the Change Log category Definition
.

This is an internal function that will seek-out the change log category definition and verify it for compatibility. If the category definition looks good then a pointer to it is returned. If it does not look good then a message window is opened with a few details of the problem.

Definition at line 467 of file cmcItem.cpp.

cmcItemField * guidField ( ) [slot]

Return the guid field
.

The guid field is a special field defined in the category that can be used to store a guid of this item. It should be a text(40) field. It can be indexed and/or used as a clarify field to aid in the identification of items by ID. If this field exists in the category definition then the guid will *not* be stored in the varField() if it also exists.

See also:
guid, thidField, varField

Definition at line 720 of file cmcItem.cpp.

bool isAdd ( ) [slot]

Return true/false if this form is in Add Mode
.

This pass-through function returns true/false if the form is in add mode.

vbScript Example:

Definition at line 639 of file cmcItem.cpp.

bool isConnection ( const QString &  fieldName) [slot]

Check for Connection Name
.

This returns TRUE when the FieldName provided is a connection field. This helps to identify an object as a connection when all we have is a field name as provided by the vbScript Form_onEnterField(FieldName) function.

vbScript Example:
 Sub Form_OnEnterField(ByVal FieldName)
   If( dfrm.isField(FieldName) ) then
     msgbox FieldName + " is a field"
   End If
   If( dfrm.isConnection(FieldName) ) then
     msgbox FieldName + " is a Connection"
   End If
 End Sub
See also:
isField

Definition at line 482 of file cmcItem.cpp.

bool isDelete ( ) [slot]

Return true/false is the form is in Delete mode
.

This function returns the delete flag on the form. The delete flag gets set when the deleteItem() function is called.

Definition at line 634 of file cmcItem.cpp.

bool isDirty ( ) [slot]

Report if any field or connection on the form is dirty or not
.

This function loops through all the fields and connections on the form and reports true if any of them have been changed from their original values.

vbScript Example:
 if( dfrm.isDirty ) then
   msgbox "the following changes are: " & dfrm.changeLog
 end if

Definition at line 614 of file cmcItem.cpp.

bool isField ( const QString &  fieldName) [slot]

Check for Field Name
.

This takes a field name as a parameter and returns 'true' if the field name equates to an actual field in the category. If the field name provided is a connection name, or is not listed then this function returns false.

vbScript Example:
 Sub Form_OnEnterField(ByVal FieldName)
   If( dfrm.isField(FieldName) ) then
     msgbox FieldName + " is a field"
   End If
   If( dfrm.isConnection(FieldName) ) then
     msgbox FieldName + " is a Connection"
   End If
 End Sub
See also:
isConnection

Definition at line 477 of file cmcItem.cpp.

bool isShared ( void  ) [slot]

Return true/false if this item is shared
.

This pass-through function returns true/false if the form item is currently shared.

vbScript Example:

Definition at line 629 of file cmcItem.cpp.

QString itemClarify ( ) [slot]

Return the Item Clarify text value
.

See also:
clarifyKey

Definition at line 740 of file cmcItem.cpp.

QString itemGuid ( ) [slot]

Return the guid of this item
.

This function returns the currently assigned guid of this item, or a new guid for this item if one does not exist yet.

In order for this function to work properly, there must be a varField() defined for this category or a special guid field. If there is no varField() then this function returns the string value of "nothing".

If the varField() exists but no guid has been assigned, then this function will create a new guid value and cause it to be automatically stored in the varField(). The advantage of using this guid function over the itemThid() function is that this value can be generated immediately for new items before they are saved to the category, wheras the itemThid() value is only available after the item has been saved. Once a guid is generated for an item, because it is stored in the varField() it will remain static and unique for that particular item for the life of that item.

Alternatively, if you do not want to have the guid stored in a varField() type of field, you can define a field "guid Text(40)" (a 40-character text field called "catNameGuid") in the category and then the guid will be automatically stored there. This can have the advantage of using the guid field as the clarify field and creating an index for it and so on. The disadvantage of using a guid field as a clarify field is the guid field then shows up in the Tools|Global Search results and also shows up in some other places... and that may be undesirable.

Note:
One pecularity with this method of item identification is that it is all hapening 'outside' of the Commence database engine as a post-process. This means these methods are not without their pitfalls. One comes from the menu item "Edit | Copy Item". This menu option causes a new commence item to be created from an existing one, meaning all the contents of the var field are copied as well. This is potentially problemmatic because some of this 'item management' code depends on 'initial values' in this var field and other fields. Extra steps have been taken to insure that the itemThid() and itemGuid() values are unique per item, but care should be taken by the database administrator to insure that things are working as expected. Especially when the var field is used to store other values outside the scope of the DumontDLL.
vbScript Example:
 msgbox dfrm.guid ' shows '{623316da-e9cc-4f42-a9fb-f2938920dcb5}'
See also:
itemThid

Definition at line 644 of file cmcItem.cpp.

QString itemName ( void  ) [slot]

Return the Item Name text value
.

String, name of the current item. May be empty when adding an item and the name field has not yet been entered.

vbScript Example:
   if( dfrm.ItemName = "Accounting Department" ) then
     msgbox "I was told there would be no math!"
   end if

Definition at line 750 of file cmcItem.cpp.

QString itemThid ( ) [slot]

Return the cmcID of this item
.

This function returns the currently assigned itemThid (THID) of this item. Please note that this function ONLY works when this category contains an actual varField field where the THID can be stored .AND. this form is .NOT. in "isAdd == True" mode. Both of those conditions must be true to get at the THID value for this item. If not, then "unknown" is returned instead.

Alternatively, if you do not want to have the THID stored in a varField() type of field, you can define a field "thid Text(20)" (a 20-character text field called "cmcID") in the category and then the THID will be automatically stored there. This can have the advantage of using the cmcID field as the clarify field and creating an index for it and so on. The disadvantage of using a cmcID field as a clarify field is the cmcID field then shows up in the Tools|Global Search results and also shows up in some other places... and that may be undesirable.

One thing to note about the cmcID value is that not only is it not available until a new item has been saved to disk, but the cmcID value is actually not portable across multiple databases. For instance, if an item is moved from one database to another, then even though, technically the cmcID is likely to still be unique, it does not necessarily represent the correct actual cmcID value of that item - simply because it was exported from one database and imported into another. For this reason, and probably others that haven't been completely realized yet, the cmcID valus is of marginal value, and probably should not be relied on in a production database. Instead, the guid() value should be used when trying to uniquely identify items in Commence.

vbScript Example:
 msgbox dfrm.itemThid ' shows '4:80006401:0000365E'
See also:
guid

Definition at line 684 of file cmcItem.cpp.

cmcItemField * keyField ( ) [slot]

Return the keyField
.

Every category has a key field. This is the same as the 'Name' field. This method provides direct access to this name field.

Note:
This FieldName value defaults to 'catnameKey' - see the definition in the source code for clarification.
vbScript Example
 Sub DoSomething()
   dim oKey: set oKey = dfrm.keyField
   oKey.Value = "this is a test"      ' set the name field to "this is a test"
 End Sub

Definition at line 735 of file cmcItem.cpp.

bool loadByField ( const QString &  fieldName,
const QString &  qualifier,
const QString &  value,
bool  notFlag = false,
bool  caseSensitive = false 
) [slot]

Load an item by field value
.

Parameters:
fieldNamestring ~ field name

qualifierstring ~ qualifier

valuestring ~ field value

notFlagbool ~ Not Flag (default to false)

caseSensitivebool ~ Case Sensitivity (defaults to false)

Definition at line 342 of file cmcItem.cpp.

bool loadByGuid ( const QString &  itemGuid) [slot]

Load by Guid
.

Parameters:
itemGuidstring ~ item guid

Definition at line 259 of file cmcItem.cpp.

bool loadByKey ( const QString &  itemKey) [slot]

Load an Item by Key value
.

Definition at line 177 of file cmcItem.cpp.

cmcRowSet * rowset ( ) [slot]

Item Edit Row Set
.

Definition at line 149 of file cmcItem.cpp.

bool save ( ) [slot]

Cause the form to Save
.

This executes the Save operation on the form.

vbScript Example:

Definition at line 414 of file cmcItem.cpp.

long setColumn ( const QString &  connectionName,
const QString &  categoryName,
const QString &  fieldName = "" 
) [slot]

Set a Connection
.

This sets the connection on this item.

Parameters:
connectionNamestring ~ Forward Connection Name
categoryNamestring ~ Target Category Name
fieldNamestring ~ Reverse Connection Name

Definition at line 140 of file cmcItem.cpp.

void setColumnDefault ( )

Set Default Columns
.

This will set default columns on the cursor. This insures that there are a few internal system columns that are always assigned to the item even if the user doesn't do it. This eleviates the user from having to worry about internal columns.

Definition at line 92 of file cmcItem.cpp.

void setShared ( bool  state) [slot]

Set the shared flag on the form
.

This sets and resets the form/item Shared value

vbScript Example
 Sub MakeItemShared()
   dfrm.setShared True
 End Sub

 Sub MakeItemUnshared()
   dfrm.setShared False
 End Sub

Definition at line 624 of file cmcItem.cpp.

cmcItemField * thidField ( ) [slot]

return the cmcID field

The cmcID field is a special field defined in the category that can be used to store the cmcID of this item. It should be a text(20) field. It can be indexed and/or used as a clarify field to aid in the identification of items by ID. If this field exists in the category definition then the cmcID will *not* be stored in the varField() if it also exists.

See also:
cmcID, guidField, varField

Definition at line 715 of file cmcItem.cpp.

void undo ( ) [slot]

Restore a form back to its original state
.

This performs an 'undo' on all Fields and Connections. It loops through each field and each connection and calls their respective undo().

vbScript Example:

Definition at line 610 of file cmcItem.cpp.

cmcItemField * varField ( ) [slot]

Return the varField
.

The varField is a memo field that is designated as part of the 100-field-limit extension project. Typically the var field name is comprised from the category Name plus "Var". For instance, examples include; calendarVar, personVar, projectVar, matterVar... and so on.

vbScript Example
 Sub DoSomething()
   dim oVar: set oVar = dfrm.varField
   oVar.var("cmcID") = "12345"      ' set the cmcID element in var to "12345"
   oVar.var("dateOn") = now
 End Sub

Definition at line 725 of file cmcItem.cpp.


Member Data Documentation

QPointer<cmcCategoryDef> m_categoryDef [private]

categoryDef pointer cache

Definition at line 1018 of file cmcItem.h.

QString m_categoryName [private]

Form.CategoryName cache Value
.

Definition at line 1010 of file cmcItem.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com