Method Community

 

Dynamic Data

Last post 03-25-2010 11:00 AM by BrianPoole. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 03-16-2010 2:45 PM

    Dynamic Data

    I'm trying to create a custom tab with a list of data from a dynamic XML page. Is this possible?

     

    Thanks,

    Brian

  • 03-16-2010 9:23 PM In reply to

    Re: Dynamic Data

    Hi Brian -

    The Method API allows you to interact with the data in Method (such as retreiving a list of customers, or inserting an invoice).  It isn't used to actually create a user interface.

    To create a user interface in Method, it's done by creating and customizing screens directly in Method itself - no coding, just drag and drop.

    If you are a coder - which I'm guessing you are seeing as you are on the MethodAPI forum and are working with dynamic XML -  you may not like the sound of making a screen using drag and drop.  But when it comes to the UI, this is where I recommend you go, it's what users are used to, and what makes it easy for users to import an app that you make.  There are options available to you, such as creating links on Method pages call on other pages, Method web window objects (which are iframes), or buttons that call external webservices.........but the more you design your UI using Method, the better. 

    If you need heavy complex calculations or processing, I would suggest building as much UI as you can within Method, and then clicking a button that calls an external webservice to do the heavy processing.

    I hope that's a good start.  Let me know if you need clarification.

    Paul

  • 03-18-2010 12:24 PM In reply to

    Re: Dynamic Data

    Thanks Paul,

    I am a coder, and I think that's why I'm found this a little counter-intuitive at first, but all-in-all the more I use this the more I like it. I'm trying to do as much in the UI as I can-- less chance of error.

    I did find the web service call like you mentioned and it seems to be the ticket I was looking for, is there any documentation on this? It seems the actions "stop" when I call this. (I've tried bringing up a generic "hi" message before and after this call, and it only seems to want to come up before.)

  • 03-18-2010 12:32 PM In reply to

    Re: Dynamic Data

    Just a quick note-- I guess adding the "http://" to the beginning of the URL fixed the halting but I'm still getting "There has been an error during the action process."

    I'm doing a simple call to a function that only returns "Hello World!"

  • 03-18-2010 1:40 PM In reply to

    Re: Dynamic Data

    Hi Brian -

    That's not a very descriptive message is it?  It doesn't seem to like something about your webservice.

    We can have a look at it for you.  What is the webservice URL you are using, and the parameter(s) you are passing?

    If it is confidential, feel free to send the info to method (at) methodintegration.com and we'll have a look at it offline - preference would be to solve it here on the forum for the benefit of other coders.

    Paul

     

  • 03-18-2010 2:10 PM In reply to

    Re: Dynamic Data

    Awesome, any help would be appreciated.

    I agree with helping others, so I'll post as much as I can. I have two files I'm playing with here--

    http://www.quickbasenation.com/sandbox/methodaccess.cfc --
    <cfcomponent>
        <cffunction name="QBNTestLogin" access="remote" returntype="string" output="no">
         <cfreturn "Hello World!">
        </cffunction>
    </cfcomponent>

    http://www.quickbasenation.com/sandbox/methodaccess.cfm --
    <cfinvoke component="methodaccess" method="QBNTestLogin" returnvariable="strg">

    </cfinvoke>
    <cfoutput>
     #strg#
    </cfoutput>

     

    As for Method I created a button that calls the "Call Web Service" action.
    "URL" - http://www.quickbasenation.com/sandbox/methodaccess.cfc
    "Function Name" - "QBNTestLogin".
    "Web server returns a response" - Checked
    "Action Result name" - "qbnLogin"

  • 03-18-2010 3:03 PM In reply to

    Re: Dynamic Data

    Brian,

    I'm not a ColdFusion expert, but I think that I should be able to open up the following URLs in a regular browser window:

    http://www.quickbasenation.com/sandbox/methodaccess.cfc?op=QBNTestLogin

    or

    http://www.quickbasenation.com/sandbox/methodaccess.cfc

    But when I do that I'm getting an error on the page. 

    If I go to our .net MethodAPI webserivce in a browser, I get a full page:
    https://www.methodintegration.com/methodapi/service.asmx

    I'm not sure if this is a different between .net or cold fusion - and I can look into this further, but before I do, have you been able to get the Hello World example to work in a non-Method environment yet?  i.e. can you reference that web service from another Cold Fusion page and get back the desired response?

    Cheers,

    Paul

  • 03-18-2010 3:28 PM In reply to

    Re: Dynamic Data

    Again, thank you for helping. I understand where you're confused if you're not familiar with ColdFusion, I just went through the same experience recently.

    The .cfc page can't be accessed directly because we are on a shared server, I think ColdFusion has a built-in WebService browser and accessing the file directly tries to activate it (notice the url redirect), which is denied for security reasons. --I'm almost convinced this is where the problem lies.

    I created the .cfm page to access the webservice and display the results though. I can get Method to display the results of that page back... I'm wondering if I should do a more basic query-style access. Any reliable way to get the data back would be fine with me.

    Before either of us get too far into this, will the returned results be in an array? Or just one string? I want to be able to fill out a grid with the results

  • 03-19-2010 4:59 AM In reply to

    Re: Dynamic Data

    Answer

    "I'm almost convinced this is where the problem lies."
    -I think this has a lot to do with.  I think that before trying to get that webservice to work with Method you need to get it working on a test environment so that you can debug it more easily.  The redirect sounds suspect.

    "Before either of us get too far into this, will the returned results be in an array? Or just one string? "
    -The results would be returned in a Method "action result" - which is a string.  I don't think you'll be able to populate a Method grid with those results very easily.

    Grids display data from database tables - i.e. grids are purely bound objects, there is no unbound mode.

    So.........what you could do is:

    1. Use a Method action "Assign value to Action Result" to collect the Company Account using "Value from Session" variables.
    2. Use a Method action "Assign value to Action Result" to collect the SessionID using "Value from Session" variables.
    3. Use a Method action "Assign value to Action Result" to collect the User Name using "Value from Session" variables.
    4. Use the Method action "Character Function" to build a URL that has the Company Account, SessionID and User Name in the query string.
    5. Call a secure web site or webservice. 
    6. Have the website in turn call the MethodAPI to insert all the records into the target table in Method.  Since you have the Company Account, SessionID and User Name you have the info you need to insert records into Method.
    7. After the call to the website or webservice has has been run, refresh the grid on your screen and it will have all the records you just inserted.

    Paul

     

     

  • 03-25-2010 11:00 AM In reply to

    Re: Dynamic Data

    Thanks Paul!

    Sorry for the delay, I've had a lot on my plate, but I think that might be the exact solution I was looking for. The webservice call directly is a great idea though, it just doesn't sound like it would work for this project. I think I'd feel more comfortable using the MethodAPI (I'm looking forward to digging into it anyhow Big Smile )

    I appreciate your help, I'll let you know how it goes!

Page 1 of 1 (10 items)