Method Community

 

Increase # in TEXT FIELD

Last post 05-15-2012 12:51 PM by Method_Ted. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 05-02-2012 4:24 PM

    Increase # in TEXT FIELD

    Currently we have a Call Report Screen and in the screen is a Call Report #.  The format of the number is CR 12 - xxxx, where the first digit is the year and the remaining 4 digits are entered manully. i.e. CR 12 - 0001

    Is there something I can put into the logic so when I SAVE a NEW Call Report is automatically looks to see what the last Call Report # was and adds one to it and creates it. i.e. We are on CR 12 - 0234 and I create a new call and save it and it automatically puts in CR 12 - 0235 as the call number.

    Thank you,
    Wavetec
  • 05-03-2012 9:11 AM In reply to

    Re: Increase # in TEXT FIELD

    @Wavetec

    You can take a look at the Character Function action. Use this action to 

    -      Retrieve value from table to get the number for the last record. 

    -      Use the character function perhaps more than once to do the rest. 

    Please let me know if I can be of further assistance.

    Ted Le
    Customization Solution Specialist
    Method Integration
    Local: 416.847.0400
    Toll Free: 1.888.925.6238
    Fax: 416.640.6027
    E-mail: t.le@methodintegration.com
    Website: http://www.methodintegration.com
  • 05-03-2012 9:41 AM In reply to

    Re: Increase # in TEXT FIELD

    @Wavetec

    Just another note to help with the case.

    After retrieving the value of the previous Call Report, you will need to perform a Basic Math action to increment the Call Report number by 1

    I hope this helps

     

    Ted Le
    Customization Solution Specialist
    Method Integration
    Local: 416.847.0400
    Toll Free: 1.888.925.6238
    Fax: 416.640.6027
    E-mail: t.le@methodintegration.com
    Website: http://www.methodintegration.com
  • 05-11-2012 1:39 PM In reply to

    Re: Increase # in TEXT FIELD

    I can't seem to figure out how to tell it to retrieve the "LAST" record.  I've tried it several ways but there is nothing to point at to match the criteria. In the "From table ____ where ____ is equal to _____"  I'm not sure how to tell it to look at the last record ID and retrieve the CALL# from that record?

    I've tried loop thru grid, character function, retrieve from table... I know how to pull info as it relates to another screen/table so I can compare and filter but this is just looking for the last record.

     

    Any thoughts...

    thx.

    Greg 

    Thank you,
    Wavetec
  • 05-11-2012 2:24 PM In reply to

    Re: Increase # in TEXT FIELD

    @Greg

    From the information given I have the following recommendations :

    Initially set a Result action to the lowest Call#.

    Loop through the Grid/Table and compare the Result against the Value of the Row

    If the value from row > Result then change the Result to that value 

    (I would record the Record ID in another Result just in case)

    When the loop is done the Result will have the highest number from the Grid/Table

    Add 1 to the Result and use it in the new record.

     

    I hope this might help. If I am not understanding your issue then you might illustrate the format of your Grid/Table and we can assist further.

    Ted Le
    Customization Solution Specialist
    Method Integration
    Local: 416.847.0400
    Toll Free: 1.888.925.6238
    Fax: 416.640.6027
    E-mail: t.le@methodintegration.com
    Website: http://www.methodintegration.com
  • 05-11-2012 4:01 PM In reply to

    Re: Increase # in TEXT FIELD

    Ted,

    I'm getting lost here. I'm putting a button on a NEW CALL REPORT SCREEN to assign the next call number (Keep in mind my Call# is CR 12 - xxxx, not just a number)  If I can get it to work, I'll move the actions to "when page loads".

    1. Assign Value to Action Result - Assign Result Name to Value from Screen CallReportGrid: Call# (Not sure how it knows it's the lowest call?)

    2. Start Loop thru Grid - Look @ Call Report Grid / All Rows; show only CallNo; where... CallNo = Action result "lastcall#" from above

    3.

    Method_Ted:
    If the value from row > Result then change the Result to that value
     No Idea how to do this.

    Not sure if I'm even on the right track...  

    Am I supposed to do this from the last Call Report?  how does it save the info for the next one?

    I think if I got this far I could add 1 to the result but I'm not sure about that 100%.

    Is there something on the Default screens that could point me in the right direction?

     

    thx,

    Greg

    Thank you,
    Wavetec
  • 05-15-2012 12:51 PM In reply to

    Re: Increase # in TEXT FIELD

    Wavetec:
    It took me all day but I figured it out.  What I did not know was that you don’t need to use the “where… this… is equal to… that” part of the “retrieve from table” action.  I just always needed that to match up screens before so I didn’t know you could leave it blank and it would just look at all the data in the table and then you could “retrieve last”.  Once I got this far I was able to Char Function to grab just the numbers (it’s a text field CR 12-0000) and then add 1 and put it back in.  I tried to get it to happen “ON PAGE LOAD” but I couldn’t get that to work right so I just added a button.

     

    Please let me know if you need help with adding the action set to the ‘on page load’ area.

     

    Ted Le
    Customization Solution Specialist
    Method Integration
    Local: 416.847.0400
    Toll Free: 1.888.925.6238
    Fax: 416.640.6027
    E-mail: t.le@methodintegration.com
    Website: http://www.methodintegration.com
Page 1 of 1 (7 items)