Core Data and UIPickerView - Default Value - core-data

I am working on an iPhone/iPad App that is using core data. I have a Table (Entity) that wants the user to select from another Table (relationship is setup in the model). I have worked through several tutorials, and it is working very well. Select one of the second table items, save the record. When I re-edit the record the correct value is properly showing. Great (since I am very new to this, I love how some of this works!).
However, if I click to bring up the Picker again - it defaults back to the top of the list, rather than the previously selected second record. All examples I could find have something in the Picker Class on viewDidLoad to set the selected row - to an integer? How would I know what row to select, since this is a table - not an array of fixed values?

Related

Automation steps not found

I am trying to modify the comboBox values of the fields in the Automation Steps page. , but I cannot seem to be able to do it for all of them. Some of them are appearing disabled:
So I tried to make this change in the DB directly. However the graph is not public so I cannot identify the datamember definition.
I did identify however, the following tables:
- AUStepCombo: includes the Values of the combo box. In this case I obtain all the records from the smartpanel
This table, however, does not include the description.
AUCombo: includes the descriptions of the combobox, connected with AUStepCombo via the RowNbr field.
However, I noticed that the AUCombo table doesn't show all the values from the smartpanel. Only a subsection of the values from AUStepCombo. The fields disabled in the smartpanel, are the ones not inclued in this table.
Are these available in another table?
check out CROpportunityProbability table. you will see the StageIDs in there.

How to create a view using a count of certain field

I am trying to create a categorized view of all Notes documents that have a field with exact same value, i.e. there is a field for Contractor Name and I want to create a view that lists each Contractor and the documents that relevant to each. How do I do this? I have tried view formulas like the following but no success as yet
SELECT #IsAvailable(Contractorid) & #Count(Contractorid) > 1
SELECT #Count(#IsAvailable(Contractorid)) >1
Nsf databases are no relational databases. The count of different documents with a unique value in a specific field cannot be used to build a view selection formula.
You could write an agent, that runs through all documents and counts them and puts all with count > 1 in a folder, but this is quite a lot of LotusScript code and needs some advanced knowledge.
The other possibilit would be to categorize the view by ContractorId and add one column before that categorized column: simply use 1 as column formula and select "display totals" in the column properties as well as "hide details".
Then at least you have the information, how much documents are in each category, but unfortunately you cannot filter by it and you cannot sort by this column.
A third possibility would be to use an xpage interface, but that is even more work to do and a completely different story developmentwise.
This is similar to view to identify duplicates. My approach is to use folder.
Make a new folder with design of your view. Instead of (not working) selection formula use short LS code as an action, or QueryOpen event (make sure only one user runs the script).
The code should cooperate with another (hidden) view sorted by Contractorid. Make a ViewNavigator for that view and traverse through it with simple logic - if previous entry has the same Contractorid as the current one, put both documents into folder**. That way you will get list of all documents with duplicate Contractorid. Make sure to wipe all the current content from the folder at the start.
** This can be optimized further by slightly more complicated algorithm to handle first duplicate diferently - for more than two duplicates this algorithm makes extra calls of PutInFolder method.

Multiple values appear as a single entry in the lotus notes view

I have an issue with a lotus notes view. This view displays entries based on the number of problems in the field "All problems". This field is a multivalued field. In the view column properties for the column "problem", the multivalue separator is New line & under the sorting tab, the checkbox against "show multiple values as separate entries" is checked. When i see the view from my machine, multiple values appear as a separate entry. When i checked in another machine, the view was displayed as expected. The problem came, when i tried to do a search for documents based on a value. Now the multiple values come as a single entry which is not supposed to happen. The strange thing is it appears fine in my machine. But when i tried it in another machine, i face the issue. To make sure its not a version problem i checked it in a machine with the same version as mine(8.5.3) also tried in a lower version(7.5) but got the same result. I even tried the following: 1.delete the cache.ndk. 2. remove the DB icon from workspace and reopen the database from applications. 3. go to (Byurl) view in bookmark.nsf and delete all the documents and reopen lotus notes. 4.rebuild views using Ctrl+Shift+F9. Could not do a database rebuild(no access). Does any one know what can be the problem and possible resolutions?
The search is returning a single document, which is correct. It's the representation of the document that is annoying you, you want to have it displayed as it was originally, i.e. with a categorized column. If you are sorting another column in the view, the categorized column gets turned off.
Have a look in Search in View/More/Sort Results by, that might be your problem.

Using a Popup button in Master-Detail

My Document based, Core Data application (using bindings in IB) has two entities, Employee (with an employeeName attribute) and TimeSheet (with timeDescription and entryDate attributes). Employee has a one(employeeDetails)-to-many(employeeTimeSheet) relationship with TimeSheet.
I'm constructing a Master-Detail set up for a TimeSheet entry.
For the Master I've got a one column tableView which has it's value bound to: EmployeeController (an NSArrayController using the Employee entity), arrangedObjects, employeeName.
I have a detailController (another NSArrayController) which is set up as an NSMutableDictionary which has it's contentSet bound to EmployeeController, selection, employeeTimeSheet.
I then have Detail tableView which has three columns, with their respective value bound to DetailController, arrangedObjects, employeeDetails.employeeName(column 0), entryDate(column 1) and timeDescription(column 2).
Now this all works fine, I can select an Employee from the Master Table and the Detail Table shows all the TimeSheet entries associated with that Employee. I can add entries using the selected Employee, everything works great.
My problem is, instead of having a tableView as a Master view, I wanted an NSPopupButton in it's place from which I can select an Employee and view all the time entries associated with that Employee.
I've tried every combination of content, value, arrangedObjects, selectedObject(s) etc. with every combination of the controllers I have but cannot get the NSPopupButton to behave in a similar way to the single column tableView.
I've searched in vain for more information on this and read through the bindings documentation several times but just keep getting mixed up. I feel this should be relatively simple but I just can't seem to get it. I've been racking my brains for almost two days now before posting on here.
Can anybody point out where I'm going wrong? I'd post code but that isn't really appropriate seeing it's mainly an IB thing.
Billy.
By the way: the detailController will populated with a new employee object "automatically". Make sure to set "managedObjectContext" to the same controller (employeeController).
Ok, I found it. I knew that after posting on here I'd find it straight away.
I bound the NSPopupButton content to EmployeeController, arrangedObjects, contentValue to EmployeeController, arrangedObjects, employeeName, and it's selectedIndex to EmployeeController, selectionIndex.
Works great.
Billy.

Filling rows of a repeating table on opening the form

In my Infopath form I use a repeating table. On opening this form on sharepoint I would like to have some rows of the repeating table filled out using information from an other list. I use content types.
What i am working on is a Timesheet system where the user can register how many hours a week he worked on different projects.
I would like that by creation of a timesheet some predefined projects will be already inserted, meaning that the repeating table will have for example 5 rows already with 5 favourite or most used projects selected based on a separate PetProject list.
When I looked at the workflow in the list where the timesheet is being created I couldn’t find the column projectname in the dropdown so I cant give it a value. When I went to look in the Form settings of TimeSheets I saw that projectname cant be selected/edited, its in plain black whereas the other columns are blue and clickable. I thought its probably because the value of projectname is merged from the different rows in the repeating table.
Is there any way I can work around this problem and assign a value to projectname by creation of the timesheet?
Thank you so much!
I think that you will need to write some code to query the data that you are after and add the data to new rows in the repeating table.
There is a loading event that you can hook into to then query a secondary data source and then
add the row to the repeating table.
Will this run with in infopath as a thick client or will it run as a browser based form using infopath form service?

Resources