Skip to content

Instantly share code, notes, and snippets.

Avatar
🦇
What Would Batman Do?

Vlad Kostyanetsky vkostyanetsky

🦇
What Would Batman Do?
View GitHub Profile
View CopyInformationRegisterEntries.bsl
Source = "UsersSettings";
Receiver = "DeeplyEssentialUsersSettings";
QueryText = StrTemplate("SELECT * FROM InformationRegister.%1", Source);
Query = New Query(QueryText);
Selection = Query.Execute().Select();
While Selection.Next() Do
View HowToMakeDocumentPrefix.bsl
EntityForEntityPrefix = UsersSettings.Get("DefaultFillingValues", "MainCompany", SmallBusinessServer.GetPredefinedEntity());
DateForDatePrefix = FieldPopulatedValueByLocalField(Row, "Date", Template);
Number = StringFunctionsClientServer.SupplementString(Input, 8, "0", "Left");
Prefix = "";
ObjectPrefixationEventsBIT.SetDocumentPrefix(Undefined, Prefix, , , , , , , , DateForDatePrefix, EntityForEntityPrefix);
@vkostyanetsky
vkostyanetsky / MoveItemByList.ps1
Created Jul 25, 2020
Moving Files Using a List Provided
View MoveItemByList.ps1
$list = "E:\fileslist.txt"
$source = "E:\destination"
$destination = "E:\source"
Get-Content -Path $list | ForEach-Object { Move-Item "$source$_" $destination }
@vkostyanetsky
vkostyanetsky / ValueTableToSpreadsheetDocument.bsl
Last active May 16, 2020
ValueTable to SpreadsheetDocument
View ValueTableToSpreadsheetDocument.bsl
&AtServerNoContext
Function ValueTableToSpreadsheetDocument(ValueTable)
Builder = New ReportBuilder;
Builder.DataSource = New DataSourceDescription(ValueTable);
SpreadsheetDocument = New SpreadsheetDocument;
Builder.Put(SpreadsheetDocument);
Return SpreadsheetDocument;
View refs.bsl
&AtServerNoContext
Function Refs(MaxCount = 1000)
Refs = New Array;
For Each CatalogManager In Catalogs Do
Selection = CatalogManager.Select();
While Selection.Next() Do
@vkostyanetsky
vkostyanetsky / attribute.bsl
Last active May 16, 2020
How to Find a Standard Attribute with Particular Name
View attribute.bsl
&AtServerNoContext
Function IsStandardAttributeWithName(Attribute, MetadataObject, StandardAttributeName)
Try
Result = Attribute.Name = MetadataObject.StandardAttributes[StandardAttributeName].Name;
Except
Result = False;