Skip to content

Instantly share code, notes, and snippets.

View vkostyanetsky's full-sized avatar
🦇
What Would Batman Do?

Vlad Kostyanetsky vkostyanetsky

🦇
What Would Batman Do?
View GitHub Profile
Source = "UsersSettings";
Receiver = "DeeplyEssentialUsersSettings";
QueryText = StrTemplate("SELECT * FROM InformationRegister.%1", Source);
Query = New Query(QueryText);
Selection = Query.Execute().Select();
While Selection.Next() Do
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 July 25, 2020 07:11
Moving Files Using a List Provided
$list = "E:\fileslist.txt"
$source = "E:\destination"
$destination = "E:\source"
Get-Content -Path $list | ForEach-Object { Move-Item "$source$_" $destination }
@vkostyanetsky
vkostyanetsky / attribute.bsl
Last active May 16, 2020 18:34
How to Find a Standard Attribute with Particular Name
&AtServerNoContext
Function IsStandardAttributeWithName(Attribute, MetadataObject, StandardAttributeName)
Try
Result = Attribute.Name = MetadataObject.StandardAttributes[StandardAttributeName].Name;
Except
Result = False;
@vkostyanetsky
vkostyanetsky / ValueTableToSpreadsheetDocument.bsl
Last active May 16, 2020 18:33
ValueTable to SpreadsheetDocument
&AtServerNoContext
Function ValueTableToSpreadsheetDocument(ValueTable)
Builder = New ReportBuilder;
Builder.DataSource = New DataSourceDescription(ValueTable);
SpreadsheetDocument = New SpreadsheetDocument;
Builder.Put(SpreadsheetDocument);
Return SpreadsheetDocument;
&AtServerNoContext
Function Refs(MaxCount = 1000)
Refs = New Array;
For Each CatalogManager In Catalogs Do
Selection = CatalogManager.Select();
While Selection.Next() Do