{Document.Services.ObjectModule(55)}: Value is not of object type (Description)   MessageText =



Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Mar 10, 2019
Company:

Hi. When I post the data I have inserted in the debugger, I'm having this message. Value is not of object type (Description)

Error running processor - 'Posting'
, reason:
{Document.Services.ObjectModule(55)}: Value is not of object type (Description)
  MessageText = Value is not of object type (Description)

And here is the section of my Query in the posting handler.
While SelectionDetailRecords.Next() Do
  MessageText =
   MessageText + Chars.CR + Chars.LF +
   SelectionDetailRecords.ComputerEquipments.Description + ": " + (after SelectionDetailRecords. it does not find ComputerEquipments automatically so I have inserted manually.
   SelectionDetailRecords.QuantityBalance;
 EndDo;

I'm new in 1C development so I would appreciate any help even it seems an easy question to ask.

Thanks..

 
#2
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 10, 2017
Company: Rufinor

Dear Abbas, please share with us more code you use. What is the object SelectionDetailRecords? Is this a query selection result ? Please provide query code.

Kind regards,
Alex

 
#3
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Mar 10, 2019
Company:

Dear, Alex

Thanks for viewing my post. Here is the full code. SelectionDetailsRecords is query selection yes. Query is reading from the SelectTable and execute the message based on the value assigned for either <0 or equal to 0. I'm especially having an error on the highlighted part I have mentioned below. Similar training version of this code can also be found here
https://yellow-erp.com/page/guides/1cprofessional-training-course/lesson-2-5/


Procedure Posting(Cancel, Mode)
//{{__REGISTER_REGISTERRECORDS_WIZARD
// This fragment was built by the wizard.
// Warning! All manually made changes will be lost next time you use the wizard.

// register ComputerEquipmentBalance Expense

RegisterRecords.ComputerEquipmentBalance.Write = True;
For Each CurRowEquipmentorService In EquipmentorService Do
 If CurRowEquipmentorService.Item = Enums.EquipmentorService.Services Then
    Continue;
  EndIf;

Record = RegisterRecords.ComputerEquipmentBalance.Add();
Record.RecordType = AccumulationRecordType.Expense;
Record.Period = Date;
Record.ComputerEquipments = CurRowEquipmentorService.Item;
Record.Warehouse = Warehouse;
Record.Quantity = CurRowEquipmentorService.Quantity;

EndDo;

 //2. Writing down BalanceOfMaterials recordset
 RegisterRecords.ComputerEquipmentBalance.LockForUpdate = True;
 RegisterRecords.Write(); 

 //3. Checking if there any negative balance records
 Query = New Query;
 Query.Text =
  "SELECT
  | ComputerEquipmentBalanceBalance.ComputerEquipments AS ComputerEquipments,
  | ComputerEquipmentBalanceBalance.Warehouse AS Warehouse,
  | ComputerEquipmentBalanceBalance.QuantityBalance AS QuantityBalance
  |FROM
  | AccumulationRegister.ComputerEquipmentBalance.Balance AS ComputerEquipmentBalanceBalance
  |WHERE
  | ComputerEquipmentBalanceBalance.QuantityBalance < 0"; 

 QueryResult = Query.Execute();
 SelectionDetailRecords = QueryResult.Select();

 // 4. If the result is not empty, cancel the document's posting
 If SelectionDetailRecords.Count() = 0 Then
  Return;
 EndIf;

 Cancel = True;

  //Prepare the error message an  MessageText =
 MessageText =
  "There is not enough equipments on the " +
  ThisObject.Warehouse.Description +
  ". See the list of deficits below:" +
  MessageText;
 While SelectionDetailRecords.Next() Do
  MessageText =
   MessageText + Chars.CR + Chars.LF +
   SelectionDetailRecords.ComputerEquipments.Description + ": " +
   SelectionDetailRecords.QuantityBalance;
 Enddo;



 Message(MessageText);






//}}__REGISTER_REGISTERRECORDS_WIZARD
EndProcedure





Here is the output message of the Query after debugging.


{Document.Services.ObjectModule(57)}: Value is not of object type (Description)
  MessageText

Edited: Abbas Mustafaoghlu - Mar 25, 2019 02:38 PM
 
#4
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 10, 2017
Company: Rufinor

Please check what type of object you are using in AccumulationRegister.ComputerEquipmentBalance in field ComputerEquipments ?

Is this a link to a reference? or any other type of objects?

 
#5
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Mar 10, 2019
Company:

Hi Alex,

I would really appreciate if you have a look into my configuration. It is a link to the reference in which it calculates the overall and sends to the EquipmentBalance Field.

Here I have attached my configuration.

1C Configuation File

 
#6
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 10, 2017
Company: Rufinor

Hi Abbas,

I checked your configuration. You are using string data type in ComputerEquipments and Warehouse fields. And therefore you get an error message as string is simple datatype and does not have attributes like Descriptions, etc. You need to change datatype to catalogs Computer equipment and warehouse respectively.

Kind regards,
Alex

 
Subscribe