This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - create a doc number from a filter list and sequenced number

Ron - Tuesday, October 12, 2010 9:41 AM:

Hi
I am looking to combine the value of a filter list and a sequenced number to form the new document number.
So on the document form I have a list property called Document class and a filter list called Document Type which is filtered based on the document class. I want to use the filter list.value to be added to the next available number (sequenced).
I have the following script which is activated by a button on the form to get the next available number.
   var newNum="";
   newNum=top.aras.getNextSequence('',"Doc_Number");
   newNum = newNum + document.forms[0].name.value;
   handleItemChange("item_number", newNum);
 
Question is how can I get the value of the filter list and add it to the sequenced number?
note: it is the vaule and not the label of the filter list.
Thanks for any help.


Brian - Wednesday, October 13, 2010 6:59 AM:

Hi Ron,

The value of the filter list is what is saved to the item record (assuming it's a property) so if it is not available from the form element then it should be available in the AML going to the server. You could use an onAfterAdd to intercept it, edit the sequenced doc value and continue. It may even work to use an onBeforeAdd/Update so that you don't have to edit the record again.

At the very least you can examine what it is in the onBeforeAdd/Update events.

Cheers,

Brian.



Ron - Wednesday, October 13, 2010 10:46 AM:

Hi Brian

I decided to try a different approach, I have most of the code working, but I cannot seem to read the value  in the field on the form called Doc_Prefix
Here is the code I have, the line [ docprefix =m.getProperty('doc_prefix'); ] fails and I have tried various other attempts,
How does one read the value in a field on the form?
<script>
function getNumber() {
   var m = document.thisItem;
   var newNum="";
   var docprefix="";
   docprefix =m.getProperty('doc_prefix');
   newNum=top.aras.getNextSequence('',"Panacis_Number");
   m.setProperty('item_number',docprefix + newNum);
   handleItemChange("item_number", docprefix + newNum);
   }
</script>
 

 



Ron - Wednesday, October 13, 2010 10:46 AM:

Hi Brian

After a little more searching in this forum I found the answer I needed. This worked for me.

  var docprefix1 = "";
   var docprefix = "";
   docprefix1 =document.getElementsByName('doc_prefix');
   docprefix=docprefix1[0].value;

 

Ron