Skip to content

Commit 148411b

Browse files
author
Ahmed Elsawalhy
committed
Fixed: sequence construct not working.
1 parent bbd421c commit 148411b

File tree

17 files changed

+4268
-3320
lines changed

17 files changed

+4268
-3320
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ nuget-access-key.txt
444444
#*.dat
445445

446446
# Tests
447-
/LinkDev.Tests.EnhancedOrgService
448447

449448
# Tools
450449
*.exe

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ A CRM solution that gives a lot of flexibility in creating any pattern required
2727

2828
#### _Format String_
2929

30-
`Test-{{c|createdon@date(`hh:mm`)@|c}??NO_DATE}-{*(5,un)||*}-{d|@date(yyyy)@|d}-{j||j}-{m|3|m}`
30+
`Test-{@this.createdon$date(`hh:mm`)??`NO_DATE`}-{$rand(5,`un`)}-{$now$date(`yyyy`)}-{$sequence}-{$inparam(3)}`
3131

3232
#### _Input parameters_
3333
+ Current index: 5
3434
+ Padding: 3
3535
+ Executing user in Cairo at 9AM and server in London 7AM
36-
+ String 'PA;RA;METER' as input parameter to the WF step
36+
+ String 'PA;RA;M' as input parameter to the WF step
3737

3838
#### _Result numbering_
3939

40-
`Test-09:00-Ahmed-4AM7Z-2015-005-METER"`
40+
`Test-09:00-YAM76-2015-005-M"`
4141

4242
### Guide
4343

Yagasoft.AutoNumbering.Plugins/BLL/AutoNumberingEngine.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Collections.Generic;
55
using System.Linq;
6+
using System.Reflection;
67
using System.Text.RegularExpressions;
78
using Microsoft.Xrm.Sdk;
89
using Microsoft.Xrm.Sdk.Client;
@@ -15,7 +16,7 @@ namespace Yagasoft.AutoNumbering.Plugins.BLL
1516
{
1617
/// <summary>
1718
/// Author: Ahmed Elsawalhy<br />
18-
/// Version: 2.1.2
19+
/// Version: 3.1.1
1920
/// </summary>
2021
[Log]
2122
internal class AutoNumberingEngine
@@ -253,9 +254,10 @@ internal string ProcessIndices(string value)
253254
resetDate = null;
254255
}
255256

257+
256258
#endregion
257259

258-
value = Regex.Replace(value, @"^(?:([^:]+?)(?::(.*?))?)?$",
260+
value = Regex.Replace(value, @"^(?:([^:]*?)(?::([^:]*?)))$",
259261
match =>
260262
{
261263
var index = ProcessIndex(match, isReset, resetValue);
@@ -273,7 +275,7 @@ private int ProcessIndex(Match match, bool isReset, int resetValue)
273275
var fieldName = match.Groups[1].Value;
274276
var fieldValue = match.Groups[2].Value;
275277
fieldValue = fieldValue.IsEmpty() ? null : fieldValue;
276-
var isDefaultIndex = !fieldName.IsNotEmpty();
278+
var isDefaultIndex = fieldName.IsEmpty();
277279
var currentIndex = 0;
278280
AutoNumberingStream stream = null;
279281

@@ -351,7 +353,7 @@ private int ProcessIndex(Match match, bool isReset, int resetValue)
351353
});
352354
Log.Log($"Finished updating stream with new index.");
353355
}
354-
356+
355357
return index;
356358
}
357359

0 commit comments

Comments
 (0)