Autonaming SPCO elements - need help with custom function

 
Parents
  • Several issues noted here.

    firstly, the error returned in the screenshot 1 is the result of the lines in your pmlobj file returning error when finished.  So if it does not find the GTYP listed then it will return 'error' as the string for your autoname substring.  It will also return this at the end of the program as its outside of the If statements.  

    original code

    if !gtype eq 'INSU' then
     return
    endif
     
     return 'error'
     
       
    endfunction


    corrected code to comment out the returned error with --


    if !gtype eq 'INSU' then
     return
    endif
     
    --  return 'error'
     
       
    endfunction


    The second issue is you cannot edit this file.  so you will need some PML to run after the items have been created.  I can post this in another reply.
Reply
  • Several issues noted here.

    firstly, the error returned in the screenshot 1 is the result of the lines in your pmlobj file returning error when finished.  So if it does not find the GTYP listed then it will return 'error' as the string for your autoname substring.  It will also return this at the end of the program as its outside of the If statements.  

    original code

    if !gtype eq 'INSU' then
     return
    endif
     
     return 'error'
     
       
    endfunction


    corrected code to comment out the returned error with --


    if !gtype eq 'INSU' then
     return
    endif
     
    --  return 'error'
     
       
    endfunction


    The second issue is you cannot edit this file.  so you will need some PML to run after the items have been created.  I can post this in another reply.
Children
No Data