on 09-29-2009 6:39 AM
Hi Experts,
suppose its 10 digit sales order .E.g 0000013225
I need to enter only 13225 so how i will append 00000 in above case. Numbers of 0 also varies.e.g 0000121135
Thanks
Nityanand Arya
Hi
Its a total programming logic. Here is the logic:-
ex.
If your sales order is of 10 digits (mandatory), say 0000012345, then
- In your input field, you enter only 12345
- Now count the number of characters in the above string, in above case it is 5.
- So, to make it a 10 digit number, you need to append 5 Zeros,
It will look like this....
String orderNum = wdContext.current........getX();
int count = orderNum.length();
if(count==5)
{
//Append 5 leading zeros.
orderNum = "00000"+orderNum;
}
like this way, you can solve your issue.
Best Regards
Chander Kararia
Edited by: Chander Kararia on Sep 29, 2009 11:32 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nitya,
This is also very simple.
- No need to create any Java file for this code.
- In your view, You are taking Input(Order Number) from the User. After that, You must be having something like,
Submit Button Click, OR
Link Action, etc.
In short, there must be an Action on that page where you will be doing some processing on the Order Number.
- In the same method, where you are Getting the Order Number, just write the logic below that.
#Important Note -> In case you are using this modified order number many places, make sure you do either of the following steps to get the correct value every-time.
1. After setting the value to 10 digits, set the value in Context. OR
2. Create a Global variable (define it in 'Other' section, you may see it at the end of implementation tab, just scroll down) and set it only once the value.
NO NEED TO REPEAT THE CODE IN EACH & EVERY METHOD.
This will solve your issue. Still problem? Please let me know your application functionality.
Thanks.
Best Regards
Chander Kararia
Edited by: Chander Kararia on Sep 29, 2009 1:50 PM
User | Count |
---|---|
77 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.