Topic
  • 10 replies
  • Latest Post - ‏2014-06-01T23:57:35Z by DonaldN
Arunodaya
Arunodaya
61 Posts

Pinned topic Submit a record from one dbset to other

‏2014-05-24T13:19:40Z |

Hi,

I have a requirement to log a defect automatically from current dbset to another dbset so what i did is here...

1. apply the GlobalScriptUtility package

2. Created record scripts

3. Add one action and call the record script

Now i can open the submit form from the current session of dbset when my code is like below

set currentSession = GetSession

set entity= currentSession.BuildEntity("Defect")
But when i am modifying above to

set currentSession = CreateObject("ClearQuest.Session")

currentSession.UserLogon "admin", "", "SAMPL", AD_PRIVATE_SESSION, "DBSETNAME"

set entity= currentSession.BuildEntity("Defect")

it faild to open the form because global script is not running and below script is from global script where it is ending with message.

value = session.NameValue( "_CQXE_OPEN_FORM")
 if value = "" then
  GSU_CQXE_SubmitRecord = "The capability to open a form is not supported by the current ClearQuest client."
  Exit Function
 end if

Where I am going wrong or it is not possible to open and submit record from a different dbset?

 

Thanks

Arunodaya.

  • DonaldN
    DonaldN
    287 Posts

    Re: Submit a record from one dbset to other

    ‏2014-05-26T00:33:26Z  

    I don't think you can use GlobalScriptUtility across sessions. The code that you traced to clearly shows as such - the session variable "_CQXE_OPEN_FORM" is set when you call the GlobalScriptUtility for the current session, but the new session knows nothing about it, hence the error message.

    You may get away with the GSU_CQXE_OpenURL function to invoke a REST URI to open a submit form in the other user database. But I doubt that you want to embed the username/password in the URI since the user can see it. In this case, the user will be prompted to log on to the other user database, which may appear confusing. Also the user can ignore the new request to submit a new defect in the other user database, and it may not meet your requirement.

    If you really want something "automatic" and without user interaction, I would suggest you use an external script (Perl or VBScript of your choice), can call this script within a hook during the submission of a defect in the current user database.

  • Arunodaya
    Arunodaya
    61 Posts

    Re: Submit a record from one dbset to other

    ‏2014-05-26T06:01:31Z  
    • DonaldN
    • ‏2014-05-26T00:33:26Z

    I don't think you can use GlobalScriptUtility across sessions. The code that you traced to clearly shows as such - the session variable "_CQXE_OPEN_FORM" is set when you call the GlobalScriptUtility for the current session, but the new session knows nothing about it, hence the error message.

    You may get away with the GSU_CQXE_OpenURL function to invoke a REST URI to open a submit form in the other user database. But I doubt that you want to embed the username/password in the URI since the user can see it. In this case, the user will be prompted to log on to the other user database, which may appear confusing. Also the user can ignore the new request to submit a new defect in the other user database, and it may not meet your requirement.

    If you really want something "automatic" and without user interaction, I would suggest you use an external script (Perl or VBScript of your choice), can call this script within a hook during the submission of a defect in the current user database.

    Hi,

    GSU_CQXE_OpenURL i tried as well but it is not doing exactly what I am looking for. My main requirement is open the defect record of the current session and click the 'Action' to log a reference record to another dbset, here i want to populate some of the fields value to other dbset record as well. And also it is not necessary that each and every defect record of the current session need to log reference record to another dbset (it is only if require then log else not).

    GlobalScriptUtility open form is doing exactly what I am looking for but it is restricted to current session of database.

    I hope this is clear and awaiitng suggestions.

     

    Thanks

    Arunodaya.

  • DonaldN
    DonaldN
    287 Posts

    Re: Submit a record from one dbset to other

    ‏2014-05-26T06:33:37Z  
    • Arunodaya
    • ‏2014-05-26T06:01:31Z

    Hi,

    GSU_CQXE_OpenURL i tried as well but it is not doing exactly what I am looking for. My main requirement is open the defect record of the current session and click the 'Action' to log a reference record to another dbset, here i want to populate some of the fields value to other dbset record as well. And also it is not necessary that each and every defect record of the current session need to log reference record to another dbset (it is only if require then log else not).

    GlobalScriptUtility open form is doing exactly what I am looking for but it is restricted to current session of database.

    I hope this is clear and awaiitng suggestions.

     

    Thanks

    Arunodaya.

    Out of curiosity, how do you reference a defect from a different user database? Using a URL or something else?

  • Arunodaya
    Arunodaya
    61 Posts

    Re: Submit a record from one dbset to other

    ‏2014-05-26T06:42:13Z  
    • DonaldN
    • ‏2014-05-26T06:33:37Z

    Out of curiosity, how do you reference a defect from a different user database? Using a URL or something else?

    Some how in field level...By login to the current user database if i can open the Defect submit form of another dbset then can populate some fields value to that form and do submit. How the current global script works for the current session where you can open a different form and populate the field values from the parent then submit. Same way can we open the form from another dbset instead current dbset?

     

     

  • DonaldN
    DonaldN
    287 Posts

    Re: Submit a record from one dbset to other

    ‏2014-05-26T07:34:18Z  
    • Arunodaya
    • ‏2014-05-26T06:42:13Z

    Some how in field level...By login to the current user database if i can open the Defect submit form of another dbset then can populate some fields value to that form and do submit. How the current global script works for the current session where you can open a different form and populate the field values from the parent then submit. Same way can we open the form from another dbset instead current dbset?

     

     

    You just make things more complicated for yourself. If you don't know how a defect from another user database can be referenced, chances are it cannot be done at all. If so, why bother with creating a defect from another user database? Once you figure out how the reference can be done (if ever), you can then worry about the submission.

  • Arunodaya
    Arunodaya
    61 Posts

    Re: Submit a record from one dbset to other

    ‏2014-05-26T08:04:26Z  
    • DonaldN
    • ‏2014-05-26T07:34:18Z

    You just make things more complicated for yourself. If you don't know how a defect from another user database can be referenced, chances are it cannot be done at all. If so, why bother with creating a defect from another user database? Once you figure out how the reference can be done (if ever), you can then worry about the submission.

    I am not worried about reference between them, simple if I can submit a record to another dbset it is fine for me.

  • Arunodaya
    Arunodaya
    61 Posts

    Re: Submit a record from one dbset to other

    ‏2014-05-27T07:18:36Z  
    • Arunodaya
    • ‏2014-05-26T08:04:26Z

    I am not worried about reference between them, simple if I can submit a record to another dbset it is fine for me.

    Just want to update on my post...this is very much possible to submit a record from one dbset to another but it should be better if form can be open and user can see the input then submit instead commit direct to database.

  • DonaldN
    DonaldN
    287 Posts

    Re: Submit a record from one dbset to other

    ‏2014-05-27T23:52:13Z  
    • Arunodaya
    • ‏2014-05-27T07:18:36Z

    Just want to update on my post...this is very much possible to submit a record from one dbset to another but it should be better if form can be open and user can see the input then submit instead commit direct to database.

    Using a script you can do almost everything at the background. If you want a pop-up form to submit a new defect to another user database, that will pretty much be an RFE.

    https://www.ibm.com/developerworks/rfe/

  • Arunodaya
    Arunodaya
    61 Posts

    Re: Submit a record from one dbset to other

    ‏2014-05-30T11:33:36Z  
    • DonaldN
    • ‏2014-05-27T23:52:13Z

    Using a script you can do almost everything at the background. If you want a pop-up form to submit a new defect to another user database, that will pretty much be an RFE.

    https://www.ibm.com/developerworks/rfe/

    Is it possible to just shown a confirmation message to user before click one action to subit the record?

    My script is now working fine but for better underatanding to the user I want to show one message with OK and Cancel if user click OK then script will run but no idea how can i show that in vbscrip as msgbox won't work in web?

     

  • DonaldN
    DonaldN
    287 Posts

    Re: Submit a record from one dbset to other

    ‏2014-06-01T23:57:35Z  
    • Arunodaya
    • ‏2014-05-30T11:33:36Z

    Is it possible to just shown a confirmation message to user before click one action to subit the record?

    My script is now working fine but for better underatanding to the user I want to show one message with OK and Cancel if user click OK then script will run but no idea how can i show that in vbscrip as msgbox won't work in web?

     

    I'm pretty sure that you are aware of the method of displaying an _error_ message on ClearQuest Web (http://www-01.ibm.com/support/docview.wss?uid=swg21152551). The problem with this method is that it interrupts the process and does not allow the whole process to finish. So unfortunately, I don't think this is a way to do what you want. Unless client side scripting (on web) is implemented in ClearQuest.