{"action":"created","issue":{"url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1534","repository_url":"https://api.github.com/repos/volkanceylan/Serenity","labels_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1534/labels{/name}","comments_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1534/comments","events_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1534/events","html_url":"https://github.com/volkanceylan/Serenity/issues/1534","id":192361626,"number":1534,"title":"Usage Question: Customized Data field based on columns data in row.","user":{"login":"stixoffire","id":9748682,"avatar_url":"https://avatars.githubusercontent.com/u/9748682?v=3","gravatar_id":"","url":"https://api.github.com/users/stixoffire","html_url":"https://github.com/stixoffire","followers_url":"https://api.github.com/users/stixoffire/followers","following_url":"https://api.github.com/users/stixoffire/following{/other_user}","gists_url":"https://api.github.com/users/stixoffire/gists{/gist_id}","starred_url":"https://api.github.com/users/stixoffire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stixoffire/subscriptions","organizations_url":"https://api.github.com/users/stixoffire/orgs","repos_url":"https://api.github.com/users/stixoffire/repos","events_url":"https://api.github.com/users/stixoffire/events{/privacy}","received_events_url":"https://api.github.com/users/stixoffire/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-29T18:29:06Z","updated_at":"2016-12-01T19:12:56Z","closed_at":"2016-12-01T19:12:56Z","body":"I have a Column that is made up of the selections from multiple columns and a sequence number in a separate table. Upon use of the sequence number I also need to increment it.\r\nBasically I have orderNumber column = SalesPersonCode + 2 Digit Year + [Dash] + SequenceNumber\r\nThere are 3 tables involved and a brief structure is as follows:\r\n\r\n**tblOrders:**\r\norderId\r\norderNumber \r\n\r\n> [Business rule requires this and it is this field that I need to concatenate with values\r\n> Please note SequenceNumber can not be duplicated. So 2 users cannot simply retrieve it and concatenate - it has to be done on save and then increment the sequence. The Sequence number will be reset annually .]\r\n\r\n\r\n_SalesPersonID_  [Foreign Key - to SalesPersonId in tblSalesPerson]\r\n\r\n**tblSalesPerson:**\r\nSalesPersonID\r\nSalesPersonName\r\nSalesPersonCode\r\n\r\n**tblApplicationData:**\r\nSequenceNumber\r\n\r\nWhen I am saving the order I want to get the SequenceNumber - and update the orderNumber  based on the columns and its value, and after the save executes the tblApplicationData.SequenceNumber must be incremented.\r\n\r\n> What is the best approach to accomplish this in Serenity ?"},"comment":{"url":"https://api.github.com/repos/volkanceylan/Serenity/issues/comments/264264881","html_url":"https://github.com/volkanceylan/Serenity/issues/1534#issuecomment-264264881","issue_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1534","id":264264881,"user":{"login":"stixoffire","id":9748682,"avatar_url":"https://avatars.githubusercontent.com/u/9748682?v=3","gravatar_id":"","url":"https://api.github.com/users/stixoffire","html_url":"https://github.com/stixoffire","followers_url":"https://api.github.com/users/stixoffire/followers","following_url":"https://api.github.com/users/stixoffire/following{/other_user}","gists_url":"https://api.github.com/users/stixoffire/gists{/gist_id}","starred_url":"https://api.github.com/users/stixoffire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stixoffire/subscriptions","organizations_url":"https://api.github.com/users/stixoffire/orgs","repos_url":"https://api.github.com/users/stixoffire/repos","events_url":"https://api.github.com/users/stixoffire/events{/privacy}","received_events_url":"https://api.github.com/users/stixoffire/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T19:12:56Z","updated_at":"2016-12-01T19:12:56Z","body":"@edson Your suggestions and guidance worked perfectly - I created a separate static class for my Generated OrderNumber and I simply call it. In the BeforeSave, I then update the SequenceNumber in an overidden execute save method - there are not many users <10 and the chance for a concurrency issue of a duplicate is slim. I will think on how better to do this if need be. THX -again - I searched Northwind for the samples but yours seemed much clearer to me, "}}
{"actor":{"display_login":"stixoffire"}}