Pré-remplir les variables d'identification du questionnaire principal

What would you like to see in CSPro?
Forum rules
New release: CSPro 8.0
Post Reply
winephaon
Posts: 11
Joined: August 16th, 2022, 8:31 am

Pré-remplir les variables d'identification du questionnaire principal

Post by winephaon »

Bonjour comment allez-vous ?? J'ai un menu qui lance mon questionnaire principal. Maintenant comment pré-remplir les variables d'identification avec le menu. J'ai un dictionnaire externe adjoint au Menu. J'ai dans ma fonction utiliser setproperty ("Key", maketext("%v%v", Province, région)); mais ça ne marche pas. Quand je lance les valeurs au niveau des variables d'identification sont vide.

Qu'es ce que j'ai pu oublier ????
Pour que ça ne marche pas.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Pré-remplir les variables d'identification du questionnaire principal

Post by Gregory Martin »

Il est difficile de savoir quel pourrait être le problème sans voir votre application. Utilisez-vous la fonction setProperty sur un objet Pff? Cela devrait être quelque chose comme:
my_pff.setProperty("Key", maketext("%v%v", PROVINCE, REGION));
// ...
my_pff.exec();
Vous pouvez publier votre candidature ici ou l'envoyer à cspro@lists.census.gov, et nous pourrons l'examiner plus en détail.
winephaon
Posts: 11
Joined: August 16th, 2022, 8:31 am

Re: Pré-remplir les variables d'identification du questionnaire principal

Post by winephaon »

Bonjour j'ai envoyé mon travail par mail.
Voici mon mail : dabwil@yahoo.fr
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Pré-remplir les variables d'identification du questionnaire principal

Post by Gregory Martin »

Are you talking about this code:
pfflancerNouveauQuest.setproperty("key", maketext("%v%v%v", REGIONS, PROVINCES, COMMUNES));
If so, you must look at the dictionary for the program that you are launching, as there are more than three IDs (ID, ANNEE_ACADEMIQUE, A7, A8, etc.).

The helps say: https://www.csprousers.org/help/CSPro/r ... entry.html
If only a partial key is provided, then only the values specified are prefilled. (For example, if the IDs are cluster and household number and the key only specifies the cluster, then the cluster will be automatically filled but the interviewer will have to specify the household number.)
So you will get fields prefilled, but perhaps not in the order that you would like. However, the reason you may not be seeing anything is this:
The StartMode attribute takes precedence over the Key attribute. You generally will use only one, if any, in your design.
Because your PFF file, SCOLARITE.pff, defines StartMode, the Key attribute is not used. Either remove StartMode from your PFF, or, in logic, set it to blank:
pfflancerNouveauQuest.setProperty("StartMode", "");
winephaon
Posts: 11
Joined: August 16th, 2022, 8:31 am

Re: Pré-remplir les variables d'identification du questionnaire principal

Post by winephaon »

Merci. Ça marche
Post Reply