The name of the custom list for "Detected in Cycle" field in QC - custom-lists

I am tring to extract the possible values available in QC defects section for "Detected in Cycle" field.
I tried doing it for "Defects status", i was able to extract the values Resolved, Open, Assigned....
The code which i tried for extracting status values is as below:
Set cust = QCConnection.customization
Set custlists = cust.Lists
Set custlist = cutslists.List
Set custlist = custlists.List("Bug Status") 'it is listing complete bug status values not specific 'to the project
Set listrootnode = custlist.RootNode
Set listchildren = listrootnode.Children
For Each listname In listchildren
MsgBox (listname.Name) 'Assigned, deferred, cancel...... all are displayed
Next
But here i need to replace Bug_status with something related to Detected in cycle field. So i need help in finding out this name of custom list....

i was able to get list of cycles avaiable in QC project. Here is the code:
Set cycles = UserForm9.QCConnection.CycleFactory ' here CycleFactory, a method in QC API will help ' you get complete list
So Bug status is a customization list.
And Cycles is not customized list but could be extracted by CycleFacotry method.

Related

Applescript to delete contacts from list

I accidentally added about 600 contacts to my Mac addressbook from a friend's iPhone I synced to my Mac a couple weeks ago. Unfortunately I dont have a backup of my contacts and now they are all synced with my iPhone and iCloud.
I was able to export all the unwanted contacts as ".vcf" files from my friends phone so I have about 600 files like "John Doe.vcf" and also a plain text list of just the contact names.
Ideally I would like a script that matches the data inside the VCF file to make sure I'm deleteing the right contact.
Idea #2 would be to delete the contacts that matches the name in list, skipping the searches that return two or more results (that way I dont lose my own contacts with same name as my friend's)
I started by attempint to delete a single contact using the following applescript but with no luck. Please help!
set daName to "John Doe"
tell application "Contacts"
repeat with onePerson in people
if (value of name of onePerson) is daName then
delete onePerson
end if
end repeat
end tell
--UPDATE--
Here is the final code I used to perform the task. I added a loop at the top that cycles through the list of names copied in the clipboard. I also added the name of the duplicated contact in the dialog box so I could take note of it.
Tips:
Make a backup of all your contacts before running the script.
If you want to see the number of contacts "magically" decreasing
while running the script, scroll down to the of your contacts in
your address book and you'll see the totla amount of contacts
there.
FINAL CODE
set the clipboard to (the clipboard as text)
set the_strings to the clipboard
repeat with this_string in paragraphs of the_strings
set daName to this_string
DeleteContact(daName)
end repeat
on DeleteContact(theName)
tell application "Contacts"
set myList to every person whose name is theName
set Nb to count of myList
if Nb = 0 then return -- no record found
if Nb > 1 then
display dialog theName & " (too many found: do nothing)"
else
set myperson to item 1 of myList -- only 1 found to be deleted
delete myperson
save
end if
end tell
end DeleteContact
The script bellow contains sub-routine which check name and delete. I added some comments to make it easier to adapt for your need :you can build a loop looking for your card and calling the DeleteContact sub-routine.
set daName to "John Doe"
DeleteContact(daName)
on DeleteContact(theName)
tell application "Contacts"
set myList to every person whose name is theName
set Nb to count of myList
if Nb = 0 then return -- no record found
if Nb > 1 then
display dialog "too many found: do nothing"
else
set myperson to item 1 of myList -- only 1 found to be deleted
delete myperson
save
end if
end tell
end DeleteContact
In case same name exist in multiple contact, I display a dialog, but up to you to decide what to do here.
Gio
This is a script I had and it may address your problem although you never said what the problem was.
tell application "Contacts"
local results,dlist,dloop
set results to {}
set dlist to people whose (first name contains "Oxnard" or (last name is equal to "Abercrombe"))
repeat with dloop in dlist
delete dloop
end repeat
set end of results to "Records deleted :" & count of dlist
save
return results
end tell
Note that the Contacts dictionary does define a name property however it will be based on preference settings.

Passing arguments to Access Forms created with 'New'

I have a form called 'detail' which shows a detailed view of a selected record. The record is selected from a different form called 'search'. Because I want to be able to open multiple instances of 'detail', each showing details of a different record, I used the following code:
Public detailCollection As New Collection
Function openDetail(patID As Integer, pName As String)
'Purpose: Open an independent instance of form
Dim frm As Form
Debug.Print "ID: " & patID
'Open a new instance, show it, and set a caption.
Set frm = New Form_detail
frm.Visible = True
frm.Caption = pName
detailCollection.Add Item:=frm, Key:=CStr(frm.Hwnd)
Set frm = Nothing
End Function
PatID is the Primary Key of the record I wish to show in this new instance of 'detail.' The debug print line prints out the correct PatID, so i have it available. How do I pass it to this new instance of the form?
I tried to set the OpenArgs of the new form, but I get an error stating that OpenArgs is read only. After researching, OpenArgs can only be set by DoCmd (which won't work, because then I don't get independent instances of the form). I can find no documentation on the allowable parameters when creating a Form object. Apparently, Microsoft doesn't consider a Constructor to be a Method, at least according to the docs. How should I handle this? (plz don't tell me to set it to an invisible text box or something) Thanks guys, you guys are the best on the net at answering these questions for me. I love you all!
Source Code for the multi-instance form taken from: http://allenbrowne.com/ser-35.html
Inside your Form_detail, create a custom property.
Private mItemId As Long
Property Let ItemID(value as Long)
mItemId = value
' some code to re query Me
End Property
Property Get ItemId() As Long
ItemId = mItemId
End Property
Then, in the code that creates the form, you can do this.
Set frm = New Form_detail
frm.ItemId = patId
frm.Visible = True
frm.Caption = pName
This will allow you to pass an ID to the new form instance, and ensure it gets requeried before making it visible. No need to load all of the results every time if you're always opening the form by Newing it. You let the property load the data instead of the traditional Form_Load event.
This works because Access Form modules are nothing more than glorified classes. Hope this helps.
You could try applying a filter:
frm.Filter = "[ID] = " & patID
frm.FilterOn = True
The Record Source of the Detail form will need to be set to the table to which the ID belongs.
UPDATE
As you requested, here is the code to set the RecordSource:
frm.RecordSource = "select * from TableName where [ID] = " & patID
This is probably cleaner than using a filter given that a user can remove the filter (depending on the type of form).

BIRT report parameter multiple selection value "All"

I have a problem with creating default value of 'All values' for a cascading parameter group last parameter. Actually I don't neccesary need that value to be default, but that would be preferable.
I have tried where I create additional data set with the needed value and additional data set with value All which uses different scripted data source, and another data set with computed column with full outer join, that column uses this code
if(row["userName"]==null ){
row["All"];
}else{
row["userName"];
}
and in the last cascaded parameter JDSuser which I need that All value I have added default value (All users).
In the data set with one value All in open I have script
ii=0;
in fetch
if( ii > 0 ){
return false;
}else{
row["All"] = "(All Users)";
ii++
return true;
}
and in the query data set, in beforeOpen script in if statement I have
if( params["JDSuser"].value!=null && params["JDSuser"].value[0] != "(All Users)" ){
This is used if I haven't selected All users value, and this works, though if I select All Users, it retrieves me no data.
I'm creating from this source example actuate link for example rptdesign download
If someone could give me some help, I would be very grateful.
The way you generate "(All values)" item in your selection list seems to me over complicated but if i understood correctly your case this part is working fine, the problem is not in the definition of the cascading parameter but the way it is used in the main dataset of the report.
Furthermore we have to assume we speak about the same query & beforeOpen script involved in this topic. No data are returned because if we don't do anything special when this item "All values" has been selected, then those filters are still active:
and role.name in ( 'sample grupa' )
and userbase.userName in ( 'sample' )
There are a couple of options to handle this. An elegant one is to declare a dataset parameter linked to your report parameter "JDSuser", and use a clause "OR" such:
and role.name in ( 'sample grupa' )
and (?='(All users)' OR userbase.userName in ( 'sample' ))
Notice this question mark, which represents a dataset parameter in your query. It is not intrusive: the beforeOpen script doesn't have to be changed. You probably need to do something similar with the other filter role.name, but you don't provide any information related to this. One more thing, in order to avoid bad surpises may be you should choose as value something more simple without brackets such "_allitems", and set "(All items)" as label.
Please refer to this topic for more informations about handling optional parameters. See a live example of optional parameters in a cascading group here.

How to add user specified items to OPC data group

I am creating a MATLAB application which connects to an OPC Server and reads the Tag properties. The MATLAB documentation is telling me that I can add a group, add tag items, and then read the value:
grp = addgroup(da, 'ExRead');
itm = additem(grp, 'Tag.Argument');
The problem is that I don't know the tag argument, in my app the user is selecting an available tag in a popupmenu and the value is written to a string, but when I call:
val = get(handles.popupmenu1, 'Value'); // Ask for Value selected item
string_val = get(handles.popupmenu1, 'String'); // Ask for string
stringName = string_val{val}; // Ask for string corresponding to the specified value
set(handles.text1, 'String', stringName); // Display the selected tag
item1 = additem(Group1, stringName); // Add the selected string to a global group "Group1"
read1 = read(Group1, item1); // Read the value
set(handles.text11, 'String', read1); // Display the value
But when I run the code MATLAB generates errors. I guess the problem is item1 = additem(Group1, stringName); In all the MATLAB documentation examples I see something like item1 = additem(Group1, 'adres.adres.1'); This should explain why I am unable to add any data to the Group1.
But how can I add an item to a taggroup which must be specified/selected by a user?
Group1 appears to be a variable here, that is undefined. Perhaps you meant to type 'Group1', with quotes? That would add item to a group called Group1.
If I get it right, you don't know which tag names you should use.
The correct ItemID (Tag name) is typically found by browsing the server address space.
Before you implement browsing in your application (if possible with MATLAB), you can use test clients, such as Prosys OPC Client to browse the address space and find the proper ItemID(s) to use.

Access 2010 Trying to Enter a unique record through Form

I'm trying to input an error check for my form. I have the user entering the name and I would like a prompt to inform them if they are attempting to use a Name already in the records.
Example: the Person table has 3 records with FNames being: Jeff, Kyle, Darren.
If on the add person form in the Fname Box Kyle is entered, the after update event will notify the user that this name has been claimed and null the field. Where as if Greg was enter no notifications will occur.
I just don't know how to compare a text field value to values in a filtered query list, and Google searches have other loosely related links in the way.
Thank you for help!
If all fnames must be unique, add a unique index to the table. This will prevent duplicates being entered. The form error property will allow you to provide a custom error.
You can also check if the name exists in the Before Update event of the control.
In this example, the control and field are both called AText. Generally, you should rename controls so they are not the same as fields.
Private Sub AText_BeforeUpdate(Cancel As Integer)
Dim IsOk As Boolean
''One of the very few places where the .Text property is used
sLookUp = Me.AText.Text
IsOk = IsNull(DLookup("Atext", "Table1", "Atext='" & sLookUp & "'"))
If Not IsOk Then
MsgBox "Found!"
Cancel = True
End If
End Sub