Microsoft Dynamics AX Support

This blog contains posts by the Microsoft Dynamics AX Support Teams Worldwide

Publish Procurement catalog fails with ‘Unable to save data to the file "layoutsepimagesimage_<some numbers>.jpg"’

When you from an AX client computer try to publish a Procurement catalog (Procurement and sourcing/Common/Catalogs/Procurement catalogs) it fails with an error like this:
Unable to save data to the file “\layouts\ep\images\image_97_0_22565437573.jpg”.
 
The reason this happen is:
When you click “Publish catalog” button, it will in addition to publish the catalog itself also publish the images for the products to the EP (Enterprise Portal) server.
Actually, it saves the image files to the layout folder on EP server machine.
In current design, it always believes that the client and EP server are on the same machine.
So when you click the “Publish catalog” button on the AX client which is on a different machine than EP, it tries to get the local SharePoint folder from the registry as the layout folder of EP server.
As EP and SharePoint is not installed on the client machine, the layout folder doesn’t exist on this machine.
The image deployment gets the folder where SharePoint is installed from registry on local computer and the image folder is only specified as relative to the SharePoint installation folder.
So the publish catalog only works when running on the web/EP server.

When this happens then the catalog itself is published but the images are not.
 
After you have published the Procurement catalog, you have the following options to deploy the images:
 
Option 1:
Run this command line: AxUpdatePortal –images –websiteurl http://<server:port>/Sites/DynamicsAX Ref: https://msdn.microsoft.com/en-us/library/dd261467.aspx
It will deploy all images.
This option require that the user have Administration permissions in AX and on the SharePoint/EP server.
 
Option 2:
User can publish all the images by System Administration->Setup->Enterprise Portal->Publish images
This option require that the user have Administration permissions in AX and on the SharePoint/EP server.
 
Option 3:
Use Windows Task Scheduler to run AxUpdatePortal on scheduled times.
There is a way to set up security context for task: https://technet.microsoft.com/en-us/library/cc722152.aspx
 
Then I would use verbose option to save the log to file so somebody could review it from time to time if it succeeded.
The command would look like:
“C:\Program Files\Microsoft Dynamics AX\60\Setup\AXUpdatePortal.exe -images -websiteurl http://dax2012/sites/DynamicsAx -verbose > c:\ax\EPUpdateLog.txt”
 
An Administrator could schedule such a task on EP server and run the task as an Administrator account, then you should not have a security issue for AxUpdatePortal.
How often you should run the task depends on how often images are updated/added in AX.
Then the users can run the Publish catalog when they need and the images will be updated on scheduled times.
 
Additional Information:
AXUpdatePortal and Publish images is calling EPDeploymentService (running in IIS) which is doing the deployment, so these deployment functions can be ran from any AX client/server.