Mashup Error when using API's

 6 Replies
 1 Subscribed to this topic
 24 Subscribed to this forum
Sort:
Author
Messages
shahzad
Basic Member
Posts: 14
Basic Member

    Hi All,

    Once i use API's MMS200MI GetItmBasic and MMS200MI UpdItmBasic, to get and update item data from Mashup,

    thier is an error i get once i run the update process. given below is the xaml for your reference;

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ui="clr-namespace:Mango.UI.Controls;assembly=Mango.UI" xmlns:mashup="clr-namespace:Mango.UI.Services.Mashup;assembly=Mango.UI" xmlns:m3="clr-namespace:MForms.Mashup;assembly=MForms">
       
       

       
          Width="1*" />
          Width="1*" />
       
       
          Height="1*" />
          Height="1*" />
       

    <!-- An example of an optional menu bar, could be removed if no menu bar will be used -->
       <!--
       
                    Style="{DynamicResource styleBackgroundApplicationBarMashup}">
          


             
                
                
                
             
          

       
       -->
       Name="FINALTEST" IsListHeaderVisible="True" IsListHeaderReadOnly="True" Grid.Column="0" Grid.Row="0" Header="ITEM MASTER">
          
             
                SourceEventName="Startup">
                   arameter TargetKey="MMCONO" />
                   arameter TargetKey="MMITNO" />
                
             
          
          
             Program="MMS001" Table="MITMAS" KeyNames="MMCONO,MMITNO" SortingOrder="1" />
          
       
       Name="FINALTEST1" IsListHeaderVisible="True" IsListHeaderReadOnly="True" Grid.Column="0" Grid.Row="1" Header="ITEMWAREHOUSE">
          
             
                SourceName="FINALTEST" SourceEventName="CurrentItemChanged">
                   arameter TargetKey="MBCONO" />
                   arameter TargetKey="MBWHLO" />
                   arameter TargetKey="MBITNO" />
                
             
          
          
             Program="MMS002" Table="MITBAL" KeyNames="MBCONO,MBWHLO,MBITNO" SortingOrder="2" />
          
       
       Name="ITEMUPDATE" Grid.Column="1" Grid.Row="0">
          Header="ITEMUPDATE">
             Name="ITEMUPDATE1" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible">


                Name="ITMD">
                   
                      
                         TargetEventName="Get" SourceName="FINALTEST" SourceEventName="CurrentItemChanged">
                            arameter TargetKey="CONO" SourceKey="MMCONO" />
                            arameter SourceKey="MMITNO" TargetKey="ITNO" />
                         
                         TargetName="ITMD" TargetEventName="Update" SupportsRefresh="False">
                            arameter TargetKey="CONO" SourceKey="CONO" />
                            arameter TargetKey="ITNO" SourceKey="ITNO" />
                            arameter TargetKey="ITDS" SourceKey="ITDS" />
                         
                      
                   
                   
                      
                         Program="MMS200MI" Transaction="GetItmBasic" Type="Get" InputFields="CONO,ITNO" OutputFields="ITDS,FUDS" MaxReturnedRecords="1" />
                         Program="MMS200MI" Transaction="UpdItmBasic" Type="Update" InputFields="CONO,ITNO,ITDS" MaxReturnedRecords="1" />
                      
                   
                   
                      
                         Width="Auto" />
                         Width="8" />
                         Width="200" />
                         Width="16" />
                         Width="Auto" />
                         Width="8" />
                         Width="200" />
                         Width="16" />
                         Width="*" />
                      
                      
                         Height="Auto" />
                         Height="Auto" />
                      
                      Content="Name:" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                      MaxLength="30" Text="{Binding [ITDS]}" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                      Content="Description 2:" Grid.Row="0" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                      MaxLength="60" Text="{Binding [FUDS]}" Grid.Row="0" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                      Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,16,0,0" Grid.ColumnSpan="7">
                         Content="{mashup:Constant Key=Save,File=Mango.UI}" Width="150" VerticalAlignment="Center" Margin="8,0,5,0">
                            
                               
                                  TargetEventName="Update" TargetName="ITMD" />
                               
                            
                         
                      
                   
                
             
          
       

     

    Hope you can assist in this regard,

     

    BR,

     

    Shahzad

     

    Karin
    Veteran Member
    Posts: 57
    Veteran Member
      The update datasource transaction is missing the mandatory fields property. Only values that are changed will be passed to the update transaction so you need to tell the mashup what fields are the keys (mandatory). You don't need to add CONO since Smart Office will use your current company automatically.
      Program="MMS200MI" Transaction="UpdItmBasic" Type="Update" InputFields="ITNO,ITDS" MaxReturnedRecords="1" MandatoryFields="ITNO" />
      Regards Karin http://smartofficeblog.com
      shahzad
      Basic Member
      Posts: 14
      Basic Member

        Hi Karin,

         

        Thank you for your response.

         

        But its not clear what you want me to do. what i have done so far is the code retrieves data from MMS200MI API to get information from M3. now what i need to do is do necessary changes in the required fields and update data through Mashup. i need assistance for that purpose. given below is the new code for your perusal. appreciate your assistance in this regard. 


         

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ui="clr-namespace:Mango.UI.Controls;assembly=Mango.UI" xmlns:mashup="clr-namespace:Mango.UI.Services.Mashup;assembly=Mango.UI" xmlns:m3="clr-namespace:MForms.Mashup;assembly=MForms">
           
           

           
              Width="1*" />
              Width="4*" />
           
           
              Height="3*" />
              Height="2*" />
           

        <!-- An example of an optional menu bar, could be removed if no menu bar will be used -->
           <!--
           
                        Style="{DynamicResource styleBackgroundApplicationBarMashup}">
              


                 
                    
                    
                    
                 
              

           
           -->
           Name="FINALTEST" IsListHeaderVisible="True" IsListHeaderReadOnly="True" Grid.Column="0" Grid.Row="0" Header="ITEM MASTER">
              
                 
                    SourceEventName="Startup">
                       arameter TargetKey="MMCONO" />
                       arameter TargetKey="MMITNO" />
                    
                 
              
              
                 Program="MMS001" Table="MITMAS" KeyNames="MMCONO,MMITNO" SortingOrder="1" />
              
           
           Name="FINALTEST1" IsListHeaderVisible="True" IsListHeaderReadOnly="True" Grid.Column="0" Grid.Row="1" Header="ITEMWAREHOUSE">
              
                 
                    SourceName="FINALTEST" SourceEventName="CurrentItemChanged">
                       arameter TargetKey="MBCONO" />
                       arameter TargetKey="MBWHLO" />
                       arameter TargetKey="MBITNO" />
                    
                 
              
              
                 Program="MMS002" Table="MITBAL" KeyNames="MBCONO,MBWHLO,MBITNO" SortingOrder="2" />
              
           
           Name="ITEMUPDATE" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2">

              

                 
                    
                       Height="5*" />
                       Height="1*" />
                       Height="2*" />
                    
                    
                       Width="1*" />
                    
                    Grid.Row="0" Grid.Column="0" Name="GETITEMBASIC">
                       
                          
                             SourceName="FINALTEST" TargetName="GETITEMBASIC" SourceEventName="CurrentItemChanged" TargetEventName="Get">
                                arameter SourceKey="MMCONO" TargetKey="CONO" />
                                arameter SourceKey="MMITNO" TargetKey="ITNO" />
                             
                          
                       
                       
                          Program="MMS200MI" Transaction="GetItmBasic" Type="Get" InputFields="ITNO,CONO" OutputFields="ITNO,ITDS,FUDS,RESP,ITGR,GRP1,GRP2,GRP3,GRP4,GRP5,HIE2,CFI1,CFI5,WAPC,CHCD,BUAR,UNMS,PRGP,ALUC" />
                       
                       
                          
                             Width="Auto" />
                             Width="8" />
                             Width="200" />
                             Width="16" />
                             Width="Auto" />
                             Width="8" />
                             Width="200" />
                             Width="16" />
                             Width="*" />
                          
                          
                             Height="Auto" />
                             Height="Auto" />
                             Height="Auto" />
                             Height="Auto" />
                             Height="Auto" />
                             Height="Auto" />
                             Height="Auto" />
                             Height="Auto" />
                             Height="Auto" />
                             Height="Auto" />
                          
                          Content="Item number:" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="15" Text="{Binding [ITNO]}" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Name:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="30" Text="{Binding [ITDS]}" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Description 2:" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="60" Text="{Binding [FUDS]}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Responsible:" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="10" Text="{Binding [RESP]}" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Basic unit of measure:" Grid.Row="4" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="3" Text="{Binding [UNMS]}" Grid.Row="4" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Item group:" Grid.Row="5" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="8" Text="{Binding [ITGR]}" Grid.Row="5" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Business area:" Grid.Row="6" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="3" Text="{Binding [BUAR]}" Grid.Row="6" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Configuration code:" Grid.Row="7" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="1" Text="{Binding [CHCD]}" Grid.Row="7" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Normal waste percentage:" Grid.Row="8" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="7" Text="{Binding [WAPC]}" Grid.Row="8" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Hierachy level 2:" Grid.Row="9" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="15" Text="{Binding [HIE2]}" Grid.Row="9" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Search group 1:" Grid.Row="0" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="15" Text="{Binding [GRP1]}" Grid.Row="0" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Search group 2:" Grid.Row="1" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="15" Text="{Binding [GRP2]}" Grid.Row="1" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Search group 3:" Grid.Row="2" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="15" Text="{Binding [GRP3]}" Grid.Row="2" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Search group 4:" Grid.Row="3" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="15" Text="{Binding [GRP4]}" Grid.Row="3" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Search group 5:" Grid.Row="4" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="15" Text="{Binding [GRP5]}" Grid.Row="4" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="User-defined field 1 - item:" Grid.Row="5" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="10" Text="{Binding [CFI1]}" Grid.Row="5" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="User-defined field 5 - item:" Grid.Row="6" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="1" Text="{Binding [CFI5]}" Grid.Row="6" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Procurement group:" Grid.Row="7" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="3" Text="{Binding [PRGP]}" Grid.Row="7" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Alternate U/M in use:" Grid.Row="8" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="1" Text="{Binding [ALUC]}" Grid.Row="8" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                       
                    

                    Name="GETITMPRICE" Grid.Column="0" Grid.Row="1">
                       
                          
                             SourceName="FINALTEST" SourceEventName="CurrentItemChanged" TargetName="GETITMPRICE" TargetEventName="Get">
                                arameter SourceKey="MMCONO" TargetKey="CONO" />
                                arameter SourceKey="MMITNO" TargetKey="ITNO" />
                             
                          
                       
                       
                          Program="MMS200MI" Transaction="GetItmPrice" Type="Get" InputFields="CONO,ITNO" OutputFields="PUPR,PUCD,ECCC" />
                       
                       
                          
                             Width="Auto" />
                             Width="8" />
                             Width="200" />
                             Width="16" />
                             Width="Auto" />
                             Width="8" />
                             Width="200" />
                             Width="16" />
                             Width="*" />
                          
                          
                             Height="Auto" />
                             Height="Auto" />
                          
                          Content="Consumption code - trade stat (TST):" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="4" Text="{Binding [ECCC]}" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Purchase price:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="19" Text="{Binding [PUPR]}" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Purchase price quantity:" Grid.Row="0" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="5" Text="{Binding [PUCD]}" Grid.Row="0" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                       
                    
                    Name="GETITEMWH" Grid.Column="0" Grid.Row="2">
                       
                          
                             SourceName="FINALTEST1" TargetName="GETITEMWH" TargetEventName="Get" SourceEventName="CurrentItemChanged">
                                arameter SourceKey="MBITNO" TargetKey="ITNO" />
                                arameter SourceKey="MBWHLO" TargetKey="WHLO" />
                             
                          
                       
                       
                          Program="MMS200MI" Transaction="GetItmWhsBasic" Type="Get" InputFields="WHLO,ITNO" OutputFields="RESP,BUYE,SUNO,LEAT,UNMU,EQDA" />
                       
                       
                          
                             Width="Auto" />
                             Width="8" />
                             Width="200" />
                             Width="16" />
                             Width="Auto" />
                             Width="8" />
                             Width="200" />
                             Width="16" />
                             Width="*" />
                          
                          
                             Height="Auto" />
                             Height="Auto" />
                             Height="Auto" />
                          
                          Content="Responsible:" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="10" Text="{Binding [RESP]}" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Buyer:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="10" Text="{Binding [BUYE]}" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Supplier number:" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="10" Text="{Binding [SUNO]}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Economical order quantity days:" Grid.Row="0" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="3" Text="{Binding [EQDA]}" Grid.Row="0" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Lead time:" Grid.Row="1" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="3" Text="{Binding [LEAT]}" Grid.Row="1" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                          Content="Order multiple:" Grid.Row="2" Grid.Column="4" HorizontalAlignment="Left" VerticalAlignment="Center" />
                          MaxLength="17" Text="{Binding [UNMU]}" Grid.Row="2" Grid.Column="6" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                       
                    
                 
              
           


         

        Karin
        Veteran Member
        Posts: 57
        Veteran Member
          Hi,

          Perhaps it will be more clear if you check my answer to Priyanthas question in the comments section on this blog post: on https://smartofficeblog.c...he-mashup-designer/.
          Regards Karin http://smartofficeblog.com
          shahzad
          Basic Member
          Posts: 14
          Basic Member

            Hi Karin,

            Thanks for the response.

            i have tried that, but it throws errors. so i decided to look for another option. the way am working is i need to many get API's to update many API's. so the code needs the update option. appreciate your assistance in this regard.
            Karin
            Veteran Member
            Posts: 57
            Veteran Member
              Hi,

              I'm afraid I can't assist and build your mashup. I can assist and answer questions. In your latest example (which I cannot use directly since all leading < is removed) the UpdItmBasic transaction is missing. The basic idea is that all values you have retrieved in the scope of the panel can be used in an update transaction. However the update will try and be smart and only send in those fields that are selected as input fields - but they need to be changed. So a common issue is that the fields that are mandatory needs to be set on the data source as "MandatoryFields". To trigger the update you need a button to send the update event to the control. I suggest that you look at the Customers sample in the Mashup Designer and browse for more examples on my blog or that you see if there are any Infor courser that you can take to learn more.

              Please note that you wrote in the first post that "There is an error" - what exactly is the error from the update call? Have you turned on the debug check box to verify that the values you need for the update transaction is present in the event that triggers the update?
              Regards Karin http://smartofficeblog.com
              shahzad
              Basic Member
              Posts: 14
              Basic Member

                HI Karin,

                 

                Thank You for your response!

                Their seems to some values missing when the copy & paste is done.

                 is their another way for me to share the code?, then you may get a better idea of what am trying.