You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
749 B

var c=(p,e,i)=>new Promise((n,a)=>{var s=t=>{try{r(i.next(t))}catch(m){a(m)}},o=t=>{try{r(i.throw(t))}catch(m){a(m)}},r=t=>t.done?n(t.value):Promise.resolve(t.value).then(s,o);r((i=i.apply(p,e)).next())});import l from"./Entities-808ce667.js";import"./Request-a8cd92a3.js";import"./index-f4658ae7.js";import"./Events-141c34ea.js";import"./form-77f01638.js";import"./ParamsUtils-3cbc5822.js";function h(){return{getNextId:(e,i)=>c(this,null,function*(){const n=new l("BP.Sys.MapAttrs","FrmID",i);yield n.Init();const a=n.getData(),s=`${i}_${e}`,o=a.map(t=>t.MyPK).filter(t=>t.startsWith(s));if(o.length===0)return{id:e+1,title:e+1};const r=Math.max.apply(null,o.map(t=>parseInt(t.replace(s,""))||0))+1;return{id:e+r,title:e+r}})}}export{h as useID};