This is really thoughtful and helpful solution @Sanjeev S I was wondering is there a way that I could add "text" in front of the auto-generated numbers I have two companies and thinking of putting a prefix (manually or automatically) so that there is no overlap of Alias/Barcode. e.g ABC1000001 and XYZ1000001 Would really appreciate a solution
Bhawana Mam, You need to add just a prefix to mycode [system : formulae] MyCode1 : @@MyNCode MyCode2 : $$ZeroFill@MyCode1:6 MyPrefix : @@CmpmailName contains "ABC" then "ABC" else "XYZ" MyCode : @@MyPrefix + @@MyCode2
Great. Thanks I am testing the code. Facing error in one company (getting the same number in Alias everytime) . I will share an update after complete testing.
@Sanjeev S sir I am using Company Website instead of Company Name - was facing some issues with Company Name. Also, I tested the code and facing an error - The number is not updating automatically. I continue to see the same number or some random number (image attached) in Alias on creating new Item Could you please check if I have put the two Codes shared by you correctly. Thanks for your help ! [#Form : Stock Item] Local : Field : MST Alias: Set As : + If $$Line=1 And $$InCreateMode Then ($$String@MyCode) + else if $$Line=1 And $$InAlterMode and $$IsEmpty:$Name then ($$String@MyCode) + else $Name Local : Field : MST Alias: Set Always : Yes [system : formulae] MyCode1 : @@MyNCode MyCode2 : $$ZeroFill@MyCode1:7 MyPrefix : @@Cmpwebsite MyCode : @@MyPrefix + @@MyCode2 LNo : $$CollectionField:$OnlyAlias:1:InstaAStocks LNoNum : $$Number@LNo MyNCode : @@LNoNum + 1 [Collection : InstaAStocks] Collection : List of StockItems Fetch : MasterId, PartNo, OnlyAlias Sort : @@Increasing : -$OnlyAlias,$Name Format : $Masterid Format : $OnlyAlias
Bhawna Mam, Normally the logic fails if you forcefully add some other alias apart from the Logic. Just remove them or put them in Part No The Logic will work. Regards,
Bhawana Mam, You can alternatively try this code ..... I hope it can work either for Part No or Alias /*Item and Ledger has unique Master ID in Tally we can use it in Auto Numbering using No of Ledgers/Stockitem can fail if we delete Ledger/Items hence this can be a safer way*/ [#Field: STKI PartNo] Setas : If ($$Line=1 AND ($$InCreateMode or $$IsEmpty:$$Value)) + then @MyCode + else $$Value Type : String : Forced SetAlways : Yes ;; Local Formula MyMastID : #STKIMasterID + 1 MyCode : $$ZeroFillMyMastID:6 [#Part: STKI Desc] add : Line : after : STKI Desc : STKI Master ID Invisible : NO [Line : STKI Master id] Fields : Short Prompt, STKI Master id Local : Field : Short Prompt : Info : $$LocaleString:"Unique ID" Invisible : NOT ##UseStockDescription Space Top : 0.25 [Field : STKI Master ID] Use : Number Field Set as : @@LNo Type : Number : Forced Skip : Yes Set Always : Yes [Collection : InstaMasterID] Collection : List of StockItems Fetch : MasterId, PartNo Sort : -$MasterId Add : Format : PartNo, $Masterid [System : Formulae] LNo : $$CollectionField:$MasterID:1:InstaMasterID
PLEASE SHARE MARKED GST DETAILS TDL AS IT SHOW ALL GST DETAILS , PLEASE EMAIL ME THIS TDL - tejeet1@gmail.com
This seems to really good logic but somehow, I see the same unique number on Creating the New Stock Item. I will continue to use the earlier TDL shared by you - that works better for my requirements.thanks again for the help
Thanks a lot for the suggestion. Is there a way that I could put a restriction on this i.e do not allow the user to change the alias