Platform
Learn
Community
Support
Partner Center
Sign up
or
Log in
logout
Account Settings
Profile
messages
Messages
logout
Logout
Platform
Home
Downloads
IPP
Licensing
Project Sizing
Learn
Training
Documentation
Evaluation Guide
What's New
Community
Home
Forums
Forge
Ideas
Members
Support
Partner Guide
Resources Library
Opportunities
Account Management
Sign up
or
Log in
Home
Forums
Forge
Ideas
Members
Dear ,
What would improve your OutSystems Community experience? Let us know by taking this 2-minute survey.
Pick up the survey
Community
›
Forums
›
Technology & Integration
Generating unique reference
Community
›
Forums
›
Technology & Integration
Generating unique reference
New Post
New Post
Glenn
Posted on 2011-04-20
Glenn
Rank: #23055
Posted on 2011-04-20
Hi,
I'm a new user to the outsystems platform and i'm trying to build a demo Gap analyses application where the users can key in a test case with there own reference and key in a child Gap which should get an automatic numbering eg. GAP-0000001.
Could you point me out to the right direction how I can achive this?
I've tried to create a method (action) in the integration studio but i fear my C# knowledge lets me down.
note: I'm using the community platform edition
Best Regards,
Glenn
J.
mvp_badge
mvp_label
Posted on 2011-04-20
J.
mvp_badge
mvp_label
Rank: #7
Posted on 2011-04-20
Solution
If you create an entity the ID will be a autonumber. What is stopping you from (ab)using that?
just when creating a record, update the record afterwards in the column with the desired key-value?
Solution
Glenn
Posted on 2011-04-20
Glenn
Rank: #23055
Posted on 2011-04-20
Solution
(smak to the head)
Ofcourse, thanks!
So in a flow:
1. Fill in my edit record source
2. CreateOrUpdate
3. Get ID from the CreateOrUpdate method and transform with "GAP-" + Right("000000"; id) (or something like that)
4. Update back again to the database?
or do you advice anything different?
Rgrds,
Glenn
Solution
J.
mvp_badge
mvp_label
Posted on 2011-04-20
J.
mvp_badge
mvp_label
Rank: #7
Posted on 2011-04-20
Solution
bullet 3 means you will update a different column, not the id itself ofcourse.
about the advice, I'm just giving you a possible solution to the question you are asking :)
If you ask my advice I probably would say something different depending on the requirement you have.
Solution
Glenn
Posted on 2011-04-20
Glenn
Rank: #23055
Posted on 2011-04-20
Solution
Yes I update a reference field.
My question to advice if below is OK is just if it will not conflict any damage to my database. Not if it is inscope with my project as i think this will cover my needs on that part.
Anyhow many thanks for this direction, I've tested it and it works great.
1. Fill in my edit record source
2. CreateOrUpdateGap
3. Check if its a new record
4. Assign edit record source: Id = CreateOrUpdateGap.Id
5. Assign edit record source: Reference = "GAP-" + id
6. UpdateGap
Only chalange to fix is to have GAP-0000001 instead of GAP-1 as example above as the build in function does not contain the "Right" function.
Solution
Kilian Hekhuis
mvp_badge
mvp_label
Posted on 2011-04-22
Kilian Hekhuis
mvp_badge
mvp_label
Rank: #9
Posted on 2011-04-22
Solution
"Only chalange to fix is to have GAP-0000001 instead of GAP-1"
If I'm not mistaken, you could use the FormatText built-in function to pad the number with 0s.
Solution
Acácio Porta Nova
Posted on 2011-04-22
Acácio Porta Nova
Rank: #42
Posted on 2011-04-22
Solution
Hi
As Killian said, use FormatText:
http://www.outsystems.com/help/servicestudio/5.1/Language_Reference/Built_in_Functions/Formatting_functions/FormatText_Function.htm
Reference = "GAP-" + FormatText(CreateOrUpdateGap.Id,8, 8, true, "0");
Cheers,
Solution
Quick Reply
attachment
Choose File
No file chosen
Submit
Login to reply
New Post
Available Forums
Technology & Integration
News and Announcements
Forge Discussions
Meta
Community Quick Guides
Usability
Installation Troubleshooting
Personal Environment Troubleshooting
Forum Notifications
Email Digest Settings
Loading...