SP/InfoPath - Duplicate Values - InfoPath Dev
in

InfoPath Dev

SP/InfoPath - Duplicate Values

Last post 04-25-2014 11:14 AM by Hilary Stoupa. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 04-24-2014 09:27 AM

    SP/InfoPath - Duplicate Values

    Hello, I have been trying to resolve this issue off and on for the past couple of weeks, no one seems to be able to assist me on the internet. Keep in mind I am a business user (process improvement manager). My new employer is getting a little anxious w/me for a solution. I implemented SP here upon hire (a month ago). I have created a custom list and form for their dispatchers to schedule jobs and employees, where they used to use paper and Excel. Currently, the list houses all jobs filtered by date, all the job details, including all the employees assigned to any specific job on any given date (drop downs that point to a secondary data source; employee list). The issue, is that their needs to be some sort of notification to the dispatcher that if they select an employee already scheduled for that date, it will display a message or format text etc (not delete or disallow them to double book). Selecting employee from drop down autopopulates the adjacent text fields. Currently, using rules in Infopath, I have a query and formatting rule: (Query for Data) Run rule when condition is true: Emp 1 is not blank (Format) Run rule when condition is true: Emp 1 (main form) is equal to Emp 1 (Secondary Data Source, the main list) Job Date (main) is equal to Job Date (Secondary data Source, the main list) It works in the sense that if that Emp is found in the list, the name will turn red. That's great. But it runs it against every date. It only needs to do it if that employee is already working on that Job Date selected in the main field. I am just about at the begging and crying phase. I could really, really use some assistance. Stating use Jquery etc, unfortunately likely a solution, is not a solution for me. I am on tight time and under a considerable amount of pressure. Again, I am a business user... any assistance is greatly appreciated. Important to note: I am at the column threshold limit (12).
    Brady Preston - Process Improvement Program Manager
  • 04-24-2014 09:53 AM In reply to

    Re: SP/InfoPath - Duplicate Values

    Hey - looks like you need a little help with some conditional formatting - it would be a lot easier to visualize for me if I could see your form. Do you mind attaching under the Options tab of a reply? I'll take a look sometime today.

    Hilary Stoupa

  • 04-24-2014 09:58 AM In reply to

    Re: SP/InfoPath - Duplicate Values

    You are a god send! Thank you, attaching momentarily
    Brady Preston - Process Improvement Program Manager
  • 04-24-2014 11:11 AM In reply to

    Re: SP/InfoPath - Duplicate Values

    So, I see you attached screenshots, but what I would like to see is the actual form - can you attach that?

    Hilary Stoupa

  • 04-24-2014 11:13 AM In reply to

    Attached :) Are you able to open the form seeing as how it is linked to a corporate sharepoint domain??
    Brady Preston - Process Improvement Program Manager
  • 04-24-2014 03:08 PM In reply to

    Re: SP/InfoPath - Duplicate Values

    I can look at it in design mode, that's what I need to do to see what your question is. :)

    Hilary Stoupa

  • 04-24-2014 03:26 PM In reply to

    Re: SP/InfoPath - Duplicate Values

    Okee doke. I'm a little confused... But let's try this for your conditional formatting on the Emp 1 field.

    You have two conditions on your expression right now.

    Remove one of them.

    Change the first drop down in the remaining condition to "the expression" - you'll see a text box with some XPath. Delete the XPath in the text box.

    Replace it with this:

    xdXDocument:GetDOM("Planning - Job Entry and Archive")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:CrewMem1 = current()/dfs:dataFields/my:SharePointListItem_RW/my:CrewMem1 and d:Date_x0020_of_x0020_Job = current()/dfs:dataFields/my:SharePointListItem_RW/my:Date_x0020_of_x0020_Job]

    This XPath is looking at your Planning - Job Entry and Archive data connection and basically saying "Is there a row there where the CrewMem1 = this CrewMem1 and the Date of Job = this Date of Job.

    Can you try this?

     

    Hilary Stoupa

  • 04-25-2014 04:22 AM In reply to

    Hilary thanks so much! Just getting into the office I'll give it a go soon :) Do you do this voluntarily?! On your free time? I do have a question though, this is going to have to check if Emp 1-6 is in any of the slots of Emp 1-6 - Can I just edit this code to do that? (Testing it now) Edit: It works! You have alleviated a great deal of stress for me, I owe you! Edit:

    I added 4 more expressions, changing the second Crewmem1 in your code to 2,3,4,5, respectively. Doesn't seem to be working. The other road block is that it only allows for 5 rules :S

    Another Edit:

    I spoke too soon :) By changing the crewmem fields in the code it is now working !!! But how do I get a sixth expression in there?

    Brady Preston - Process Improvement Program Manager
  • 04-25-2014 08:46 AM In reply to

    Re: SP/InfoPath - Duplicate Values

    I can't get it to do the same for Emp 6... I edited the code a few different ways, trial and error... What am I missing? Most recent edit:

    xdXDocument:GetDOM("Planning - Job Entry and Archive")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:CrewMem5 = current()/dfs:dataFields/my:SharePointListItem_RW/my:CrewMem1 and d:Date_x0020_of_x0020_Job = current()/dfs:dataFields/my:SharePointListItem_RW/my:Date_x0020_of_x0020_Job] or xdXDocument:GetDOM("Planning - Job Entry and Archive")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:x0045mp6 = current()/dfs:dataFields/my:SharePointListItem_RW/my:CrewMem1 and d:Date_x0020_of_x0020_Job = current()/dfs:dataFields/my:SharePointListItem_RW/my:Date_x0020_of_x0020_Job]

    Can I not use an And an Or in one expression!

    So close!!

    Brady Preston - Process Improvement Program Manager
  • 04-25-2014 08:52 AM In reply to

    Re: SP/InfoPath - Duplicate Values

    It sounds like you are making progress.

    You can use and or or and it looks like you have used or correctly (lower case). Can you try the conditions individually to verify them? One turns it green, one turns it yellow or something?

    Hilary Stoupa

  • 04-25-2014 09:03 AM In reply to

    Re: SP/InfoPath - Duplicate Values

    Something is wrong with the Field 6 check. The field name is '_x0045_mp6' - I didn't name the field this, must be a defaul of sorts? Would this cause an issue?

    I also tried rearranging the formula, so it would be Check field 5 or Check field 6 and Check Date... Doesn't work.

    xdXDocument:GetDOM("Planning - Job Entry and Archive")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:CrewMem7 = current()/dfs:dataFields/my:SharePointListItem_RW/my:CrewMem1 and d:Date_x0020_of_x0020_Job = current()/dfs:dataFields/my:SharePointListItem_RW/my:Date_x0020_of_x0020_Job] or xdXDocument:GetDOM("Planning - Job Entry and Archive")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:x0045mp6 = current()/dfs:dataFields/my:SharePointListItem_RW/my:CrewMem1 and d:Date_x0020_of_x0020_Job = current()/dfs:dataFields/my:SharePointListItem_RW/my:Date_x0020_of_x0020_Job]

    Brady Preston - Process Improvement Program Manager
  • 04-25-2014 09:16 AM In reply to

    Re: SP/InfoPath - Duplicate Values

    I should have been more clear.

     I think you should add a new rule to your field (just for now, to test) and try your conditions individually.

    Don't worry about the weird name. This is the internal name of the field - you picked it using the UI field picker, right?

    Hilary Stoupa

  • 04-25-2014 09:27 AM In reply to

    Re: SP/InfoPath - Duplicate Values

    Ah ok got it :)

    I made a new rule on two fields, crewmem1 and 2 - it still doesn't format. It doesn't like that field for some reason?

    I've tried deleting and recreating the field, making adjustments to the code, trying the rule on different fields... So weird!!

    Brady Preston - Process Improvement Program Manager
  • 04-25-2014 10:45 AM In reply to

    Re: SP/InfoPath - Duplicate Values

    It is most likely just something in the XPath - can you attach your latest form and I'll take a look? It will be a bit later in the day....

    Hilary Stoupa

  • 04-25-2014 10:50 AM In reply to

    Sure thing Hilary, I appreciate it. You don't have to do this, so of course do it when it's convenient for you! I've been at it all day trying different configurations, I really have no clue what to do :( Deadline is monday for this project to be done, yikes!
    Brady Preston - Process Improvement Program Manager
Page 1 of 2 (16 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.