Axapta: How to receive a transfer order programmatically.

by dsandor 16. February 2010 22:42

This is a function I wrote to receive a transfer order.  The code will receive into the default receiving location as defined when the transfer order was placed.  I found other code snippets for creating a transfer order but none to receive.

static void receiveTransferOrderToDefaultLocation(str 20 transferId)
{
    InventTransferParmTable  itpt;
    InventTransferUpdReceive itur;
    ;

    itpt.clear();
    itpt.initParmDefault();

    itpt.ParmId                 = RunBaseMultiParm::getSysParmId();
    itpt.TransferId             = transferId;
    itpt.UpdateType             = InventTransferUpdateType::Receive;
    itpt.PrintTransferReceipt   = NoYes::No;
    itpt.ReceiveUpdateQty       = InventTransferReceiveUpdateQty::All;
    itpt.EditLines              = NoYes::Yes;
    itpt.ExplodeLines           = NoYes::Yes;

    itpt.InventDimFixedReceiveList = 245;  // See note below on how to compute this.

    itur = InventTransferUpdReceive::newParmBuffer(itpt);

    itur.run();




/*

  #DEFINE.INVENTLOCATIONID_IDX(0)
>     #DEFINE.BATCH_IDX(1)
>     #DEFINE.LOCATION_IDX(2)
>     #DEFINE.PALLET_IDX(3)
>     #DEFINE.SERIALID_IDX(4)
>     #DEFINE.CONFIGID_IDX(5)
>     #DEFINE.INVENTSIZEID_IDX(6)
>     #DEFINE.INVENTCOLORID_IDX(7)

binary: 11110101
decimal: 245

*/

}

Tags: ,

Axapta | Dynamics AX | Programming

Open a PLS file in Windows Media Player

by dsandor 16. February 2010 17:57

So I use http://di.fm and Shoutcast to stream music while I write code.  I have always used the Open URL function of Windows Media Player to start streaming.  I did not bother to write an app for this because I have been so busy.  Luckily someone else already has ;)

http://openplsinwmp.codeplex.com/releases/view/16579

image

Tags:

Other

Solved: Unrecognized attribute ‘multipleSiteBindingsEnabled’. with .NET 4.0 Beta 2 and RC1.

by dsandor 15. February 2010 22:59

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'multipleSiteBindingsEnabled'. Note that attribute names are case-sensitive.
Source Error:

Line 105:  -->
Line 106:	<system.serviceModel>
Line 107:		<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
Line 108:  <services>
Line 109:			<service behaviorConfiguration="RFID.Server.WCF.Service1Behavior" 
name="RFID.Server.WCF.Service1">

Source File: C:\inetpub\web\services.test.\RFIDServer\web.config    Line: 107


Version Information: Microsoft .NET Framework Version:4.0.21006; ASP.NET Version:4.0.21006.1


Received the above error message when executing a WCF service on a test server.  The WCF service was compiled with .NET  4.0 RC and the test server only had .NET 4.0 Beta 2 installed.  The fix was easy.  Install .NET 4.0 RC full runtime on the test server and it worked.

Tags: , , , , ,

WCF | Visual Studio | Programming

Visual Studio 2010 RC - ObservableCollection<> is no longer available..

by dsandor 10. February 2010 19:25

From VS2010 Beta 2 to VS2010 RC we lost the ability to choose the data type ObservableCollection when configuring a service reference in a Silverlight application.  I am going to use this blog post to chronicle my discussion with Microsoft Go-Live support about this functionality change.

---

This may be a user education issue but the difference is significant and affects all of the production projects we currently have for Visual Studio 2010 Beta 2.

Today we upgraded 3 of our developer machines from Visual Studio 2010 Beta 2 to the Visual Studio 2010 RC.  In beta 2 when adding a Service Reference to a Silverlight 3 application we were given the option to choose a collection type of: System.Collections.ObjectModel.ObservableCollection in the Collection type drop down box.

clip_image002

Now in the release candidate we are no longer given the option to choose ObservableCollection.  Instead the dropdown offers ( Custom ), Array, Generic List (and another).  This presents us with several issues.  Existing Beta 2 code can no longer update service references without converting all return types from Array[] or List<> to an ObservableCollection. 

For Silverlight applications this is pretty major as we pass Generic Lists from our WCF service and heavily relied on the ability for the WCF Proxy class to deserialize the list into an ObservableCollection since these are bindable directly to our Silverlight grids.

Please advise.  Is this the way this will work in production or is it possible to patch the RC to provide this functionality once again.

Please feel free to call me tomorrow ( 2/10/2010 ) from 9AM EST to 8PM EST to discuss if you need more information.  It has been a while since I used Visual Studio 2008, but I am pretty sure that VS 2008 also provided the ObservableCollection collection type option when configuring a service reference.

To verify the Beta 2 vs. RC functionality difference I tested this against the same exact WCF service in both B2 and RC.

Tags: , , ,

Silverlight | Visual Studio | WCF

Translucent intellisense, when technology obscures your code ;)

by dsandor 7. February 2010 18:57

Blankenburg posted this on Friday.  Very cool thing and I never even knew about it.  Often times I am coding and am inserting a line of code above some existing code.  Many times the two are related and I need to see the line below but Intellisense covered it up.  Drat.  Press the left control key and it will get out of your way!

http://jeffblankenburg.com/2010/02/5th-of-diduary-did-you-know-you-can.aspx

 

Tags: , ,

Programming | Visual Studio

My Fix: Unknown build error, 'Cannot resolve dependency to assembly…

by dsandor 3. February 2010 18:19

image

This work around did not work for me.  I have a solution with several projects.  One of them is a WPF application that uses a Telerik third party control for the DataGrid.  Yesterday everything worked fine and this morning I came in to work and I get the error:

Error    3    Unknown build error, 'Cannot resolve dependency to assembly 'Telerik.Windows.Controls, Version=2009.3.1314.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event. Line 12 Position 10.'     D:\Projects\RFID\Source\RFID\Client\RFID.Client.UI\View\IdleView.xaml    12    10    RFID.Client.UI

No checkouts or get latest was performed.  Restarted VS2010 did not work. 

In my case the work around was to add the Telerik.Windows.Controls assembly to the project references manually.  This should have been done by the drag/drop of the Telerik control to the design surface but it did not.  Other issues were reported on connect.microsoft.com explaining that assemblies with a 2nd degree of separation which are not normally required to be directly referenced are now needed in VS2010 for whatever reason.

Tags: , , ,

WPF | Visual Studio | Programming

Sweet, my VS 2010 B2 bug was fixed! Thanks VS Dev Team!

by dsandor 13. December 2009 03:31

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=505636

I am developing a silverlight application that is using a WCF service in my local solution. When I right click on the service reference in the SL application and choose update or if I click configure a duplicate Endpoint and Bindings for the service in my ServiceReferences.ClientConfig file:
     <endpoint address="http://localhost:15153/AdminService.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IAdminService" contract="Proxy.AdminService.IAdminService"
        name="BasicHttpBinding_IAdminService" />
     <endpoint address="http://localhost:15153/AdminService.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IAdminService1" contract="Proxy.AdminService.IAdminService"
        name="BasicHttpBinding_IAdminService1" />

Posted by Microsoft on 11/16/2009 at 2:52 PM

Dear Customer,
Thanks for reporting the issue.
This issue has been resolved in the latest version of Visual Studio 2010.
Thanks!

Tags:

Programming | Visual Studio | Silverlight

Free open source screen to movie capture application.

by dsandor 13. December 2009 03:26

I have used this before and had to search for it again.  This is a great little application that will allow you to define a region of your screen and it will record a video to .avi or .swf.  It has a bunch of cool features like auto-pan, support for audio, etc.

http://sourceforge.net/projects/camstudio/

Very useful for making tutorials and video casts for your blog.. hint hint ;)

 

Tags: , ,

Programming

Solved: Custom tool warning: No endpoints compatible with Silverlight 3 were found.

by dsandor 12. December 2009 04:30

Warning    7    Custom tool warning: No endpoints compatible with Silverlight 3 were found. The generated client class will not be usable unless endpoint information is provided via the constructor.    D:\Projects\VMR\AzureVMR\VMRSilverlight\Service References\Proxy.DataService\Reference.svcmap    1    1    VMRSilverlight

Visual Studio 2010 Beta 2 has been giving me some funky errors lately.  The errors occur out of the blue.  Updating the service references work find for a few days and then seemingly at random I start to get the error above.

I found a solution that has been working for me.

Reconfigure the service reference:

image

Check the box “Reuse types in referenced assemblies” and choose “Reuse types in specified referenced assemblies”  Choose only the Model assemblies that you share between the Silverlight App and your WCF Service.  Hit OK and you should be good to go!

Tags:

Silverlight | Programming | Visual Studio | WCF

Solved: Cannot find 'ServiceReferences.ClientConfig' in the .xap application package.

by dsandor 8. December 2009 22:45

I started receiving this error after I added some code to my App.xaml.cs file.

image

 

After some searching I found some outdated info.  Basically this is a timing issue.  I inserted this code in my App.xaml.cs file:

   1: SFA.SLApplication.Proxies.DataServiceClient dataSvc = new SFA.SLApplication.Proxies.DataServiceClient();
   2:  
   3: public App()
   4: {
   5:     this.Startup += this.Application_Startup;
   6:     this.Exit += this.Application_Exit;
   7:     this.UnhandledException += this.Application_UnhandledException;
   8:  
   9:     InitializeComponent();
  10: }
  11:  
  12: private void Application_Startup(object sender, StartupEventArgs e)
  13: {
  14:     this.RootVisual = new MainPage();
  15:  
  16:     dataSvc.GetUsersAllCompleted += new EventHandler<SFA.SLApplication.Proxies.GetUsersAllCompletedEventArgs>(dataSvc_GetUsersAllCompleted);
  17:     dataSvc.GetUsersAllAsync();
  18: }

So the problem is with line #1.  This line is trying to read from the ServiceReferences.config file that can not be read at that point in the Silverlight application’s lifecycle.  Changing the code like this works:

   1: SFA.SLApplication.Proxies.DataServiceClient dataSvc = null;
   2:  
   3:  public App()
   4:  {
   5:      this.Startup += this.Application_Startup;
   6:      this.Exit += this.Application_Exit;
   7:      this.UnhandledException += this.Application_UnhandledException;
   8:  
   9:      InitializeComponent();
  10:  }
  11:  
  12:  private void Application_Startup(object sender, StartupEventArgs e)
  13:  {
  14:      this.RootVisual = new MainPage();
  15:  
  16:      dataSvc = new SFA.SLApplication.Proxies.DataServiceClient();
  17:  
  18:      dataSvc.GetUsersAllCompleted += new EventHandler<SFA.SLApplication.Proxies.GetUsersAllCompletedEventArgs>(dataSvc_GetUsersAllCompleted);
  19:      dataSvc.GetUsersAllAsync();
  20:  }

Hope this helps someone ;)

 

 

 

Full error below:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.3)
Timestamp: Tue, 8 Dec 2009 18:19:34 UTC

Message: Unhandled Error in Silverlight 3 Application
Code: 4004   
Category: ManagedRuntimeError      
Message: System.InvalidOperationException: Cannot find 'ServiceReferences.ClientConfig' in the .xap application package. This file is used to configure client proxies for web services, and allows the application to locate the services it needs. Either include this file in the application package, or modify your code to use a client proxy constructor that specifies the service address and binding explicitly. Please see inner exception for details. ---> System.Xml.XmlException: Cannot open 'ServiceReferences.ClientConfig'. The Uri parameter must be a relative path pointing to content inside the Silverlight application's XAP package. If you need to load content from an arbitrary Uri, please see the documentation on Loading XML content using WebClient/HttpWebRequest. ---> System.ArgumentException: Application object is not initialized.
   at System.Windows.Application.GetResourceStream(Uri uriResource)
   at MS.Internal.JoltHelper.ApplicationResourceStreamResolver.GetApplicationResourceStream(Uri relativeUri)
   at System.Xml.XmlXapResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   --- End of inner exception stack trace ---
   at System.Xml.XmlXapResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
   at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
   at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings)
   at System.ServiceModel.Configuration.ServiceModelSectionGroup.GetSectionGroup()
   --- End of inner exception stack trace ---
   at System.ServiceModel.Configuration.ServiceModelSectionGroup.GetSectionGroup()
   at System.ServiceModel.Configuration.ServiceModelSectionGroup.get_Current()
   at System.ServiceModel.Description.ConfigLoader.LookupChannel(String configurationName, String contractName, Boolean wildcard)
   at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
   at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName)
   at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
   at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
   at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName)
   at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
   at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()
   at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)
   at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
   at System.ServiceModel.ClientBase`1..ctor()
   at SFA.SLApplication.Proxies.DataServiceClient..ctor()
   at SFA_SLApplication.App..ctor()    

Line: 56
Char: 13
Code: 0
URI: http://localhost:26140/SFA.SLApplicationSite/

Tags: , ,

Silverlight | Programming | WCF

Other Pages

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010 David Sandor