I've run into quite an unusual dilemma. I'm launching the PalmAddressBook
using the 'sysAppLaunchCmdLookup' to do a lookup of all of the address'. As
specified in AppLaunchCmd.h, if you set the 'field2Optional' Boolean to true
it shouldn't require the second lookup field to be populated for it to show,
because "False means that field2 is required in the record for it to be
listed." I am setting this Boolean to true, as shown in the code I've
included below, but address' still will not show in the lookup list if they
do not have the second field. And besides this problem, everything else is
working perfectly. If anyone can show me what I'm doing wrong here, or any
other workarounds it would be appreciated. Thanks...


static void LookupContact()
{
    AddrLookupParamsType AddrL;
    DmSearchStateType searchState;
    UInt16 cardNo;
    LocalID dbID;
    Char *strResult;

    AddrL.title = "Select Contact";
    AddrL.pasteButtonText = "Select";
    AddrL.field1 = addrLookupName;
    AddrL.field2 = addrLookupWork;
    AddrL.field2Optional = true;
    AddrL.userShouldInteract = true;
    AddrL.formatStringP =
"^company|^address|^city|^state|^zipcode|^country|^first
^name|^work|^email|";
    if (!DmGetNextDatabaseByTypeCreator(true, &searchState,
sysFileTApplication, sysFileCAddress, false, &cardNo, &dbID))
        SysAppLaunch(cardNo, dbID, 0, sysAppLaunchCmdLookup,  &AddrL,
&result);
    if (!AddrL.resultStringH) return;
    strResult = MemHandleLock(AddrL.resultStringH);

    /*handle result string code*/

    MemHandleUnlock(AddrL.resultStringH);
    MemHandleFree(AddrL.resultStringH);
}



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to