I have ITEM (catalog) so i need to add item IMAGE, please, i do not have any experience with programming language 1C, if is it possible using without coding.
I'm glad to welcome you on 1C:Developer Network forums.
Would you please explain your task more precisely? If you would like to add a photo of a product for ITEM catalog items, you can see an example in 1C:Subsystems Library or 1C:Small Business.
The steps:
Add the Picture attribute for the catalog of ValueStorage type.
Add the PictureAddress form attribute of String type.
Add the ChangePicture command with Action and place it on the form.
Add OnCreateAtServer and AfterWriteAtServer event handlers for the form.
Add the following Script to the form module:
Code
&AtClient
Procedure ChangePicture(Command)
BeginPutFile(New NotifyDescription("ChangePictureAfterPutFile", ThisForm), , , True, UUID);
EndProcedure
&AtClient
Procedure ChangePictureAfterPutFile(Result, Address, SelectedFileName, AdditionalParameters) Export
If Result Then
PictureAddress = Address;
EndIf;
EndProcedure
&AtServer
Procedure AfterWriteAtServer(CurrentObject, WriteParameters)
If Not IsBlankString(PictureAddress) Then
Picture = GetFromTempStorage(PictureAddress);
PictureAddress = PictureAddress;
CurrentObject.Picture = New ValueStorage(Picture);
CurrentObject.Write();
EndIf;
EndProcedure
&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)
If Not Parameters.Key.IsEmpty() Then
CurrentObject = Parameters.Key.GetObject();
PictureAddress = PutToTempStorage(CurrentObject.Picture.Get());
EndIf;
EndProcedure
I have included a simplest example as a .cf file for you.
{Catalog.Item.Form.ItemForm.Form(3,21)}: Type is not defined (NotifyDescription) BeginPutFile(New <<?>>NotifyDescription("ChangePictureAfterPutFile", ThisForm), , , True, UUID); (Verification: Thin client)
Hi, how to change this piece of code to work in "Information registers", cause information register can get this "Get()" method (specified in "On Create at server") Thanks