Options

Using dataport to import contact profile answers

havhav Member Posts: 299
Hi all,

I have created different Contact records and also setup a Contact Profile Questionnaire in Navision.

The answers to these contact profile questions is available in a text file. The text file contains primary key field values along with other data.

I have created a dataport to import the answers from text file into Contact Profile Answer table. I have not written any code for the dataport triggers. The dataport runs fine and the answers are imported successfully.

When i open the Contact Profile Answer table, i see all profile answers data being imported.

Now i open the Contact Card and select a Contact record whose profile answer has been imported.
The Contact card shows all data except that the Contact Card Subform is displayed empty.
When i click on Contact menu button of the Contact card and select Profiles, the Contact Profile Answers window pops up and here i see all correct answers being set.

Can anyone figure out why the Contact Card subform is displayed empty even though the answers have been set through dataport?

Any idea?
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)

Answers

  • Options
    havhav Member Posts: 299
    I am awaiting for someone to try out and suggest me what to do.
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • Options
    havhav Member Posts: 299
    I tried little bit as below:-

    Added a new function on "Contact Card Subform" -
    DisplayProfileQuesAns(Contact : Record Contact)ContactProfileAnswer.RESET;
    ContactProfileAnswer.SETRANGE("Contact No.", Contact."No.");
    ContactProfileAnswer.SETRANGE("Profile Questionnaire Code", FORMAT(Contact.Type));
    IF ContactProfileAnswer.FIND('-') THEN
    BEGIN
    //Not sure what to write here
    //Tried with CurrForm variable but doesn't work
    END;

    Called the above fun. from OnAfterCurrRecord() of Contact Card.

    I still do not know why is that when i open the Contact Card, its subform does not display anything even though the Profile answers have been previouly set using dataport.

    Can anyone pls help me out to resolve this critical issue?

    Thanks in advance
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • Options
    TvisTvis Member Posts: 70
    If you look at a questionaire (Profile Questionnaire Setup) there is a field called Priority... If the priority is set to Very Low it wont show in the subform - could that be your problem?
  • Options
    havhav Member Posts: 299
    Yes you are right.

    My input file for the dataport didn't include data for Answer Priority field of Contact Profile Answer and after import, by default this field was set to Very Low (Hidden).

    On looking at the Table filter property of Answer Priority Control of Contact Card Subform, i cam to know that profile answers having Answer Priority = Very Low (Hidden) are being ignored.

    Thus, i modified OnAfterImport() trigger of the dataport and initialized the value of Answer Priority to Normal.

    Having made the above change now i import the data successfully and can see the profile answers displayed on the Contact card.

    P.S : There is no need for separate DisplayProfileQuesAns() fn. as i described in my previous mail.

    Thanks,
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Sign In or Register to comment.