Visual Builder

Get Involved. Join the Conversation.

Topic

    Laura Moreno
    Fields Order in Custom Type
    Topic posted November 15, 2019 by Laura MorenoRed Ribbon: 250+ Points 
    6 Views, 3 Comments
    Title:
    Fields Order in Custom Type
    Summary:
    Fields Order in Custom Type
    Content:

    Hi Experts,

    We are developing a VB app that consumes BIP reports from ERP.

    The issue we are dealing with is that we´ve created a custom type:

    vType, which consists of an array of an object that has 2 fields: FIELD1 and FIELD2

    After consuming the ERP report we parse the response to this vType we created.

    The problem is that the ERP report returns the data with this order, FIELD2, FIELD1, but our vType orders its fields alphabetically: FIELD1, FIELD2. That's why the mapping is not working.

    Is there a way to do this or do we need to ask the ERP team to order their tags, alphabetically.

    Thanks in advance.

    Laura

     

     

    Version:
    19.3.1.2

    Comment

     

    • Shay Shmeltzer

      When you say : " we parse the response"

      How exactly are you parsing it? If that's logic you created then you should probably be able to map the fields the way you want them to be.

      • Laura Moreno

        We are parsing them with a javascript function we created:

        AppModule.prototype.transmuteResultData = function(jsonAsString) {
            var transmuteData = {};
            if (jsonAsString && typeof jsonAsString == 'string') {
              transmuteData = JSON.parse(jsonAsString);
            }
            return transmuteData;
          };

         

        We have asked the ERP team to order their report but the issue still continues.

        We can't find where's the problem.

        I'm attaching an image to show the issue we are dealing with the undefined data.

         

        Thanks,

        Laura

         

         

    • Laura Moreno

      Thanks Shay for your help, we noticed we had an error in our type definition.

      Regards.