Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Controller from VB Business rule with parameter

Hi.

I have created a VBA code that returns the values for a controller as in:

https://codeontime.com/learn/data-con...

How can you evaluate any url parameter in VBA code?

www./.../?code=123

In Vba: If code = 3 Then...

Thanks, Peter
1 person has
this question
+1
Reply
  • I am not sure I fully understand the question. Perhaps something like this, its VB.net and not VBA.



    Dim code As String
    code = Request.QueryString("code")


    Also make sure you have the correct name spaces in the Imports statements.

    This should pull the code parameter from the Query string.

    If you are doing it in COT I use a Navigate action and place this in the Command Argument.

    You will need to reference the controller, command and field the value is being passed to.



    _blank: YourPageName.aspx?_controller=YourControllerName&code={code}&commandName=Select&_commandArgument=grid1

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Hi John.

    Thanks.

    When i call

    .../pages/vba?Codex=123

    then i get the parameter value only with: instance.Codex

    When i call

    .../appservices/vba?Codex=123

    then i get the parameter only with: HttpContext.Current.Request.QueryString("Codex")

    Thanks, Peter
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • I am not sure if this means you have it working. If you do great.

    If not, I am not sure what the Codex parameter value is supposed to do. So I cannot help with that.

    Here is a sample one my query strings created in a VB rule. It pretty much looks like your .../appservices one.
    https://your website.com/agedis5/reports/?rpt=myreportname

    I read the report name (rpt) parmeter value using Request.QueryString. Then I have to code what to due with the parameter. In my case its open a report. So I have code that opens that specific one.

    One way I have used to help me create query strings is type the full query string in the browser address bar then try it. It helps me to debug and troubleshoot. Its amazing the syntax errors it helps me find. There are probably better ways but its one I often use.

    I hope you have it working.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated