Hi all,
I was using PcmsQuery Function to get only the latest version of File and to know if the file is approved or not.
The problem that PcmsQuery works well with my account, but not to all users.
In my test, I use the same setting like the same product_name and the same expected_resultat.
From where can be the issue, please.
You find it below the code that I used.
PcmsObjStruct itemObj = { 0 }; int noUids = 0; int* uids = nullptr; int i = 0; itemObj.objType = PCMS_ITEM; itemObj.noAttrs = 2; itemObj.attrs = (PcmsObjAttrStruct*)PcmsEvntCalloc(sizeof(PcmsObjAttrStruct)* itemObj.noAttrs); #define SET_ATTR(_attr,_value,p) \ {\ register int x = p;\ x--;\ itemObj.attrs[x].attr = _attr;\ PcmsSvaSetVal(itemObj.attrs[x].value,_value,0);\ p++;\ } i = 1; SET_ATTR(PCMS_ATTR_PRODUCT_ID, product, i); SET_ATTR(PCMS_ATTR_FILENAME, fileName, i); if (PcmsQuery(connectionID, &itemObj, PCMS_OPT_LATEST, &noUids, &uids) == PCMS_OK && noUids) { for (i = 0; i < noUids; i++) { if (PcmsInitUid(connectionID, uids[i], PCMS_ITEM, &itemObj) != PCMS_OK) continue; if (strcmp(itemObj.status, expectedStatus) == 0) { PcmsObjFree(&itemObj); PcmsEvntFree(uids); return PCMS_OK; } } } PcmsObjFree(&itemObj); PcmsEvntFree(uids); return PCMS_FAIL;