Announcement

Collapse
No announcement yet.

Error 2051 when attempting to use Class Library

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error 2051 when attempting to use Class Library

    Hello,

    Following up from the conversation on the Power of Us hub, I'm writing here to try and get a resolution on the 2051 error we've been experiencing. It's caused by the SKU CDATA tag not being closed when using the following code:

    Code:
    CnP_IaaS.Paas_Class.Items i = cnpxmlstring.ItemsList[0];
    i.ItemName = 'Application Fee';
    i.SKU = 'Program Service Fees-Accelerator Lab';
    i.UnitPrice = app.Fee_Paid__c;
    ...
    cnpxmlstring.getItemsString_node(cnpxmlstring);
    ...
    cnpxmlstring.getgeneratexml(cnpxmlstring);
    I have updated the platform and the issue still occurs. Any help is appreciated.

    Thanks.

  • #2
    Good day cande-dev

    Your instance is an old release and you are using a deprecated method. Please grant us login access so we can update your instance.

    Regards,
    Click & Pledge Support Department

    Join us @ the educational webinars: https://clickandpledge.com/webinars/
    Live Support- read more: https://support.clickandpledge.com/s/article/general-information-live-support/

    Comment


    • #3
      I have updated the instance and am now running the following versions:

      Click & Pledge PaaS Class Library 4.4000
      Click & Pledge Payment-as-a-Service 9.7010

      I need to wait to find out if I am able to grant you login access. If you let me know the new method, or point me at some documentation, I can try that out.

      Thanks.

      Comment


      • #4
        Good day cande-dev

        Please see:
        Code:
        CnP_IaaS.PaaS_Class xmlstring = new CnP_IaaS.PaaS_Class();
        CnP_IaaS.PaaS_Class.items item = new CnP_IaaS.PaaS_Class.items();
        list<CnP_IaaS.PaaS_Class.items> itemslist = new list<CnP_IaaS.PaaS_Class.items>();
        item.ItemName = 'Test Item';
        item.SKU = 'Test SKU';
        item.Quantity = 1;
        item.UnitPrice = 1;
        itemslist.add(item);
        xmlstring.getitemslist_node(itemslist);
        Please let us know if this works.
        Regards,
        Click & Pledge Support Department

        Join us @ the educational webinars: https://clickandpledge.com/webinars/
        Live Support- read more: https://support.clickandpledge.com/s/article/general-information-live-support/

        Comment


        • #5
          Hello,

          I will try this but it seems to be the same as the current code. Can you highlight the difference?

          EDIT: Ah, I see, switch from String to List. It seems to be working in the Sandbox - I will go ahead and test in production.

          Thanks.
          Last edited by cande-dev; 10-18-2016, 02:59 PM.

          Comment

          Working...
          X