Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
Topic Title: How do I Get the Current Listbox Value with Perl API?
Topic Summary: getDataObjectByName doesn't work for a listbox attribute?
Created On: 29-Aug-2008 15:21
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Thomas White, on Wednesday, September 3, 2008 2:43 PM

Answer:
Nevermind, I figured it out. And in case any new Perl API people run into this problem you can use:

my $information = $csapi->GetCRData($user, $trigger->get_object_id(), "child_spiral_name");
my $child_spiral= $information->getDataObjectByName("child_spiral_name")->getValue();
print($log "****child_spiral = " . $child_spiral . "\n");

where child_spiral name is the listbox name.

Thanks.
 29-Aug-2008 15:21
User is offline View Users Profile Print this message


Thomas White

Posts: 11
Joined: 25-May-2006

I have this code:

my $report = "ND - SCR and All Children Report";
my $queryString = "problem_number='".$trigger->get_object_id() . "'";
my $data = $csapi->QueryData($user, $report, $queryString, undef, undef, undef);
print($log "Info:\n");
if($data->getDataSize() > 0)
{
#Data is from apiQueryData, getDataObject returns an apiObjectVector
for(my $i=0; $i<$data->getDataSize(); $i++)
{
my $objVec = $data->getDataObject($i);
print($log "problem_number = ".$objVec->getDataObjectByName("problem_number")->getValue()."\n");
print($log "problem_synopsis = ".$objVec->getDataObjectByName("problem_synopsis")->getValue()."\n");
print($log "crstatus = ".$objVec->getDataObjectByName("crstatus")->getValue()."\n");

}
}


And I will be able to see those attributes just fine, but if I try using getDataObjectByName with a listbox attribute, I cannot get that current value. I understand you can use csapi to get all the listbox values, but I want the current listbox value.

Thanks.
Report this to a Moderator Report this to a Moderator
 3-Sep-2008 14:43
User is offline View Users Profile Print this message


Thomas White

Posts: 11
Joined: 25-May-2006

Answer Answer
Nevermind, I figured it out. And in case any new Perl API people run into this problem you can use:

my $information = $csapi->GetCRData($user, $trigger->get_object_id(), "child_spiral_name");
my $child_spiral= $information->getDataObjectByName("child_spiral_name")->getValue();
print($log "****child_spiral = " . $child_spiral . "\n");

where child_spiral name is the listbox name.

Thanks.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 15:34.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.