Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > {Document.Services.ObjectModule(55)}: Value is not of object type (Description)   MessageText =

Forum

Search UsersRules
{Document.Services.ObjectModule(55)}: Value is not of object type (Description)   MessageText =
#1
Just came
Points:: 0
Joined:: Mar 10, 2019

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..

Profile
#2
Active user
Points:: 0
Joined:: Mar 10, 2017

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

Profile
#3
Just came
Points:: 0
Joined:: Mar 10, 2019

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

Profile
#4
Active user
Points:: 0
Joined:: Mar 10, 2017

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?

Profile
#5
Just came
Points:: 0
Joined:: Mar 10, 2019

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

Profile
#6
Active user
Points:: 0
Joined:: Mar 10, 2017

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

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.