NTXHUAB / Cov neeg rau zaub InfoPath cov mov (InfoPath 2007) nco-down daim ntawv teev kev kawm ntawv

Qeb ntxiv: InfoPath

Txoj kev: Ib InfoPath 2007 daim ntawv mus rau ib tug neeg rau zaub mov hauv NTXHUAB deployed muab ib daim ntawv teev nco-down cov neeg muag khoom rau NTXHUAB sau kev cai tied. Thaum koj xaiv ib vendor, kev cai cob teb qhov tseem ceeb rau lub handful ntawm phau ntawv teb xws li muag rep npe, chaw nyob, lub nroog, lub xeev, zauv teb thiab xov tooj. Kev kawm yog phev heev. Peb daim ntawv ceeb toom tias kev kawm ntawv twg thiaj li raug heev tshaj qub (rau ib tus uas tsis yog-linear zam) rau txhua yam kev teb peb hloov li no. Xws li, Yog peb cia li hloov qhov muag rep npe, nws yuav siv sij hawm [x] tus nqi ntawm lub sij hawm. Yog peb hloov rep muag, address1, address2, lub nroog, lub xeev, zauv teb, nws yuav siv sij hawm 10 lub sij hawm ntev dua.

Kua: Sau cov qhov Web site (coj cai nrhiav tau ntawm no) uas yog tau lub cheeb ib vendor thiab nws rov qab tau kom paub meej vendor. Ces, cob teb li no. Txawm tias qhov no ib yam nkaus thiab nkawd qeeb, muaj tug tsis txawv discernable nyob rau hauv cov kev kawm thaum peb raug 1 daim teb no tiv tiag 8 liaj teb. Raws li qhov nws lawm, cov neeg tau txais lub laj "hu cov neeg rau zaub mov" Cylon nyhuv thaum lawv tos rau daim ntawv no ua tau rau tus thiab tsis txhob haus cov xav tau kev pab.

NTXHUAB: Nyiaj tshwm sim. (Nyiaj ntawm HRESULT: 0x 80020009 (DISP_E_EXCEPTION))

HLOOV TSHIAB: Peb tsis txhob txiav hauv paus ua kom muaj qhov teeb meem no thiab nws yeej tsis deg rov.

Peb paub lub sij hawm yuav ua raws li ib txoj kev loj hlob qhov ntawd mam li nco dheev, 2 cov neeg tsis muaj peev xwm nkag tau rau ib qhov chaw sau ntawv. Cov nyiaj yuav authenticate mus rau lub chaw tseem ceeb, tab sis thaum koj sim mus saib tau ib qho chaw sau ntawv, lawv nyuam qhuav tau ib tug dawb paug npo. Tsis muaj cov uas tsis displayed, cia ib tug dawb dawb paug phab.

Peb tau teev rau hauv uas ua ib qhov chaw sau admin thiab sim ntxiv yog ib cov neeg siv cov no yog ib qhov chaw admin thiab lub sij hawm no, Thaum nias "Lawv xav tshuaj", peb tau cov xov no:

Nyiaj tshwm sim. (Nyiaj ntawm HRESULT: 0x 80020009 (DISP_E_EXCEPTION))

Peb siv tej lub sij hawm no researching thiab hmoov tsis, tsis tuaj nrog dab tsi pab tau. Muaj ib co lus nyob rau hauv lub cav diagnostic, tiam sis yog nyuab rau koj raws nraim correlate lawv cov no qhov teeb meem.

Thaum kawg, peb Hmong cov qhov sau los ua qhov chaw thiab re-created nws thiab uas solved.

Yog hais tias kuv paub tseeb seb ho zoo li no yav, Kuv mam li hloov no ncej.

NTXHUAB: Ntsuas los ntawm cov kev cai lub npe thiab xa cov ntaub ntawv uas yuav InfoPath

Lag luam Scenario:

Muab txoj kev enables rau cov neeg siv yuav sau purchase yog requisitions ceev ceev.

Cov teeb meem ua lag ua luam:

Tus neeg twg ua lag ua luam nrog rau ntau pua neeg muag khoom.

Neeg muag khoom yog "hom" meej. Qhov no txhais tau hais tias ib tug vendor sells lub computer khoom (e.g. Dell) los sis khoom siv hauv chaw ua hauj lwm (e.g. Staples).

Peb yuav pab cov neeg siv tag leej twg rhawv purchase requisitions xaiv ib vendor uas koj siv tau li cas?

Kev hais haum ua lag ua luam:

Qha cov neeg muag khoom nyob rau hauv lub cev ntawm "hom".

Pab kom cov neeg siv kom xaiv "hom" ntawm cov khoom thiab muab ib txheej uas tsim nyog cov neeg muag khoom.

Kev tov:

Ib cov ntawv InfoPath twb tau tsim cov neeg enables sau hauv internet muas requisitions.

Ob tug InfoPath xaiv npe tswj vendor xaiv. Ua ntej, tus neeg siv ntawv twg xaiv ib tus "purchase yam". Qhov no txwv thib ob uas sau kom muaj xwb neeg muag khoom muag rau ntawd purchase hom. Qhov no nws yog ib tug classic cascading nco-down.

Neeg muag khoom muab cia rau hauv NTXHUAB kev cai sau kev cai txhua rau vendor pas xws li lub npe nrog rau, qhov chaw nyob thiab tshwj xeeb tshaj yog "yam".

Qhov Web site rau ib tug neeg InfoPath yuav haus cov dej uas siv los ntawm daim ntawv kev cai vendor iterates, rov qab xwb neeg muag khoom txuam ib supplied "yam".

Ua tau rau tus cov qhov Web site ntawm daim InfoPath.

Cov tshooj lus kawm:

  • Ua ntej, nkawd yuav mus no lawv. Kuv yuav muaj tau najnpawb mus ua tus filtering nkaus li cov InfoPath thiab tsis tsim tej Web site rau functionality no. Txawm li cas los, cov neeg rau zaub mov yuav tsis muaj qhov yuav tsum tau filtering muaj rab peev xwm. Peb yuav muab txoj cai rau ib "hom" daim ntawv xaiv nyob rau hauv daim ntawv tsawm tsawv thiab rov qhib rau cov lus nug vendor, tab sis peb tsis tau mus ua hauj lwm kom zoo. Yog li no, yog yuav siv tau cov Web site qhov.
  • Classic "cascading xaiv yuav sau li no" qhov teeb meem nyob rau hauv cov InfoPath tas li neeg rau zaub mov qab ntuj thiab muaj ntau yam zoo qauv muaj sia uas piav seb yuav kom daws tau qhov no li cas.
  • Ib tug nqi rau ib sab nyob rau hauv daim ntawv vendor dawb paug tsis xa ib khoob hlua thaum hais los zoo li no: initItem["Vendor npe"]. Xwb, nws rov ib null.

Ib co sau ntawv:

  • Kuv xa ib array[] cov neeg muag khoom vim kuv tau tej teeb meem uas rov qab ua ArrayList. InfoPath tau complaining txog nws thiab kuv tsis muaj sij hawm los yog tus inclination mus tua dua nws. Qhov no, tau mas, txo nws hwj ib co txwv rau tag nrho cov neeg muag khoom. Nws kuj compelled kuv siv ib trim() qauv rau cov array vim kuv ntxub cov tswv yim uas rov qaum 100 tus uas thov tus neeg muag khoom. InfoPath tsis tu, tab sis nws nagged rau kuv. (Dua, qhov no yooj yim dua ntaus InfoPath nyob ArrayLists).
  • Kuv DVR ib GetSpecificVendorByName() ua kom zoo li, uas tej zaum yuav instructive.

Qhov chaws:

siv Tsim;
siv System.Web;
siv System.Web.Services;
siv System.Web.Services.Protocols;
siv Microsoft.SharePoint;
siv System.Configuration;

/// <txoj kev>
///
Qhov kev pab cuam vendor: Muab vendor ntsig txog cov kev pab uas hnub no yog ntim ntawm ib daim ntawv infopath nyob hauv kev pab.
///
/// Keeb kwm:
/// ——–
/// 07/24/07: Thawj zaug coding, Paul J. Cov Conchango Gavin.
///
/// </txoj kev>
[WebService(Namespace = "http://www.conchango.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
pej xeem hoob VendorService : System.Web.Services.WebService
{

/// <txoj kev>
/// Nruab nrab yog ib vendor ntawm ib daim ntawv kev cai sharepoint ntawm MSUSA.
/// </txoj kev>
pej xeem hoob Vendor
{
pej xeem Vendor() { }

pej xeem Vendor(SPItem initItem)
{
Yog hais tias (! (initItem["Vendor npe"] == null)) VendorName = initItem["Vendor npe"].ToString();
Yog hais tias (! (initItem["Nyob 1"] == null)) VendorAddress1 = initItem["Nyob 1"].ToString();
Yog hais tias (! (initItem["Nyob 2"] == null)) VendorAddress2 = initItem["Nyob 2"].ToString();
Yog hais tias (! (initItem["City"] == null)) VendorCity = initItem["City"].ToString();
Yog hais tias (! (initItem["VendorPhone"] == null)) VendorPhone = initItem["VendorPhone"].ToString();
Yog hais tias (! (initItem["PurchaseType"] == null)) VendorType = initItem["PurchaseType"].ToString();
Yog hais tias (! (initItem["Lub xeev"] == null)) VendorState = initItem["Lub xeev"].ToString();
Yog hais tias (! (initItem["Zip"] == null)) VendorZip = initItem["Zip"].ToString();
Yog hais tias (!(initItem["Fax"] == null)) VendorFax = initItem["Fax"].ToString();
Yog hais tias (!(initItem["SalesRepName"] == null)) VendorSalesRepName = initItem["SalesRepName"].ToString();

VendorItemId = initItem.ID; // Nws tswj tseg ntawm NTXHUAB ID.
}

pej xeem rau cov menyuam VendorItemId;
pej xeem hlua VendorName;
pej xeem hlua VendorAddress1;
pej xeem hlua VendorAddress2;
pej xeem hlua VendorCity;
pej xeem hlua VendorState;
pej xeem hlua VendorZip;
pej xeem hlua VendorPhone;
pej xeem hlua VendorType;
pej xeem hlua VendorSalesRepName;
pej xeem hlua VendorFax;
}

pej xeem VendorService () {

//Cov lus hauv qab no kab yog siv tsim Cheebtsam uncomment
//InitializeComponent();
}

lwm yam Vendor[] GenerateTestVendors()
{
Vendor[] resultList;
resultList = tshiab Vendor[100];

Vendor v;
v = tshiab Vendor();
v.VendorAddress1 = "v1_address1";
v.VendorAddress2 = "v1_address2";
v.VendorCity = "v1_city";
v.VendorName = "v1_vendorname";
v.VendorPhone = "v1_vendorphone";
v.VendorState = "v1_st";
v.VendorType = "v1_type";
v.VendorZip = "v1_zip";

resultList[0] = v;

v = tshiab Vendor();

v.VendorAddress1 = "v2_address1";
v.VendorAddress2 = "v2_address2";
v.VendorCity = "v2_city";
v.VendorName = "v2_vendorname";
v.VendorPhone = "v2_vendorphone";
v.VendorState = "v2_st";
v.VendorType = "v2_type";
v.VendorZip = "v2_zip";

resultList[1] = v;

v = tshiab Vendor();
v.VendorAddress1 = "v3_address1";
v.VendorAddress2 = "v3_address2";
v.VendorCity = "v3_city";
v.VendorName = "v3_vendorname";
v.VendorPhone = "v3_vendorphone";
v.VendorState = "v3_st";
v.VendorType = "v3_type";
v.VendorZip = "v3_zip";

resultList[2] = v;

rov qab los resultList;

}

[WebMethod]
pej xeem Vendor GetSpecificVendorById(rau cov menyuam vendorId)
{
hlua SpVendorSiteName; // Lub npe ntawm lub txoos NTXHUAB kawm uas hosts vendor kev cai daim ntawv.
hlua SpVendorListName; // Lub npe ntawm lub txoos NTXHUAB daim ntawv uas muaj cov neeg muag khoom.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

siv (SPSite kawm ntawv = tshiab SPSite(SpVendorSiteName))
{

siv (SPWeb Web = kawm ntawv. OpenWeb())
{

Splist.Update() currentList = web. Teev[SpVendorListName];

SPItem specificItem = currentList.Items[vendorId];

rov qab los tshiab Vendor(specificItem);

} // siv lub web spweb = site.openweb()
} // siv qhov chaw spsite = spsite tshiab("http://localhost/mizuho")

}

[WebMethod]
// Assumes tias cov vendor npe hu ua nws, ntawm lub lag luam foundations
pej xeem Vendor GetSpecificVendorByVendorName(hlua yuav)
{
hlua SpVendorSiteName; // Lub npe ntawm lub txoos NTXHUAB kawm uas hosts vendor kev cai daim ntawv.
hlua SpVendorListName; // Lub npe ntawm lub txoos NTXHUAB daim ntawv uas muaj cov neeg muag khoom.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

siv (SPSite kawm ntawv = tshiab SPSite(SpVendorSiteName))
{
siv (SPWeb Web = kawm ntawv. OpenWeb())
{

Splist.Update() currentList = web. Teev[SpVendorListName];

foreach (SPItem vendorItem nyob rau hauv currentList.Items)
{
Yog hais tias (vendorItem["Vendor npe"] == null) ntxiv mus;

Yog hais tias (vendorItem["Vendor npe"].ToString().Qhov sib npaug(yuav))
rov qab los tshiab Vendor(vendorItem);
}

Vendor v = tshiab Vendor();
v.VendorPhone = "nrhiav tsis tau: " + yuav;

rov qab los v;

rov qab los null;

} // siv lub web spweb = site.openweb()
} // siv qhov chaw spsite = spsite tshiab("http://localhost/mizuho")

} // txujci

[WebMethod]
pej xeem Vendor[] GetVendorsOfType (hlua filterType)
{

hlua SpVendorSiteName; // Lub npe ntawm lub txoos NTXHUAB kawm uas ib hom tsiaj t
nws vendor kev cai sau.
hlua SpVendorListName; // Lub npe ntawm lub txoos NTXHUAB daim ntawv uas muaj cov neeg muag khoom.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

Vendor[] resultList;
rau cov menyuam vendorIndex = 0;
resultList = tshiab Vendor[1000];

// Initialize daim ntawv nrog vim tus phooj ywg lus.
Vendor v = tshiab Vendor();
v.VendorName = "Xaiv ib yam vendor rau populate daim ntawv.";
resultList[0] = v;

// Hloov lub lim los txo cov ntaub ntawv kom yooj yim txoj hlua sib piv ib tsam.
filterType = filterType.ToLower();

// Yog hom lim kis yog "sim", ua kom muaj tej ntaub ntawv yooj yim.
#thaj av Lim yam = "sim"
Yog hais tias (filterType. qhov sib npaug("sim"))
rov qab los GenerateTestVendors();
#endregion

Yog hais tias (tseeb)
{
siv (SPSite kawm ntawv = tshiab SPSite(SpVendorSiteName))
{
siv (SPWeb Web = kawm ntawv. OpenWeb())
{

v = null;

Splist.Update() currentList = web. Teev[SpVendorListName];

// Iterate txog txhua yam nyob rau hauv daim ntawv vendor.
foreach (SPItem vendorItem nyob rau hauv currentList.Items)
{

hlua lowerVendorType;

lowerVendorType = vendorItem["PurchaseType"].ToString().ToLower();
lowerVendorType = lowerVendorType.Substring(3);

Yog hais tias (lowerVendorType. qhov sib npaug(filterType))
{
resultList[vendorIndex ] = tshiab Vendor(vendorItem);
}
} // ntsuas qhib rau txhua tus neeg muag khoom nyob hauv daim ntawv


rov qab los TrimVendorArray(vendorIndex, resultList);
// rov qab mus resultList;

} // siv lub web spweb = site.openweb()
} // siv qhov chaw spsite = spsite tshiab("http://localhost/mizuho")

} // Yog hais tias muaj tseeb tiag

rov qab los null;
}

lwm yam Vendor[] TrimVendorArray(rau cov menyuam newsize, Vendor[] originalVendorArray)
{
Vendor[] trimmedArray;

Yog hais tias (newsize == 0) newsize = 1;
trimmedArray = tshiab Vendor[newsize];

rau cov menyuam currentCounter = 0;

rau (currentCounter = 0; currentCounter < newsize; currentCounter )
{
trimmedArray[currentCounter] = originalVendorArray[currentCounter];
}

rov qab los trimmedArray;

}
}

NTXHUAB: Tswvyim rau InfoPath debugging

InfoPath daim ntawv neeg rau zaub mov yuam cov Resolution.

Thaum txoj kev loj hlob ntawm ib cov ntawv InfoPath, Kuv yuav tswg kom NTXHUAB neeg rau zaub mov thiab nkag tau rau hauv daim ntawv. Daim ntawv yuav pib mus thauj khoom thiab Meskas Resolution yuam kev lus taw rau kuv rau lub qhov rais event cav kom paub meej. qhov tseeb, tsis muaj xov tau sau ntawv mus rau lub qhov rais event cav. Theej, qhov xov xa rau tus NTXHUAB ascii diagnostic cav. Koj yuav teev uas ntawm central services administration.

Koj yuav tsum tau ceev ntawm koj ko taw. NTXHUAB nyiam sau rau qhov cav, toog thiab verbosely. Qhov no thiaj yuav trimmed tab sis, tus cav sau cwj pwm vim yog "txhua yam kom sai li sai tau".

NTXHUAB: Muab kho dua ib daim ntawv teev kev cai

Muaj ntau ntau yam zoo qauv uas tau muab kho dua kev cai lub npe ntawm tus SDK. Ntawm no yog tseem muaj lwm.

Cov teeb meem ua lag ua luam: InfoPath daim ntawv twb tau tsim cov neeg enables sau hauv internet muas requisitions. PO kev thov xovtooj yuav tsum muaj tsoos sib lawv liag raws integer qhov tseem ceeb thiab payment txiav.

Kev hais haum ua lag ua luam: Tsim kev cai NTXHUAB sau uas muaj txhua ob: "ControlField" thiab "ControlValue". Cov qhia kiag muaj pes tsawg kev thov tom ntej purchase. Nco ntsoov tias cov generic "tswj" naming convention thiab muab tej liaj teb kom yav tom ntej uas yuav siv raws li xav tau.

Kev tov: Tsim rau Web site qhov accessed los rau tus thov kev pab InfoPath. Cov Web site qhov rov qab rau tus tom ntej purchase kev thov tooj thiab siab tus nqi ntawm daim ntawv.

Cov tshooj lus kawm:

  • Thaum ntxiv no cov qhov Web site li ib lub qhov ntaub ntawv daim InfoPath, Kuv pom tias nws yuav hloov mus rau ib udc thiab muab tso rau hauv cov tsev qiv ntawv kev twb kev txuas.
  • Kuv kuj pom tias nws yuav pab kom cov sau khaub lig scripting ntawm central services administration // ntaub ntawv los xyuas dua // daim ntawv neeg rau zaub mov configuration.
  • Thawj zaug hauv daim ntawv sim mus saib hauv web rau, nws yuav siv ib pliag thiab yuam, nws yuav lub sij hawm tawm. Kuv muaj nqis nyob hauv daim ntawv rau neeg rau zaub mov configuration los nthuav lub timeout chaw fiddled thiab uas pab seemed.

Qhov chaws:

siv Tsim;
siv System.Web;
siv System.Web.Services;
siv System.Web.Services.Protocols;
siv Microsoft.SharePoint;
siv System.Configuration;

[WebService(Namespace = "http://www.conchango.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
pej xeem hoob PoService : System.Web.Services.WebService
{
pej xeem PoService () {

//Cov lus hauv qab no kab yog siv tsim Cheebtsam uncomment
//InitializeComponent();
}

/// <txoj kev>
/// Kom coob PO tom ntej sharepoint po tooj tswj daim ntawv.
/// Increment tus PO xov tooj nyob hauv daim ntawv ntawd.
/// </txoj kev>
/// <rov qab los></rov qab los>
[WebMethod]
pej xeem hlua GetNextPoNumber()
{
hlua SpPoControlSiteName; // Lub npe ntawm lub txoos NTXHUAB kawm uas hosts PO kom daim ntawv.
hlua SpPoControlListName; // Lub npe ntawm sij NTXHUAB daim ntawv uas muaj kev tswjhwm Po.

SpPoControlSiteName = ConfigurationSettings.AppSettings["PoControlListHostingSite"].ToString();
SpPoControlListName = ConfigurationSettings.AppSettings["PoControlList"].ToString();

hlua nextPoReqNumber = "xyzzy";

siv (SPSite kawm ntawv = tshiab SPSite(SpPoControlSiteName))
{
siv (SPWeb Web = kawm ntawv. OpenWeb())
{

Splist.Update() currentList = web. Teev[SpPoControlListName];

foreach (SPItem controlItem nyob rau hauv currentList.Items)
{

Yog hais tias (((hlua)controlItem["ControlField"]).Qhov sib npaug("NextPoNumber"))
{
nextPoReqNumber = (hlua)controlItem["ControlValue"];

rau cov menyuam int_nextPoReqNumber;
int_nextPoReqNumber = Hloov ua lwm yam.ToInt32(nextPoReqNumber);

int_nextPoReqNumber ;

controlItem["ControlValue"] = int_nextPoReqNumber;
controlItem.Update();
}

} // Nrhiav, nyeem ntawv thiab muab kho dua tus PO xov tooj nyob hauv daim ntawv.


} // siv lub web spweb = site.openweb()
} // siv qhov chaw spsite = spsite tshiab("http://localhost/mizuho")

rov qab los nextPoReqNumber;

}
}