www.softwaretestforum.dk Forum Index www.softwaretestforum.dk
Virtuelle netværks forum for dem som arbejder professionelt med QA og software test
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Låse knapper vedr. designsteps i en testplan

 
Post new topic   Reply to topic    www.softwaretestforum.dk Forum Index -> Quality Center
View previous topic :: View next topic  
Author Message
Thomas Skjødt Thorup



Joined: 08 Jul 2008
Posts: 2

PostPosted: Wed Nov 26, 2008 2:10 pm    Post subject: Låse knapper vedr. designsteps i en testplan Reply with quote

Hej

Jeg vil gerne opnå følgende i QC:
Version: 9.2
Patch lvl: 9.2.0.4862
DB server: SQL Server 2000

Når en testplan har en given status, så skal designsteps være ReadOnly/låst. Jeg har forsøgt forskellige måder bl.a. ved at placere nedenstående script i "Function ActionCanExecute(ActionName)":

If actionname = "act_new_step" or actionname = "act_edit_step" or "act_renumber_step" or "act_delete_step" Then
If Test_Fields.Field("TS_STATUS").Value = "Godkendt" Then
actioncanexecute = false
End if
End if

Der sker dog intet. Er der nogen, der har et bud? Det burde være simpelt, men jeg kan ikke få det til at lykkes.

Thomas
Back to top
View user's profile Send private message
Charlotte Jarshøj



Joined: 22 Nov 2008
Posts: 1
Location: Vest for Holbæk

PostPosted: Sun Nov 30, 2008 8:17 pm    Post subject: Reply with quote

Umiddelbart ser:
Code:
If actionname = "act_new_step" or actionname = "act_edit_step" or "act_renumber_step" or "act_delete_step" Then

Ikke helt syntaktisk korrekt ud
If'en her er måske bedre
Code:
If actionname = "act_new_step" or actionname = "act_edit_step" or actionname = "act_renumber_step" or actionname = "act_delete_step" Then
  If Test_Fields.Field("TS_STATUS").Value = "Godkendt" Then
    actioncanexecute = false
  End if
End if


Ellers prøv at tjekke om den første del virker
Code:
If actionname = "act_new_step" Then
      actioncanexecute = false
End if


Hvis det virker så udvid...
Code:
If actionname = "act_new_step" Then
  If Test_Fields.Field("TS_STATUS").Value = "Godkendt" Then
    actioncanexecute = false
  End if
End if


Så burde du efterhånden få en fornemmelse af hvor det går galt
Back to top
View user's profile Send private message
Thomas Skjødt Thorup



Joined: 08 Jul 2008
Posts: 2

PostPosted: Mon Dec 01, 2008 11:02 am    Post subject: Reply with quote

Hej Charlotte

Tak for dit svar.

Jeg har fundet to løsninger på dette problem:

Løsning 1:

Function ActionCanExecute(ActionName)
'Use ActiveModule and ActiveDialogName to get
'the current context.
On Error Resume Next

' msgbox ActionName

ActionCanExecute = DefaultRes

If ActionName = "act_new_step"_
or ActionName = "act_edit_step" Then
If Test_Fields.Field("TS_STATUS").Value = "Ready" Then

ActionCanExecute = False

else ActionCanExecute = True

End if
End if


On Error GoTo 0
End Function

Løsning 2:

Function ActionCanExecute(ActionName)
'Use ActiveModule and ActiveDialogName to get
'the current context.
On Error Resume Next

' msgbox ActionName


Dim StrReAction
StrReAction = "act_new_step, act_edit_step"

If Instr(StrReAction, ActionName)_
AND Test_Fields.Field("TS_STATUS").Value = "Ready" Then

ActionCanExecute = False

Else ActionCanExecute = DefaultRes


End if


On Error GoTo 0
End Function

Begge virker fint.

Thomas
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.softwaretestforum.dk Forum Index -> Quality Center All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group