Method Community

 

Trying to generate links

Last post 06-01-2012 1:13 PM by Anonymous. 18 replies.
Page 1 of 2 (19 items) 1 2 Next >
Sort Posts: Previous Next
  • 05-24-2012 10:21 AM

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Trying to generate links

    Hello there folks,

    Ok, I'm new to Method CRM. I am a developer writing a plugin to an existing product. My purpose is to gather information and present it to the user. This was the easy part and it's all good there.

    I also would like a couple of links to the method UI from our application that allow the user to:

    1) Create a new Contact

    2) Create a new Account (Vendor account)

    3) Open a customer in Edit Mode  (given information available via the API like record id, etc)

    I have looked at MethodAPIGetScreenURL version 2,3, and 4. I am sure these would work if I could get the correct parameters and figure out which is the best to use. The documentation is spotty and there aren't any decent examples that I could find.

    I would greatly appreciate any help with this,

    Thanks,

    Jacob

     

  • 05-24-2012 1:31 PM In reply to

    Re: Trying to generate links

     Hi Jacob,

    There are 2 ways to do what you are asking. You can use the create short method url action from within method itself. (You can read up on it at http://www.methodintegration.com/method/kb.aspx?folder=methodcrm&article=Create-Short-Method-URL&id=165)

    The second way is using the API, I will provide examples below. My examples are in C# and assume you have already added the appropriate service references in your code. I also replaced companyaccount, login, and password with XXX, YYY, and ZZZ respectively. You should be able to tweak them to meet your needs

     

    Using MethodAPIGetScreenURLV2

    Let's assume you have a tab called customers, with a tablink called New Customers.

    string ResponseFromAPI = MethodAPI.MethodAPIGetScreenURLV2(XXX, YYY, ZZZ, "", "New Customer", "Customers", "");

    if you look at ResponseFromAPI it is actually an xml string like the following

    <?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "Success" URL = "http://link.methodintegration.com/XXXXX" ></MethodAPI>

    You can then parse the xml grab the url and send it to your users. When the screen loads they will be at the new customer screen

     

    Using MethodAPIGetScreenURLV3

    Continuing the example from above, you have more parameters on the function signature. The two of interest that must be populated in this case are DomainLinkOrMIurl(with the value of 'link' or 'miurl') and isportal(true or false). A parameter you may or may not want to set is RecordID, this will take the user to a specific record when the screen loads. In this case we left it as an empty string

    string ResponseFromAPI = MethodAPI.MethodAPIGetScreenURLV3(XXX, YYY, ZZZ, "", "link", "Customers", "New Customer", "", "", "", false, "");

    if you look at ResponseFromAPI it is actually an xml string like the following

    <?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "Success" URL = "http://link.methodintegration.com/XXXXX" ></MethodAPI>

    You can then parse the xml grab the url and send it to your users. When the screen loads they will be at the new customer screen

     

    Using MethodAPIGetScreenURLV4

    Still continuing our customer example from above let's actually set a customer recordid this time. Let's also assume you have a screen called edit customer

    string ResponseFromAPI =MethodAPI.MethodAPIGetScreenURLV4(XXX, YYY, ZZZ, "", "link", "Customers", "Edit Customer", "68", "", "", false, "", "");

    if you look at ResponseFromAPI it is actually an xml string like the following

    <?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "Success" URL = "http://link.methodintegration.com/XXXXX" ></MethodAPI>

    You can then parse the xml grab the url and send it to your users, and this time when the screen loads it will be prepopulated with customer 68.

    Dave

     

  • 05-24-2012 1:35 PM In reply to

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Re: Trying to generate links

     thanks for the reply. I will try this.

    In my case, this must be pure API, and I am using a new un-cusomtized UI. I have to have it generic so it can be used in any customers system barring some weird stuff they may do.

  • 05-24-2012 1:52 PM In reply to

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Re: Trying to generate links

     Ok. I've tried this with every permutation I can think of.

    I keep getting the same page. It has the Method CRM heading and a blank page with the "waiting/loading" icon in the center.

    I'm not sure if it's due to invalid data or a server issue?

    The response was successful, I took the URL it gave and pasted it into a browser.

     

    Thanks,

    Jacob

  • 05-25-2012 8:20 AM In reply to

    Re: Trying to generate links

     Hi Jacob,

    Does the page load successfully when you login to method normally? Does it show you any form of warning/error message?

    Dave

     

     

  • 05-25-2012 6:22 PM In reply to

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Re: Trying to generate links

    Yes. It works fine if I log in manually. 

    If necessary I can do a web ex or Skype to show the exact situation. 

    This is a c# application. 

    Thanks,

    Jacob

  • 05-30-2012 7:34 AM In reply to

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Re: Trying to generate links

     help?

  • 05-30-2012 8:09 AM In reply to

    Re: Trying to generate links

     Hi Jacob,

    Sorry about the delay been a little swamped...

    Does this happen with every link generated or only some of them? What function are you using to generate the link? Can you also tell me what tab and tablink you are trying to go to?

    Dave

  • 05-30-2012 9:18 AM In reply to

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Re: Trying to generate links

     Dave,

    Yes, this happens to every link I generate. I have tried all three methods of generating a link.

    Here is the code: The commented out sections give the same results.

                    MethodCRMService.ServiceSoapClient client = new MethodCRMService.ServiceSoapClient(binding, endpointAddress);
                    client.MethodAPIGetScreenURLV2Completed += (sender, args) =>
                    {
                        Log(args.Result);
                    };
                    client.MethodAPIGetScreenURLV3Completed += (sender, args) =>
                    {
                        Log(args.Result);
                    };
                    client.MethodAPIGetScreenURLV4Completed += (sender, args) =>
                    {
                        Log(args.Result);
                    };
                    client.MethodAPIGetScreenURLV2Async(credentials.Company, credentials.UserName, credentials.Password, string.Empty,
                        "New Customer", "Customers", string.Empty);
                    //client.MethodAPIGetScreenURLV3Async(credentials.Company, credentials.UserName, credentials.Password, string.Empty,
                    //    "link", "Customers", "Customers and Contacts List", "2", string.Empty, string.Empty, false, string.Empty, "1");
                    //client.MethodAPIGetScreenURLV4Async(credentials.Company, credentials.UserName, credentials.Password, string.Empty,
                    //    "link", "Customers", "Edit Customer", "277", string.Empty, string.Empty, false, string.Empty, string.Empty);
    
    Results:
    <?xml version="1.0" encoding="windows-1252" ?>
    <MethodAPI response="Success" URL="http://link.methodintegration.com/A638z" />

    I am manually taking the URL provided and pasting it into a new IE window. I've also tried Chrome with the same results. The debugging window in IE/Chrome shows no errors.

    If I am already logged in, I am shown the "working" screen as I described before. If not, I am prompted to login then that screen is shown.

     

     

     

  • 05-30-2012 9:25 AM In reply to

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Re: Trying to generate links

    This is the screen I see

    working

  • 05-31-2012 1:46 PM In reply to

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Re: Trying to generate links

     very sorry to keep bugging, but my deadline approaches :)

  • 05-31-2012 5:04 PM In reply to

    Re: Trying to generate links

    Hey Jacob,

    Just an update....I have managed to reproduce the problem and we are investigating a fix.

    Dave

  • 06-01-2012 8:12 AM In reply to

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Re: Trying to generate links

     That is awesome. Thanks very much.

  • 06-01-2012 10:12 AM In reply to

    Re: Trying to generate links

     Hi Jacob,

    Have you ever done a quickbooks sync? If not you should follow the steps in the Method Initial Setup Guide. http://www.methodintegration.com/self-service-documentation.aspx

    After the initial sync this problem should be solved

     

    Dave

  • 06-01-2012 11:51 AM In reply to

    • Jacob
    • Top 500 Contributor
    • Joined on 05-24-2012
    • Posts 14

    Re: Trying to generate links

    dave,

    i have not. this is a default test system and i do not have a QB installation to test with.  while our customers should have this setup, i believe we will not require a QB sync since we are only interested in the crm data.

    forgive me for saying, but this still seems like a defect.

    thanks,

    jacob 

Page 1 of 2 (19 items) 1 2 Next >